Пример #1
0
 public override void On(Switch sw)
 {
     Console.WriteLine("Turning light on!");
     sw.state = new OnState();
 }
Пример #2
0
 public virtual void Off(Switch sw)
 {
     Console.WriteLine("The light is already off!");
 }
Пример #3
0
 public override void Off(Switch sw)
 {
     Console.WriteLine("Turning light off!");
     sw.state = new OffState();
 }
Пример #4
0
 public virtual void On(Switch sw)
 {
     Console.WriteLine("Light is already on");
 }