base on msdn pages, when we declare a delegate we do need to specify return value and also argument of the method that would be called via delegate.
my question:
let’s say I have a method as:
public int MethodA(bool bValue) and also void MethodB(int iValue)
Do I need to declare two different delegates here for each method or I can do it using one?
Thanks.
Since these methods have completely different signatures, you need different delegates. However, you can use the built-in
Func<bool, int>andAction<int>delegates instead of declaring your own delegate types.For example, you could use: