public void Ignite(object sender, SwitchedEventArgs e) { if (e.State) { Console.WriteLine("Tubelight is ON"); } else { Console.WriteLine("Tubelight is OFF"); } }
public void Burn(object sender, SwitchedEventArgs e) { if (e.State) { Console.WriteLine("lightbulb is ON"); } else { Console.WriteLine("lightbulb is OFF"); } }
protected virtual void OnSwitched(SwitchedEventArgs e) { SwitchedEventHandler temp = Switched; // make it thread-safe temp?.Invoke(this, e); }