示例#1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            SimpleRemoteControl remote = new SimpleRemoteControl();
            Light          light       = new Light();
            LightOnCommand lightOn     = new LightOnCommand(light);

            remote.setCommand(lightOn);
            salida.Text  = remote.buttonWasPressed();
            salida.Text += "\n" + remote.undoWasPressed();
        }