static void Main(string[] args) { MathServices mathserv = new MathServices(); mathserv.MathPerformed += OnMathPerformed; // actual do something mathserv.MultiplyNumbers(1.22, 3.44); }
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; }
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); }
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; }