示例#1
0
        public static void ImpleEvent()
        {
            Operation o = new Operation();

            o.Action("Event calling");
            Console.WriteLine();
            o.xyz += new EventsHandler(CatchEvent);
            o.Action("Events Caller");
        }
 public static void ImplementEvent()
 {
     Operation o = new Operation();
     o.Action("Event Calling");
     Console.WriteLine();
     o.xyz += new EventHandler(CatchEvent);
     o.xyz += new EventHandler(CatchEvent1);
     o.Action("Event Called");
 }
示例#3
0
        public Task CallAction(Action operation)
        {
            var tcs = new TaskCompletionSource <object>();

            Enqueue(Operation.Action(() => operation(), tcs));
            return(tcs.Task);
        }
示例#4
0
文件: Day16.cs 项目: htoomik/aoc2018
        public static bool IsMatch(Operation operation, int[] startingRegisters, int[] arguments, int[] endingRegisters)
        {
            var newRegisters = Copy(startingRegisters);

            operation.Action(newRegisters, arguments[1], arguments[2], arguments[3]);

            return(Equal(newRegisters, endingRegisters));
        }