示例#1
0
 /// <summary>
 /// 是否有该事件的监听器
 /// </summary>
 /// <param name="eventId"></param>
 /// <returns></returns>
 public static bool HasListener(int eventId)
 {
     return(DispatcherManager.GetInstance().HasListener(eventId));
 }
示例#2
0
 /// <summary>
 /// 清除所有的事件监听器。
 /// </summary>
 public static void Clear()
 {
     DispatcherManager.GetInstance().Clear();
 }
示例#3
0
 /// <summary>
 /// 移除对指定事件的监听。
 /// </summary>
 /// <param name="eventId">事件编号</param>
 /// <param name="callback1">回调委托</param>
 public static void RemoveListener(int eventId, EventCallback1 callback1)
 {
     DispatcherManager.GetInstance().RemoveListener(eventId, callback1);
 }
示例#4
0
 /// <summary>
 /// 添加对指定事件的监听。
 /// </summary>
 /// <param name="eventId">事件编号</param>
 /// <param name="listener">回调委托</param>
 public static void AddListener(int eventId, EventCallback1 listener, int priority = 1)
 {
     DispatcherManager.GetInstance().AddListener(eventId, listener, priority);
 }
示例#5
0
 /// <summary>
 /// 广播指定事件。
 /// </summary>
 /// <param name="eventId">事件编号</param>
 /// <param name="args">事件参数</param>
 public static void Dispatch(int eventId, object sender = null, params object[] args)
 {
     DispatcherManager.GetInstance().Dispatch(eventId, sender, args);
 }
示例#6
0
 public void Initialize()
 {
     DispatcherManager.GetInstance().AddListener(EventType.TEST_EVENT, Test);
 }