public void AddListener(Action <ISignal, object[]> callback) { foreach (Delegate del in BaseListener.GetInvocationList()) { Action <ISignal, object[]> action = (Action <ISignal, object[]>)del; if (callback.Equals(action)) { return; } } BaseListener += callback; }
public void AddListener(Action <IBaseSignal, object[]> callback) { foreach (Delegate del in BaseListener.GetInvocationList()) { Action <IBaseSignal, object[]> action = (Action <IBaseSignal, object[]>)del; if (callback.Equals(action)) //If this callback exists already, ignore this addlistener { return; } } BaseListener += callback; }