Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 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);
         }
     }
 }
Ejemplo n.º 5
0
 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);
         }
     }
 }
Ejemplo n.º 6
0
 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);
         }
     }
 }
Ejemplo n.º 7
0
        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);
                }
            }
        }
Ejemplo n.º 8
0
        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);
                }
            }
        }
Ejemplo n.º 9
0
		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);
				}
			}
		}
Ejemplo n.º 10
0
		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);
				}
			}
		}
Ejemplo n.º 11
0
		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);
				}
			}
		}
Ejemplo n.º 12
0
 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);
     }
 }