public void RemoveListener(IGroupListener listener) { lock (this) { this.listeners.Remove(listener); foreach (var id in this.groupIdsByListener[listener]) this.listenersByGroupId[id].Remove(listener); this.groupIdsByListener.Remove(listener); } }
public void AddListener(IGroupListener listener) { lock (this) { this.listeners.Add(listener); this.groupIdsByListener[listener] = new List<int>(); foreach(var group in this.framework.GroupManager.GroupList) ProcessGroup(listener, group); } }
public void RemoveListener(IGroupListener listener) { lock (this) { this.listeners.Remove(listener); foreach (var id in this.groupIdsByListener[listener]) { this.listenersByGroupId[id].Remove(listener); } this.groupIdsByListener.Remove(listener); } }
public void AddListener(IGroupListener listener) { lock (this) { this.listeners.Add(listener); this.groupIdsByListener[listener] = new List <int>(); foreach (var group in this.framework.GroupManager.GroupList) { ProcessGroup(listener, group); } } }
private void ProcessGroup(IGroupListener listener, Group group) { if (listener.OnNewGroup(group)) { var list = this.listenersByGroupId[group.Id] = this.listenersByGroupId[group.Id] ?? new List <IGroupListener>(); list.Add(listener); this.groupIdsByListener[listener].Add(group.Id); foreach (var e in group.Events) { listener.Queue.Enqueue(e); } } }
private void ProcessGroup(IGroupListener listener, Group group) { if (listener.OnNewGroup(group)) { List <IGroupListener> list = this.listenerTable[group.Id]; if (list == null) { list = new List <IGroupListener>(); this.listenerTable[group.Id] = list; } this.groupByListenerTable[listener].Add(group.Id); list.Add(listener); foreach (GroupEvent current in group.Events) { listener.Queue.Enqueue(current); } } }
public void RemoveListener(IGroupListener listener) { bool flag = false; try { Monitor.Enter(this, ref flag); this.listeners.Remove(listener); foreach (int current in this.groupByListenerTable[listener]) { this.listenerTable[current].Remove(listener); } this.groupByListenerTable.Remove(listener); } finally { if (flag) { Monitor.Exit(this); } } }
public void AddListener(IGroupListener listener) { bool flag = false; try { Monitor.Enter(this, ref flag); this.listeners.Add(listener); this.groupByListenerTable[listener] = new List <int>(); foreach (Group current in this.framework.groupManager.GroupList) { this.ProcessGroup(listener, current); } } finally { if (flag) { Monitor.Exit(this); } } }
public void RemoveListener(IGroupListener listener) { bool flag = false; try { Monitor.Enter(this, ref flag); this.listeners.Remove(listener); foreach (int current in this.groupByListenerTable[listener]) { this.listenerTable[current].Remove(listener); } this.groupByListenerTable.Remove(listener); } finally { if (flag) { Monitor.Exit(this); } } }
public void AddListener(IGroupListener listener) { bool flag = false; try { Monitor.Enter(this, ref flag); this.listeners.Add(listener); this.groupByListenerTable[listener] = new List<int>(); foreach (Group current in this.framework.groupManager.GroupList) { this.ProcessGroup(listener, current); } } finally { if (flag) { Monitor.Exit(this); } } }
private void ProcessGroup(IGroupListener listener, Group group) { if (listener.OnNewGroup(group)) { List<IGroupListener> list = this.listenerTable[group.Id]; if (list == null) { list = new List<IGroupListener>(); this.listenerTable[group.Id] = list; } this.groupByListenerTable[listener].Add(group.Id); list.Add(listener); foreach (GroupEvent current in group.Events) { listener.Queue.Enqueue(current); } } }
private void ProcessGroup(IGroupListener listener, Group group) { if (listener.OnNewGroup(group)) { var list = this.listenersByGroupId[group.Id] = this.listenersByGroupId[group.Id] ?? new List<IGroupListener>(); list.Add(listener); this.groupIdsByListener[listener].Add(group.Id); foreach (var e in group.Events) listener.Queue.Enqueue(e); } }