Пример #1
0
 /// <summary>
 /// Setup a subscription to multiple messages using a messageSubscriber object
 /// </summary>
 /// <param name="subscriber">the message subscription information</param>
 public void Subscribe(MessageSubscriber subscriber)
 {
     //add the individual subscriptions
     for (int i = 0; i < subscriber.MessageTypes.Count; i++)
     {
         Subscribe(subscriber.MessageTypes[i], subscriber.Handler);
     }
 }
Пример #2
0
 /// <summary>
 /// unsubscribe a messagesubscriber from it's defined subscriptions
 /// </summary>
 /// <param name="subscriber">The message subscription information to remove</param>
 public void Unsubscribe(MessageSubscriber subscriber)
 {
     //run through each messagetype
     for (int i = 0; i < subscriber.MessageTypes.Count; i++)
     {
         Unsubscribe(subscriber.MessageTypes[i], subscriber.Handler);
     }
 }