A delegate for a function with variable parameters
问题 I have a function of this sort void func(params object[] parameters) { //Function Body } It can accept parameters of the following sort func(10, "hello", 30.0); func(10,20); and so on. I wanted to create an Action delegate for the above function. Is it possible? If not then why? 回答1: You can't use the existing Action delegates with params , but you can declare your own delegate that way: public delegate void ParamsAction(params object[] arguments) Then: // Note that this doesn't have to have