コード例 #1
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 static public void ClearListener(this AStatusListener dl, Enum name)
 {
     dl.ClearListener(name.ToString());
 }
コード例 #2
0
 /// <summary>
 /// T版本监听一次
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce <T>(this AStatusListener dl, Action <T> callback = null, int order = -1, bool isTriggerCacheData = false) where T : class, new()
 {
     dl.AddListener <T>(typeof(T).FullName, callback, order, 1, isTriggerCacheData);
 }
コード例 #3
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="dl"></param>
 /// <param name="name">监听数据名</param>
 /// <param name="action">回调</param>
 /// <param name="order">顺序</param>
 /// <param name="triggerNum">触发次数,-1代表一直触发</param>
 /// <param name="isTriggerCacheData">是否触发回调</param>
 /// <typeparam name="T"></typeparam>
 static public void AddListener <T>(this AStatusListener dl, Enum name, Action <T> action = null,
                                    int order      = -1,
                                    int triggerNum = -1, bool isTriggerCacheData = false)  where T : class
 {
     dl.AddListener <T>(name.ToString(), action, order, triggerNum, isTriggerCacheData);
 }
コード例 #4
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce(this AStatusListener dl, Enum name,
                                    Action <object> callback = null,
                                    int oder = -1, bool isTriggerCacheData = false)
 {
     AddListener(dl, name, callback, oder, 1, isTriggerCacheData);
 }
コード例 #5
0
 static public void RemoveListener(this AStatusListener dl, string name, Action <object> callback)
 {
     dl.RemoveListener(name, callback);
 }
コード例 #6
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void TriggerEvent(this AStatusListener dl, Enum name, object value = null,
                                 bool isTriggerCallback = true)
 {
     dl.TriggerEvent(name.ToString(), value, isTriggerCallback);
 }
コード例 #7
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 static public void RemoveListener(this AStatusListener dl, Enum name)
 {
     dl.RemoveListener(name.ToString());
 }
コード例 #8
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 static public void RemoveListener <T>(this AStatusListener dl, Action <T> callback) where T : class, new()
 {
     dl.RemoveListener(typeof(T).FullName, callback);
 }
コード例 #9
0
 /// <summary>
 /// 移除所有的监听
 /// </summary>
 static public void ClearListener <T>(this AStatusListener dl) where T : class
 {
     dl.ClearListener(typeof(T).FullName);
 }
コード例 #10
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 static public void RemoveListener(this AStatusListener dl, Enum name, Action <object> callback)
 {
     dl.RemoveListener(name.ToString(), callback);
 }
コード例 #11
0
 static public void AddListener(this AStatusListener dl, string name, Action <object> action = null,
                                int order      = -1,
                                int triggerNum = -1, bool isTriggerCacheData = false)
 {
     dl.AddListener(name, action, order, triggerNum, isTriggerCacheData);
 }
コード例 #12
0
 static public T GetData <T>(this AStatusListener dl, string name)
 {
     return(dl.GetData <T>(name));
 }
コード例 #13
0
 static public void RemoveListener(this AStatusListener dl, string name)
 {
     dl.RemoveListener(name);
 }
コード例 #14
0
 /// <summary>
 /// T版本添加监听
 /// </summary>
 /// <param name="dl"></param>
 /// <param name="name">监听数据名</param>
 /// <param name="action">回调</param>
 /// <param name="order">顺序</param>
 /// <param name="triggerNum">触发次数,-1代表一直触发</param>
 /// <param name="isTriggerCacheData">是否触发回调</param>
 /// <typeparam name="T"></typeparam>
 static public void AddListener <T>(this AStatusListener dl, Action <T> action = null, int order = -1, int triggerNum = -1, bool isTriggerCacheData = false) where T : class, new()
 {
     dl.AddListener <T>(typeof(T).FullName, action, order, triggerNum, isTriggerCacheData);
 }
コード例 #15
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="enum"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void SetData(this AStatusListener dl, Enum @enum, object value, bool isTriggerCallback = true)
 {
     dl.SetData(@enum.ToString(), value, isTriggerCallback);
 }
コード例 #16
0
 /// <summary>
 /// 移除所有的监听
 /// </summary>
 static public void ClearAllListener <T>(this AStatusListener dl) where T : class, new()
 {
     dl.RemoveListener(typeof(T).FullName);
 }
コード例 #17
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 static public T GetData <T>(this AStatusListener dl, Enum name)
 {
     return(dl.GetData <T>(name.ToString()));
 }
コード例 #18
0
 /// <summary>
 /// T版本触发监听
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void TriggerEvent <T>(this AStatusListener dl, T value = null) where T : class
 {
     dl.TriggerEvent(typeof(T).FullName, value, true);
 }
コード例 #19
0
 static public void RemoveListener <T>(this AStatusListener dl, string name, Action <T> callback)
 {
     dl.RemoveListener(name.ToString(), callback);
 }