示例#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");
 }