/// <summary> /// Unregisters all <see cref="EventHandlerAttribute"/> from the specified <see cref="IEventHandler"/> implementation from the current EventDispatcher /// After UnRegistering, the class will no longer get invoked when an event gets dispatched. /// </summary> /// <param name="obj">The implementation to unregister the eventhandlers for</param> public void UnregisterEvents(IEventHandler obj) { foreach (var kv in RegisteredEvents.ToArray()) { kv.Value.Clear(obj); } }
public void UnregisterEvents <T>(T obj) where T : class { foreach (var kv in RegisteredEvents.ToArray()) { kv.Value.Clear(obj); } }
public void Reset() { var registered = RegisteredEvents.ToArray(); foreach (var reg in registered) { reg.Value.ClearAll(); } }