Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
 void IDisposable.Dispose()
 {
     if (call != null && manager != null)
     {
         manager.Unsubscribe(call);
         call    = null;
         manager = null;
     }
 }
Beispiel #3
0
 /// <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);
 }
Beispiel #4
0
 public Subscription(Internal.CallbackBase call, CallbackManager manager)
 {
     this.manager = manager;
     this.call    = call;
 }
Beispiel #5
0
 internal void Unsubscribe(Internal.CallbackBase call)
 {
     registeredCallbacks.Remove(call);
 }
Beispiel #6
0
 public void Unregister(Internal.CallbackBase call)
 {
     Unsubscribe(call);
 }