static EventNameDrawer() { var dic = new Dictionary <string, string>(); dic[""] = "None"; foreach (var type in GetEventKeyTypes()) { string baseName = type.FullName; foreach (var val in Enum.GetValues(type)) { var key = EventKeyToStrConv.ToStr(val); dic[key] = baseName + "/" + val; } } s_Keys = dic.Keys.ToArray(); s_Values = dic.Values.ToArray(); }
public MessageHandleAttribute(object eventName) { EventName = EventKeyToStrConv.ToStr(eventName); }
public BindingCommand <U> Command <T, U>(T name, Action <U> onViewEvent, Func <bool> canExecute = null) { return(Command(EventKeyToStrConv.ToStr(name), onViewEvent, canExecute)); }
public BindingCommand <U> Command <T, U>(T name, ICommand <U> cmd) { return(Command(EventKeyToStrConv.ToStr(name), cmd)); }
public void Publish <T>(T name) { Get <BindingEvent>(EventKeyToStrConv.ToStr(name))?.Invoke(); }
public void Unsubscribe <T>(object name, System.Action <T> onViewEvent) { Unsubscribe(EventKeyToStrConv.ToStr(name), onViewEvent); }
public void Unsubscribe <T, U>(T name, System.Action <U> onViewEvent) { Unsubscribe(EventKeyToStrConv.ToStr(name), onViewEvent); }
public void Subscribe(object name, System.Action onViewEvent) { Subscribe(EventKeyToStrConv.ToStr(name), onViewEvent); }
public void Publish <T, U>(T name, U args) { Get <BindingEvent <U> >(EventKeyToStrConv.ToStr(name))?.Invoke(args); }