Exemple #1
0
        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();
        }
Exemple #2
0
 public MessageHandleAttribute(object eventName)
 {
     EventName = EventKeyToStrConv.ToStr(eventName);
 }
Exemple #3
0
 public BindingCommand <U> Command <T, U>(T name, Action <U> onViewEvent, Func <bool> canExecute = null)
 {
     return(Command(EventKeyToStrConv.ToStr(name), onViewEvent, canExecute));
 }
Exemple #4
0
 public BindingCommand <U> Command <T, U>(T name, ICommand <U> cmd)
 {
     return(Command(EventKeyToStrConv.ToStr(name), cmd));
 }
Exemple #5
0
 public void Publish <T>(T name)
 {
     Get <BindingEvent>(EventKeyToStrConv.ToStr(name))?.Invoke();
 }
Exemple #6
0
 public void Unsubscribe <T>(object name, System.Action <T> onViewEvent)
 {
     Unsubscribe(EventKeyToStrConv.ToStr(name), onViewEvent);
 }
Exemple #7
0
 public void Unsubscribe <T, U>(T name, System.Action <U> onViewEvent)
 {
     Unsubscribe(EventKeyToStrConv.ToStr(name), onViewEvent);
 }
Exemple #8
0
 public void Subscribe(object name, System.Action onViewEvent)
 {
     Subscribe(EventKeyToStrConv.ToStr(name), onViewEvent);
 }
Exemple #9
0
 public void Publish <T, U>(T name, U args)
 {
     Get <BindingEvent <U> >(EventKeyToStrConv.ToStr(name))?.Invoke(args);
 }