示例#1
0
        public static void Main(string[] args)
        {
            Reciever reciever = new Reciever();
            Invoker  invoker  = new Invoker(new CommandSwitchOff(reciever), new CommandSwitchOn(reciever));

            invoker.SwitchOn();
            invoker.SwitchOff();
        }
示例#2
0
        static void Main(string[] args)
        {
            Reciever r = new Reciever();
            ComplexDegreeResultHolder c = r.CalculateRadical(new Complex(4, 0), 3);

            Console.WriteLine(c.Mod);
            Console.WriteLine("----------------------");
            for (int i = 0; i < c.Arguments.Count; i++)
            {
                Console.WriteLine(c.Arguments[i]);
            }
            Console.WriteLine("----------------------");
            for (int i = 0; i < c.Results.Count; i++)
            {
                Console.WriteLine(c.Results[i]);
            }
            Console.ReadKey();
        }
示例#3
0
 public CommandSwitchOn(Reciever reciever)
 {
     _reciever = reciever;
 }