|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Events;
namespace GenericEventAggregator
{
public static class ServicesFactory
{
// Singleton instance of the EventAggregator service
private static EventAggregator eventSerice = null;
// Lock (sync) object
private static object _syncRoot = new object();
// Factory method
public static EventAggregator EventService
{
get
{
// Lock execution thread in case of multi-threaded
// (concurrent) access.
lock (_syncRoot)
{
if (null == eventSerice)
{
eventSerice = new EventAggregator();
}
// Return singleton instance
return eventSerice;
} // lock
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm very interested on .Net related technologies (WPF,WCF,WF,Data services, Silverlight ...) and software Architecture issues.