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