/// <summary> /// Registers new subscriber to the list of subscribers - when notify is called /// then all currently registered subscribers are called. /// </summary> /// <param name="subscriber"></param> public void Attach(CalendarSubscriber subscriber) { if (!Subscribers.Contains(subscriber)) { Subscribers.Add(subscriber); } }
internal void AddSubscriber(ISubscriber subscriber) { if (!Subscribers.Contains(subscriber)) { Subscribers.Add(subscriber); } }
public void Unsubscribe(IReader reader) { if (Subscribers.Contains(reader)) { Subscribers.Remove(reader); } }
/// <summary> /// Removes the subscriber from the list of subscribers - when notify is called /// then all currently registered subscribers are called. /// </summary> /// <param name="subscriber"></param> public void Detach(CalendarSubscriber subscriber) { if (Subscribers.Contains(subscriber)) { Subscribers.Remove(subscriber); } }
/// <summary> /// Registers new subscriber to the list of subscribers - when notify is called /// then all currently registered subscribers are called. /// </summary> /// <param name="subscriber">New subscriber that is registered.</param> public void Attach(SettingsSubscriber subscriber) { if (!Subscribers.Contains(subscriber)) { Subscribers.Add(subscriber); } }
/// <summary> /// Removes the subscriber from the list of subscribers - when notify is called /// then all currently registered subscribers are called. /// </summary> /// <param name="subscriber">Subscriber should be unregister, i.e. removed from the list of subscribers.</param> public void Detach(SettingsSubscriber subscriber) { if (Subscribers.Contains(subscriber)) { Subscribers.Remove(subscriber); } }
/// <summary> /// Subscribes the specified subscriber. /// </summary> /// <param name="subscriber">The subscriber.</param> public void Subscribe(ISubscriber <StorageSite> subscriber) { if (!Subscribers.Contains(subscriber)) { Subscribers.Add(subscriber); } }
public void Subscribe(IReader reader) { if (Subscribers.Contains(reader)) { return; } Subscribers.Add(reader); Console.WriteLine($"{reader.Name} subscribed for the {Name}'s event"); }
public IDisposable Subscribe(IObserver <SubscriberLogEntry> subscriber) { SubscriberLog.Unsubscriber unsub = null; if (!Subscribers.Contains(subscriber)) { Subscribers.Add(subscriber); unsub = new SubscriberLog.Unsubscriber(subscriber, Subscribers); } return(unsub); }
public void Subscribe(User user, LOD_Mode new_mode) { lock (_padLock) { Mode = (LOD_Mode)Math.Max((int)Mode, (int)new_mode); if (!Subscribers.Contains(user)) { Subscribers.Enqueue(user); } } }
private async Task CheckMembers() { try { if (!string.IsNullOrEmpty(Activity.Owner.Email)) { if (Activity.DriverId.HasValue) { Activity.Driver = await _dataService.GetUser(Activity.DriverId.Value); RaisePropertyChanged(() => Activity.Driver); } } Activity.Owner = await _dataService.GetUser(Guid.Parse(Activity.UserId)); if (Subscribers == null || Subscribers.Count == 0) { var useractivities = await _dataService.GetActivitySubscribers(Activity.ID); foreach (var userActivity in useractivities) { if (userActivity.UserId != Activity.Owner.ID) { var user = await _dataService.GetUser(userActivity.UserId); if (!Subscribers.Contains(user)) { Subscribers.Add(user); } } } } } catch { //PAS BIEN } }