예제 #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;
 }