Esempio n. 1
0
        /// <summary>
        /// 监听指定模块的指定事件
        /// </summary>
        /// <param name="target"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public ModuleEvent Event(string target, string type)
        {
            ModuleEvent    evt    = null;
            BusinessModule module = GetModule(target);

            if (module != null)
            {
                evt = module.Event(type);
            }
            else
            {
                //预创建事件
                EventTable table = GetPreEventTable(target);
                evt = table.GetEvent(type);
                this.LogWarning("Event() target不存在!将预监听事件! target:{0}, event:{1}", target, type);
            }
            return(evt);
        }
Esempio n. 2
0
        //=======================================================
        public ModuleEvent Event(string target, string type)
        {
            ModuleEvent evt = null;

            BusinessModule module = GetModule(target);

            if (module != null)
            {
                evt = module.Event(type);
            }
            else
            {
                EventTable table = GetPreListenEventTable(target);
                evt = table.GetEvent(type);
            }

            return(evt);
        }