public Command(Fridge refri, Lights luces, CeilingFan abanico, int estado)
 {
     this.fridge = refri;
     this.lights = luces;
     this.fan    = abanico;
     this.state  = estado;
 }
        static void Main(string[] args)
        {
            Fridge  refri              = new Fridge();
            Lights  luces              = new Lights();
            Command commandOn          = new ConcreteOn(refri, luces);
            Command commandOff         = new ConcreteOff(refri, luces);
            Command commandFreeze      = new ConcreteFreeze(refri, luces);
            Command commandAdjust_Temp = new ConcreteAdjust_Temp(refri, luces);
            Invoker invoker            = new Invoker();

            invoker.SetCommand(commandOn);
            invoker.ExecuteCommand();
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Fridge     refri              = new Fridge();
            Lights     luces              = new Lights();
            CeilingFan abanico            = new CeilingFan();
            int        state              = 0;
            Command    commandOn          = new ConcreteOn(refri, luces, abanico, state);
            Command    commandOff         = new ConcreteOff(refri, luces, abanico, state);
            Command    commandFreeze      = new ConcreteFreeze(refri, luces, abanico, state);
            Command    commandAdjust_Temp = new ConcreteAdjust_Temp(refri, luces, abanico, state);
            Command    commandCeilingFan  = new ConcreteCeilingFan(refri, luces, abanico, state);
            Invoker    invoker            = new Invoker();

            //macro command
            invoker.SetCommand(commandOn);
            invoker.SetCommand(commandFreeze);
            invoker.SetCommand(commandCeilingFan);
            invoker.ExecuteCommand(2);
            invoker.UndoCommand();

            Console.ReadLine();
        }
示例#4
0
 public ConcreteAdjust_Temp(Fridge fridge, Lights lights) : base(fridge, lights)
 {
 }
示例#5
0
 public Command(Fridge refri, Lights luces)
 {
     this.fridge = refri;
     this.lights = luces;
 }
示例#6
0
 public ConcreteOff(Fridge fridge, Lights lights) : base(fridge, lights)
 {
 }
 public ConcreteAdjust_Temp(Fridge fridge, Lights lights, CeilingFan fan, int state) : base(fridge, lights, fan, state)
 {
 }
示例#8
0
 public ConcreteCeilingFan(Fridge refri, Lights luces, CeilingFan fan, int estado) : base(refri, luces, fan, estado)
 {
 }
示例#9
0
 public ConcreteFreeze(Fridge fridge, Lights lights, CeilingFan fan, int state) : base(fridge, lights, fan, state)
 {
 }
示例#10
0
 public ConcreteFreeze(Fridge fridge, Lights lights) : base(fridge, lights)
 {
 }