Ejemplo n.º 1
0
        /// <summary>
        ///     Removes a subscription to the specified handler.
        /// </summary>
        /// <param name="handler">
        ///     The handler to unsubscribe.
        /// </param>
        private void Unsubscribe(Delegate handler)
        {
            // Try to find existing subscription
            var existing = FindSubscription(handler);

            // If found, remove it
            if (existing != null)
            {
                _subscriptions.Remove(existing);
            }
        }
Ejemplo n.º 2
0
 public void Unsubscribe <TMessage>(Subscriber.For <TMessage> subscriber) where TMessage : IMessage
 {
     subscribers.Remove(subscriber);
 }