public NefariousClass()
 {
     // get a reference to the existing listener
     orig = Calculator.CalculationPerformed;
     // set a new listener for Calculator
     Calculator.CalculationPerformed = HandleNotifyCalculation;
 }
Example #2
0
 public void RemoveListener(NotifyCalculation listener)
 {
     calcListener -= listener;
 }
Example #3
0
 public void AddListener(NotifyCalculation listener)
 {
     calcListener += listener;
 }
Example #4
0
 //constructor argument that takes an instance of the delegate type
 public Calculator(NotifyCalculation listener)
 {
     calcListener = listener;
 }