public static void CarAboutToBlow(object sender, CarEventArgs e) { // Just to be safe, perform a // runtime check before casting. if (sender is Car) { Car c = (Car)sender; Console.WriteLine("Critical Message from {0}: {1}", c.PetName, e.msg); } }
public static void CarExoloded(Object sendere, CarEventArgs args) { Console.WriteLine(args.msg); }
public static void CarIsAlmostDoomed(Object sender, CarEventArgs args) { Console.WriteLine("=> Critical: {0}", args.msg); }
public static void CarAboutToBlow(Object sender, CarEventArgs args) { Console.WriteLine(args.msg); }
public static void CarExploded(object sender, CarEventArgs e) { Console.WriteLine(e.msg); }
public static void CarExploded(object sender, CarEventArgs e) { Console.WriteLine(e.msg); }
private static void CarAboutToBlow(object sender, CarEventArgs e) { Console.WriteLine("{0} says {1}", sender, e.msg); }
static void CarExploded(object sender, CarEventArgs e) { Console.WriteLine("{0} says: {1}", sender, e.msg); }
private static void CarAboutToBlow(object sender, CarEventArgs e) { Car c = (Car)sender; Console.WriteLine("=> Critical Message from {0}: {1}", c.PetName, e.msg); }
static void CarIsAlmostDoomed(object sender, CarEventArgs e) { Console.WriteLine("{0} says: {1}", sender, e.msg); }