public void OnFireEvent(EFireCategory fireCategory) { FireAlarmEventArgs fe = new FireAlarmEventArgs(fireCategory); if (FireEvent != null) FireEvent(this, fe); }
public override void FireAlarmHandlerMethod(object fireSubject, FireAlarmEventArgs fe) { int freq = 0; switch (fe.FireCategory) { case EFireCategory.MINOR: freq = 440; break; case EFireCategory.SERIOUS: freq = 660; break; case EFireCategory.INFERNO: freq = 880; break; default: break; } Beep(freq, DURATION); }
public override void FireAlarmHandlerMethod(object fireSubject, FireAlarmEventArgs fe) { String message = "Fire is " + fe.FireCategory.ToString() + "."; switch (fe.FireCategory) { case EFireCategory.MINOR: message += " Use a fire extinguisher"; break; case EFireCategory.SERIOUS: message += " Call the Fire Department"; break; case EFireCategory.INFERNO: message += " Evactuate Immediately!!!"; break; default: break; } MessageBox.Show(message); }
public abstract void FireAlarmHandlerMethod(object fireSubject, FireAlarmEventArgs fe);