/// <summary> /// 枚举版本 /// </summary> /// <param name="name"></param> static public void ClearListener(this AStatusListener dl, Enum name) { dl.ClearListener(name.ToString()); }
/// <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); }
/// <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); }
/// <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); }
static public void RemoveListener(this AStatusListener dl, string name, Action <object> callback) { dl.RemoveListener(name, callback); }
/// <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); }
/// <summary> /// 枚举版本 /// </summary> /// <param name="name"></param> static public void RemoveListener(this AStatusListener dl, Enum name) { dl.RemoveListener(name.ToString()); }
/// <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); }
/// <summary> /// 移除所有的监听 /// </summary> static public void ClearListener <T>(this AStatusListener dl) where T : class { dl.ClearListener(typeof(T).FullName); }
/// <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); }
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); }
static public T GetData <T>(this AStatusListener dl, string name) { return(dl.GetData <T>(name)); }
static public void RemoveListener(this AStatusListener dl, string name) { dl.RemoveListener(name); }
/// <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); }
/// <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); }
/// <summary> /// 移除所有的监听 /// </summary> static public void ClearAllListener <T>(this AStatusListener dl) where T : class, new() { dl.RemoveListener(typeof(T).FullName); }
/// <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())); }
/// <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); }
static public void RemoveListener <T>(this AStatusListener dl, string name, Action <T> callback) { dl.RemoveListener(name.ToString(), callback); }