Example #1
0
        private void EventUsingEventKeyword()
        {
            StaticValues.WriteMethodName(MethodBase.GetCurrentMethod());
            Pup p = new Pup();

            p.OnChange2 += () => { Console.WriteLine($"Raising event using event keyword 1"); };
            p.OnChange2 += () => { Console.WriteLine($"Raising event using event keyword 1"); };
            p.Raise2();
        }
Example #2
0
        private void CreateAndRaise()
        {
            StaticValues.WriteMethodName(MethodBase.GetCurrentMethod());
            Pup p = new Pup();

            p.OnChange += () => Console.WriteLine("Event raised to method 1");
            p.OnChange += () => Console.WriteLine("Event raised to method 2");
            p.Raise();
        }