Esempio n. 1
0
        public void Distribute(int nMsgCode, params object[] rEventArgs)
        {
            EventArg rEventArg = new EventArg()
            {
                Args = new List <object>(rEventArgs)
            };

            this.DistributeArg(nMsgCode, rEventArg);
        }
Esempio n. 2
0
        public void DistributeArg(int nMsgCode, EventArg rEventArg)
        {
            Event rEvent = null;

            if (this.mEvents.TryGetValue(nMsgCode, out rEvent))
            {
                if (rEvent.Callbacks != null)
                {
                    for (int i = 0; i < rEvent.Callbacks.Count; i++)
                    {
                        UtilTool.SafeExecute(rEvent.Callbacks[i], rEventArg);
                    }
                }
            }
        }