Example #1
0
        /// <summary>
        /// 抛出一型事件(抛出事件时,请使用引用池生成事件处理者实例)
        /// </summary>
        /// <param name="sender">事件发送者</param>
        /// <param name="handler">事件处理类实例</param>
        public void Throw(object sender, EventHandlerBase handler)
        {
            Type type = handler.GetType();

            if (EventHandlerList1.ContainsKey(type))
            {
                if (EventHandlerList1[type] != null)
                {
                    EventHandlerList1[type](sender, handler);
                    Main.m_ReferencePool.Despawn(handler);
                }
            }
            else
            {
                throw new HTFrameworkException(HTFrameworkModule.Event, "抛出I型事件失败:不存在可以抛出的事件类型 " + type.Name + " !");
            }
        }
Example #2
0
 /// <summary>
 /// 终结助手
 /// </summary>
 public void OnTermination()
 {
     EventHandlerList1.Clear();
     EventHandlerList2.Clear();
     EventHandlerList3.Clear();
 }