Link to home
Start Free TrialLog in
Avatar of william007
william007

asked on

Call compositedelegate by position

Consider following code:
delegate int MyDelegate();
MyDelegate d1=new MyDelegate(M1);
MyDelegate d2=new MyDelegate(M2);
MyDelegate d3=new MyDelegate(M3);
MyDelegate compDelegate=d1+d2+d3;

public void delegateCall(MyDelegate myCompDelegate, int Position){
//call the method by position
}

If I call delegate(compDelegate,2), meaning I want the second method to be called, in our case, d2.

How to do this?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Huh?  What are you trying to achieve here?

Bob
ASKER CERTIFIED SOLUTION
Avatar of william007
william007

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of william007
william007

ASKER

I would request to PAQ this question, since it is self answered :)
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator