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