コード例 #1
0
        public void Doctor_Advice_Make()
        {
            Doctor           doctor           = new Doctor();
            DoctorMakeAdvice doctorMakeAdvice = new DoctorMakeAdvice(doctor);

            CommandInvoker invoker = new CommandInvoker();

            invoker.SetCommand(doctorMakeAdvice);

            invoker.CommandOn();
        }
コード例 #2
0
        public void MutiCommand_Execute()
        {
            Doctor           doctor           = new Doctor();
            DoctorMakeAdvice doctorMakeAdvice = new DoctorMakeAdvice(doctor);

            Light          light          = new Light();
            LightOnCommand lightOnCommand = new LightOnCommand(light);

            MultiCommand multiCommand = new MultiCommand(new ICommand[] { doctorMakeAdvice, lightOnCommand });

            multiCommand.Execute();
        }