static void Main() { var source = new Eventful(); source.Announcement += m => Console.WriteLine("Announcement: " + m); }
// This example shows how not to do something. To see the compiler error, change // the #if false to #if true #if false public static void HowNotToRaiseAnEvent() { var source = new Eventful(); source.Announcement("Will this work?"); // No, this will not even compile }