Delegate Array in C#

前端 未结 5 1055
一整个雨季
一整个雨季 2021-02-14 18:10

I am experimenting with calling delegate functions from a delegate array. I\'ve been able to create the array of delegates, but how do I call the delegate?

publ         


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-14 18:26

    If they're all the same type, why not just combine them into a single multicast delegate?

    static pd delegateInstance = new pd(MyClass.p1) + new pd(MyClass.p2) ...;
    
    ...
    pd();
    

提交回复
热议问题