// Speed up (this will generate the events).
Console.ReadLine();
}
// Delegate targets.
public static void CarAboutToBlow(string msg)
{ Console.WriteLine(msg); }
public static void CarExploded(string msg)
{ Console.WriteLine(msg); }
}
Here again is the Main() method now making use of anonymous methods:
static void Main(string[] args)
{
Console.WriteLine("***** More Fun with Lambdas *****\n");
// Make a car as usual.
Car c1 = new Car("SlugBug", 100, 10);
Do'stlaringiz bilan baham: