J
Joanne
A delegate is said to be good for the programmer since it
provides a good way of invoking methods which are not
exactly known until run time.
What does "good" mean here?
If i declare myDelegate and associate some method with
it, am I not knowing which method will be executed?
Is the following code correct? I have the idea that the
delegate is not being properly associated with the event,
although the targeted method is invoked just fine.
//class members
delegate void handlerDelegate();
event handlerDelegate ON_a;
//note: outputText matches the delegate signature
this.ON_a += new MyClass.handlerDelegate
this.outputText);
//call the event
ON_a();
provides a good way of invoking methods which are not
exactly known until run time.
What does "good" mean here?
If i declare myDelegate and associate some method with
it, am I not knowing which method will be executed?
Is the following code correct? I have the idea that the
delegate is not being properly associated with the event,
although the targeted method is invoked just fine.
//class members
delegate void handlerDelegate();
event handlerDelegate ON_a;
//note: outputText matches the delegate signature
this.ON_a += new MyClass.handlerDelegate
this.outputText);
//call the event
ON_a();