Je travaille avec System.Func mais j'y suis arrivé avec une pierre d'achoppement.Func pour 5 arguments
System.Func<TReturn> // (no arg, with return value)
System.Func<T, TReturn> // (1 arg, with return value)
System.Func<T1, T2, TReturn> // (2 arg, with return value)
System.Func<T1, T2, T3, TReturn> // (3 arg, with return value)
System.Func<T1, T2, T3, T4, TReturn> // (4 arg, with return value)
Le maximum qu'il accepte est de 4 arguments.
Existe-t-il un moyen d'étendre ceci à 5 arguments?
Merci pour votre aide Brian. Je suis coincé dans .net 3.5 et ne peux pas améliorer. Pourriez-vous m'aider à définir moi-même un délégué, car je ne suis pas trop familier avec cela? Votre aide serait appréciée. – amateur
La syntaxe est dans les documents: http://msdn.microsoft.com/en-us/library/bb534303(v=VS.90).aspx – Brian
@Niall: La syntaxe dont vous avez besoin serait 'public delegate TResult Func < T1, T2, T3, T4, T5, TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); etc. – LukeH