This project is read-only.

Strongly-typed version of LaunchAsync

Nov 18, 2012 at 6:57 PM


It's not very important, but I love the strongly-typed version of Launch (I guess I'm a bit old-fashioned). Maybe its big brother LaunchAsync could be strongly-typed as well? And increasing the number of generic type arguments (say 20, or so) of the Action class would be sweet.


Nov 18, 2012 at 7:11 PM

Great minds think alike so they say - LaunchAsync has already been modified and I'll commit the code for this shortly.

Nov 18, 2012 at 7:34 PM

Excelent, thanks!

Btw, I really liked that trick to make it strongly-typed. One doesn't even have to explicitly write the list of types during invokation, since the compiler infers them. Ingineous.


Nov 18, 2012 at 11:24 PM

Good idea. I used a limit of 16 types on Action because that is as high as the pre-defined definitions fromMicrosoft go. One can always extend the list for a given project manually as follows:

public delegate void Action<in T1, in T2, ..., in T16, in T17>

as high as one needs. In practice, I suspect it is both more efficient and more maintainable, in general, to combine formal arguments into a Struct, but sound exceptions to general rules always crop up now and then