C# delegate for two methods with different parameters

后端 未结 3 1539
情话喂你
情话喂你 2020-12-14 19:02

I am using the following methods:

public void M1(Int32 a)
{
  // acquire MyMutex
  DoSomething(a);
  // release MyMutex
}

and



        
3条回答
  •  一整个雨季
    2020-12-14 19:49

    If you look at the Func and Action delegates in the framework, you'll see that they define a number of similar delegates with different number of parameters. You can use generics, but that doesn't solve the number of arguments issue you're talking about.

提交回复
热议问题