protected EventSource(EventSourceStore store, object sourceObject, string eventName) { Interlocked.Increment(ref StatisticsːInstancesˑCreated); Interlocked.Increment(ref StatisticsːInstancesˑCurrent); _WeakStore = store != null ? new WeakReference(store) : null; _WeakSource = new WeakReference(sourceObject); _EventName = eventName; }
// [Obsolete("Use overload!",true)] // public static IWeakEventSource RegisterSource(object source, string eventName) { // return new WeakEventSource(source, eventName); // } // [Obsolete("Use property initializer: public IWeakEventSource<EventHandler> MyPropertyChangedEvent { get { return WeakEventProperties.Get(\"MyPropertyChangedEvent\"); } }")] // public static IWeakEventSource<TEvent> RegisterSource<TEvent>(object source, string eventName) /*where TEvent:EventHandler<EventArgs>*/ { // var eventsource= new WeakEventSource<TEvent>(source, eventName); // return eventsource; // } internal static IEventSource <TEvent> RegisterSource4Store <TEvent>(EventSourceStore store, object source, string eventName) /*where TEvent:EventHandler<EventArgs>*/ { return(new EventSource <TEvent>(store, source, eventName)); }