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?
LVL 9
william007Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
william007Connect With a Mentor Author Commented:
Hi, I got the answer, actually I can use MyDelegate[] myDelegates as argument, hence call by index just access the array by index.
0
 
Bob LearnedCommented:
Huh?  What are you trying to achieve here?

Bob
0
 
william007Author Commented:
I would request to PAQ this question, since it is self answered :)
0
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0
All Courses

From novice to tech pro — start learning today.