static void Main(string[] args) { CalculateWithEvent myCalculate = new CalculateWithEvent(); EventListener myListener = new EventListener(myCalculate); myCalculate.Add(2, 3); myCalculate.Sub(3, 2); Console.Read(); }
public EventListener(CalculateWithEvent calculateCase) { CalculateCase = calculateCase; CalculateCase.Calculate += new CalculateEventHandler(CalculateCase_Calculate); }