Beispiel #1
0
        public static object SubscribeOnce(this object instance, string eventName, Delegate handler, out EventSubscription subscription)
        {
            object result = instance.UnSubscribe(eventName, handler).Subscribe(eventName, handler);

            subscription = instance.GetEventSubscriptions(eventName).FirstOrDefault(es => es.Delegate.Equals(handler));
            return(result);
        }
Beispiel #2
0
 public static object SubscribeOnce(this object instance, string eventName, EventHandler handler, out EventSubscription subscription)
 {
     return(SubscribeOnce(instance, eventName, (Delegate)handler, out subscription));
 }