using System.Collections;
public static void Main()
Police police = new Police();
Ambulance ambulance = new Ambulance();
Call911 c911 = new Call911();
c911.CallForHelp += police.OnCallTo911;
c911.CallForHelp += fire.OnCallTo911;
c911.CallForHelp += ambulance.OnCallTo911;
c911.createNotification("250 Humber Blvd. - John Hinz - HELP - Crazy Students!!!!! ");
public void OnCallTo911(object sender, EmergencyInfo e)
Console.WriteLine("There is a Police call from " + e.address);
public void OnCallTo911(object sender, EmergencyInfo e)
Console.WriteLine("There is a Fire call from " + e.address);
public void OnCallTo911(object sender, EmergencyInfo e)
Console.WriteLine("There is a Ambulance call from " + e.address);
public event EmergencyEvent CallForHelp;
public void createNotification(string msg)
CallForHelp(this, new EmergencyInfo(msg));
public delegate void EmergencyEvent(object sender, EmergencyInfo e);
public class EmergencyInfo : EventArgs
public string address { get; set; }
public EmergencyInfo(string Address)