예제 #1
0
        private void RoomRemoved(object sender, EventArgsRoom e)
        {
            IList <Source> sourceList = new List <Source>();

            lock (this)
            {
                e.Room.EventSourceAdded   -= SourceAdded;
                e.Room.EventSourceRemoved -= SourceRemoved;
                Room room = e.Room as Room;
                room.Lock();

                foreach (Source s in room.SourceList)
                {
                    if (iSourceList.Remove(s))
                    {
                        sourceList.Add(s);
                    }
                }

                room.Unlock();
            }

            foreach (Source s in sourceList)
            {
                if (EventSourceRemoved != null)
                {
                    EventSourceRemoved(this, new EventArgsSource(s));
                }
            }
        }
예제 #2
0
 private void RoomAdded(object sender, EventArgsRoom e)
 {
     lock (this)
     {
         e.Room.EventSourceAdded   += SourceAdded;
         e.Room.EventSourceRemoved += SourceRemoved;
     }
 }