Esempio n. 1
0
        private static void Example3()
        {
            MathService2 mathService = new MathService2();

            mathService.MathPerformed += OnOutboundEvent;
            mathService.AddNumbers(3, 4);
            mathService.MultiplyNumbers(3, 4);
        }
Esempio n. 2
0
        private static void Example4()
        {
            MathService2 mathService = new MathService2();

            new List <IMathPerformedService> {
                new LoggingService(), new NotificationService()
            }.ForEach(serv => mathService.MathPerformed += serv.OnMathPerformed);
            mathService.AddNumbers(3, 4);
            mathService.MultiplyNumbers(3, 4);
        }