void OnEnable() { subscription = new CountEventHandler(CounterWatcher); if (counter != null) { counter.CountChanged += subscription; } }
/// <summary> /// Unified handler trigger used by other "On[Event]" functions /// </summary> /// <param name="e"></param> /// <param name="DelegateType"></param> private void _runDelegateByType(TimerEventArgs e, object DelegateType) { CountEventHandler eventDelegate = (CountEventHandler)listEventDelegates[DelegateType]; if (eventDelegate == null) { return; } eventDelegate(this, e); }
public SubscriberWrapper(CountEventHandler h) { this.handler = h; }