Example #1
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce <T>(this ADataListener dl, Enum name,
                                        Action <object> callback = null,
                                        int oder = -1, bool isTriggerCacheData = false)
 {
     AddListener(dl, name, callback, oder, 1, isTriggerCacheData);
 }
Example #2
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void TriggerEvent(this ADataListener dl, Enum name, object value = null,
                                 bool isTriggerCallback = true)
 {
     dl.TriggerEvent(name.ToString(), value, isTriggerCallback);
 }
Example #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 ADataListener 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);
 }
Example #4
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="enum"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void SetData(this ADataListener dl, Enum @enum, object value, bool isTriggerCallback = true)
 {
     dl.SetData(@enum.ToString(), value, isTriggerCallback);
 }
Example #5
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 static public T GetData <T>(this ADataListener dl, Enum name)
 {
     return(dl.GetData <T>(name.ToString()));
 }
Example #6
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 static public void RemoveListener(this ADataListener dl, Enum name)
 {
     dl.RemoveListener(name.ToString());
 }
Example #7
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 static public void AddData(this ADataListener dl, Enum name)
 {
     dl.AddData(name.ToString());
 }
Example #8
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 static public void ClearListener(this ADataListener dl, Enum name)
 {
     dl.ClearListener(name.ToString());
 }
Example #9
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 static public void RemoveListener <T>(this ADataListener dl, Enum name, Action <T> callback)
 {
     dl.RemoveListener(name.ToString(), callback);
 }
Example #10
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 static public void RemoveListener <T>(this ADataListener dl, Action <T> callback)  where  T : class, new()
 {
     dl.RemoveListener(typeof(T).FullName, callback);
 }
Example #11
0
 /// <summary>
 /// T版本触发监听
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void TriggerEvent <T>(this ADataListener dl, T value = null)  where  T : class
 {
     dl.TriggerEvent(typeof(T).FullName, value, true);
 }
Example #12
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 ADataListener 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);
 }
 /// <summary>
 /// 移除所有的监听
 /// </summary>
 static public void ClearAllListener <T>(this ADataListener dl) where T : class, new()
 {
     dl.RemoveListener(typeof(T).FullName);
 }
 /// <summary>
 /// T版本监听一次
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce <T>(this ADataListener 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);
 }
Example #15
0
 /// <summary>
 /// 枚举版本
 /// </summary>
 /// <param name="name"></param>
 /// <param name="callback"></param>
 /// <param name="isTriggerCacheData"></param>
 static public void AddListenerOnce(this ADataListener dl, Enum name, Action <object> callback = null,
                                    bool isTriggerCacheData = false)
 {
     dl.AddListenerOnce(name.ToString(), callback, isTriggerCacheData);
 }
 /// <summary>
 /// T版本触发监听
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="isTriggerCallback"></param>
 static public void TriggerEvent(this ADataListener dl, object value = null,
                                 bool isTriggerCallback = true)
 {
     dl.TriggerEvent(value.GetType().FullName, value, isTriggerCallback);
 }