예제 #1
0
 public static void Unsubscribe(Guid token)
 {
     lock (GlobalSubscriptions)
     {
         GlobalSubscriptions.Remove(token);
         ++_subscriptionsChangeCounter;
     }
 }
예제 #2
0
                public static Guid Subscribe(Action <T> action)
                {
                    var guid = Guid.NewGuid();

                    lock (GlobalSubscriptions)
                    {
                        GlobalSubscriptions.Add(guid, action);
                        ++_subscriptionsChangeCounter;
                    }

                    return(guid);
                }