T
Tony Johansson
Hello!
My first question is:
If I add n methods to a delegete will these be called in the same order that
they were added?
Assume I have this delegate declaration.
public delegete void stopMachineryDelegete();
Here I can create an instance of the delegete like this without using new.
private stopMachineryDelegete stopMachinery;
I can add a mehod to the delegete variable like this
stopMachinery += StopFolding;
I can as an alternative do this.
stopMachinery += StopFolding;
do this instead and add the method to the delegete at the same time
stopMachinery = new stopMachineryDelegete(StopFolding);
But it's not possible to do this.
private stopMachineryDelegete stopMachinery = new stopMachineryDelegete();
stopMachinery += StopFolding;
Why is it not possible to create an instance using default constructor.
//Tony
My first question is:
If I add n methods to a delegete will these be called in the same order that
they were added?
Assume I have this delegate declaration.
public delegete void stopMachineryDelegete();
Here I can create an instance of the delegete like this without using new.
private stopMachineryDelegete stopMachinery;
I can add a mehod to the delegete variable like this
stopMachinery += StopFolding;
I can as an alternative do this.
stopMachinery += StopFolding;
do this instead and add the method to the delegete at the same time
stopMachinery = new stopMachineryDelegete(StopFolding);
But it's not possible to do this.
private stopMachineryDelegete stopMachinery = new stopMachineryDelegete();
stopMachinery += StopFolding;
Why is it not possible to create an instance using default constructor.
//Tony