Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
 public void UnregisterEvents <T>(T obj) where T : class
 {
     foreach (var kv in RegisteredEvents.ToArray())
     {
         kv.Value.Clear(obj);
     }
 }
Ejemplo n.º 3
0
        public void Reset()
        {
            var registered = RegisteredEvents.ToArray();

            foreach (var reg in registered)
            {
                reg.Value.ClearAll();
            }
        }