/// <summary> /// Manually registers the specified callback handler. /// This is generally not required, as a handler will register itself when it is created. /// If the specified callback is already registered, no exception is thrown. /// </summary> /// <param name="call">The callback handler to register.</param> public void Register(Internal.CallbackBase call) { if (registeredCallbacks.Contains(call)) { return; } registeredCallbacks.Add(call); }
void IDisposable.Dispose() { if (call != null && manager != null) { manager.Unsubscribe(call); call = null; manager = null; } }
/// <summary> /// Unregisters the specified callback handler. /// This is generally not required, as a handler will unregister itself when disposed or finalized. /// If the specified callback isn't registered, no exception is thrown. /// </summary> /// <param name="call">The callback handler to unregister.</param> public void Unregister(Internal.CallbackBase call) { registeredCallbacks.Remove(call); }
public Subscription(Internal.CallbackBase call, CallbackManager manager) { this.manager = manager; this.call = call; }
internal void Unsubscribe(Internal.CallbackBase call) { registeredCallbacks.Remove(call); }
public void Unregister(Internal.CallbackBase call) { Unsubscribe(call); }