/// <summary> /// Remove weak handler from the list /// </summary> /// <param name="source">The event source</param> /// <param name="handler">The event handler</param> /// <returns>True if the handler was removed, otherwise false</returns> public bool RemoveWeakHandler(TEventSource source, TEventHandler handler) { foreach (var weakHandler in handlers) { if (weakHandler.Matches(source, handler)) { return handlers.Remove(weakHandler); } } return false; }
public void AddWeakHandler(TEventSource source, TEventHandler handler) { WeakHandler handlerSink = new WeakHandler(source, handler); _handlers.Add(handlerSink); }
public TEventSource CreateEventSource <TEventSource>() where TEventSource : EventSource, new() { var eventSource = new TEventSource(); //SemanticLoggingConfiguration.Default.GetEventSource<TEventSource>(); return(eventSource); }