Exemplo n.º 1
0
 public void Unsubscribe(IMazeWatcher watcher)
 {
     if (watcher == null)
         throw new ArgumentNullException("watcher");
     lock (watchers)
     {
         if (!watchers.Contains(watcher))
             return;
         watchers.Remove(watcher);
         watcher.YouHaveBeenUnsubscribed();
     }
 }
Exemplo n.º 2
0
 public void Subscribe(IMazeWatcher watcher)
 {
     if(watcher == null)
         throw new ArgumentNullException("watcher");
     lock (watchers)
     {
         if (watchers.Contains(watcher))
             return;
         watchers.Add(watcher);
     }
 }