コード例 #1
0
        static void Main(string[] args)
        {
            MathServices mathserv = new MathServices();

            mathserv.MathPerformed += OnMathPerformed;

            // actual do something
            mathserv.MultiplyNumbers(1.22, 3.44);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            MathServices mathserv = new MathServices();

            mathserv.MathPerformed += (result) =>
                                      Console.WriteLine("Calc result: " + result);

            // actual do something
            mathserv.CalculateNumbers(1.22, 3.44, (value1, value2) => value1 * value2);
            int i = 0;
        }
コード例 #3
0
        static void Main(string[] args)
        {
            MathServices mathserv = new MathServices();

            mathserv.MathPerformed += delegate(object sender, MathPerformanceEventArgs e) {
                Console.WriteLine("Calc result: " + e.Result);
            };

            // actual do something
            mathserv.MultiplyNumbers(1.22, 3.44);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            MathServices mathserv = new MathServices();

            mathserv.MathPerformed += (sender, e) => {
                Console.WriteLine("Calc result: " + e.Result);
            };

            // actual do something
            mathserv.MultiplyNumbers(1.22, 3.44);
            int i = 0;
        }