//on fire takes a firelevel as argument and public void OnFire(EFireLevel fireLvl) { FireAlarmType fireEvent = new FireAlarmType(fireLvl); if (feHandler != null) feHandler(this, fireEvent); }
public override void FireAlarmHandler(Object o, FireAlarmType e) { int frequency; switch (e.FireLvl) { case EFireLevel.MINOR: frequency = 332; break; case EFireLevel.SERIOUS: frequency = 432; break; case EFireLevel.INFERNO: frequency = 666; break; default: throw new ArgumentOutOfRangeException(); } //beeps at set freq 5 times Beep(frequency, 300); System.Threading.Thread.Sleep(100); Beep(frequency, 300); System.Threading.Thread.Sleep(100); Beep(frequency, 300); System.Threading.Thread.Sleep(100); Beep(frequency, 300); System.Threading.Thread.Sleep(100); Beep(frequency, 300); }
//on fire takes a firelevel as argument and public void OnFire(EFireLevel fireLvl) { FireAlarmType fireEvent = new FireAlarmType(fireLvl); if (feHandler != null) { feHandler(this, fireEvent); } }
public override void FireAlarmHandler(Object o, FireAlarmType e) { String output = "This "; switch (e.FireLvl) { case EFireLevel.MINOR: output += "fire is minor, it will go out on its own."; break; case EFireLevel.SERIOUS: output += "fire is serious, call the Ambalamps"; break; case EFireLevel.INFERNO: output += "fire is blazing out of control!"; break; default: throw new ArgumentOutOfRangeException(); } //shows the set message MessageBox.Show(output); }
public abstract void FireAlarmHandler(Object o, FireAlarmType fireEvent);