-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (23 loc) · 753 Bytes
/
Copy pathProgram.cs
File metadata and controls
28 lines (23 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DesignPattern.RemoteControl.CommandPattern
{
class Program
{
static void Main(string[] args)
{
SimpleRemoteControl remote = new SimpleRemoteControl();
Light light = new Light();
LightOnCommand lightOn = new LightOnCommand(light);
GarageDoor garageDoor = new GarageDoor();
GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(garageDoor);
remote.SetCommand(lightOn);
remote.ButtonWasPressed();
remote.SetCommand(garageDoorOpen);
remote.ButtonWasPressed();
Console.ReadLine();
}
}
}