public void OnFireEvent(EFireCategory fCat)
        {
            FireAlarmEventArgs fe = new FireAlarmEventArgs(fCat);

            if (FireEvent != null)
            {
                FireEvent(this, fe);
            }
        }
        public override void FireAlarmHandlerMethod(object fireSubject, FireAlarmEventArgs fe)
        {
            switch (fe.FireCategory)
            {
            case EFireCategory.MINOR:
                Beep(200, 1000);
                break;

            case EFireCategory.SERIOUS:
                Beep(300, 1000);
                break;

            case EFireCategory.INFERNO:
                Beep(400, 1000);
                break;
            }
        }
Example #3
0
        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 += "Evacuate Immediately.";
                break;
            }

            MessageBox.Show(message);
        }
 public abstract void FireAlarmHandlerMethod(object fireSubject, FireAlarmEventArgs fe);