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();
        }
Example #4
0
 public ConcreteAdjust_Temp(Fridge fridge, Lights lights) : base(fridge, lights)
 {
 }
Example #5
0
 public Command(Fridge refri, Lights luces)
 {
     this.fridge = refri;
     this.lights = luces;
 }
Example #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)
 {
 }
Example #8
0
 public ConcreteCeilingFan(Fridge refri, Lights luces, CeilingFan fan, int estado) : base(refri, luces, fan, estado)
 {
 }
Example #9
0
 public ConcreteFreeze(Fridge fridge, Lights lights, CeilingFan fan, int state) : base(fridge, lights, fan, state)
 {
 }
Example #10
0
 public ConcreteFreeze(Fridge fridge, Lights lights) : base(fridge, lights)
 {
 }