Пример #1
0
        static void Main()
        {
            var source = new Eventful();

            source.Announcement += m => Console.WriteLine("Announcement: " + m);
        }
Пример #2
0
        // 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
        }