Ejemplo n.º 1
0
        public void RemoveVoteListener(int nEventID, EventEngine.VoteCallback callback)
        {
            List <EventEngine.VoteCallback> list = null;

            if (this.m_VoteList.TryGetValue(nEventID, out list))
            {
                list.Remove(callback);
            }
        }
Ejemplo n.º 2
0
        public void AddVoteListener(int nEventID, EventEngine.VoteCallback callback)
        {
            if (this.m_VoteList == null)
            {
                this.m_VoteList = new Dictionary <int, List <EventEngine.VoteCallback> >();
            }
            List <EventEngine.VoteCallback> list = null;

            if (!this.m_VoteList.TryGetValue(nEventID, out list))
            {
                list = new List <EventEngine.VoteCallback>();
                this.m_VoteList.Add(nEventID, list);
            }
            if (!list.Contains(callback))
            {
                list.Add(callback);
            }
        }