public static void Unsubscribe(Guid token) { lock (GlobalSubscriptions) { GlobalSubscriptions.Remove(token); ++_subscriptionsChangeCounter; } }
public static Guid Subscribe(Action <T> action) { var guid = Guid.NewGuid(); lock (GlobalSubscriptions) { GlobalSubscriptions.Add(guid, action); ++_subscriptionsChangeCounter; } return(guid); }