After searching on Google, this does not look promising, but I wonder if there is a way to smooth or typedef'ing when using Action<T> or Func<in T, out TResult> in C #?
I have already seen the equivalent of typedef in C # , which says that within one compilation area you can use the using construct for some cases, but it doesn, as far as I can tell, it seems to be applicable for Action and Func .
The reason I want to do this is because I want some action to be used as a parameter for several functions, and if at some point I decided to change the action, there are a lot of places to change as as types parameters and how types of variables.
?typedef? MyAction Action<int, int>; public static SomeFunc(WindowClass window, int number, MyAction callbackAction) { ... SomeOtherFunc(callbackAction); ... } // In another file/class/... private MyAction theCallback; public static SomeOtherFunc(MyAction callbackAction) { theCallback = callbackAction; }
Is there any construction that can define MyAction , as indicated in the code segment?
source share