public void Dispatch(object[] args) { try { this.BaseListener?.Invoke(this, args); this.OnceBaseListener?.Invoke(this, args); } catch (Exception ex) { Log.Error(LogGroups.Engine, CoreUtil.FormatExceptionString("BaseSignal", "Trapped listener exception", ex)); } this.OnceBaseListener = null; numOnceListeners = 0; }
public void Dispatch() { try { Action listener = this.Listener; if (listener != null) { listener(); } Action onceListener = this.OnceListener; if (onceListener != null) { onceListener(); } } catch (Exception ex) { Log.Error(LogGroups.Engine, CoreUtil.FormatExceptionString("Signal", "Trapped listener exception", ex)); } this.OnceListener = null; numOnceListeners = 0; Dispatch(null); }