예제 #1
0
        public static Event DoEvent(this IEventSource self,
                                    string name,
                                    EventReturnMethod returnMethod,
                                    PythonDictionary args = null)
        {
            args = args ?? new PythonDictionary();
            var argList = args.Select(EventArg.Convert)
                          .ToList();

            return(self.DoEvent(name, returnMethod, argList));
        }
예제 #2
0
 public static void Has(this IEventSource self, string action, PythonDictionary args = null)
 {
     self.DoEvent("ch_" + action, EventReturnMethod.None, args);
 }
예제 #3
0
 public static void Has(this IEventSource self, string action, params EventArg[] args)
 {
     self.DoEvent("ch_" + action, EventReturnMethod.None, args);
 }
예제 #4
0
        public static bool Can(this IEventSource self, string action, params EventArg[] args)
        {
            var @event = self.DoEvent("ch_can_" + action, EventReturnMethod.And, args);

            return(@event.ReturnValue);
        }
예제 #5
0
        public static bool Can(this IEventSource self, string action, PythonDictionary args = null)
        {
            var canEvent = self.DoEvent("ch_can_" + action, EventReturnMethod.And, args);

            return(canEvent.ReturnValue);
        }