Exemple #1
0
 public override void Off(Switch sw)
 {
     Console.WriteLine("Turning light off...");
     sw.State = new OffState();
 }
Exemple #2
0
 public override void On(Switch sw)
 {
     Console.WriteLine("Turning light on...");
     sw.State = new OnState();
 }
Exemple #3
0
 public virtual void Off(Switch sw)
 {
     Console.WriteLine("Light is already off.");
 }