2008-10-15 12 views

Respuesta

17

Haga la prueba para ver si el ParameterInfo final tiene aplicado.

22

Compruebe si ParamArrayAttribute se ha aplicado al objeto ParameterInfo:

//use string.Format(str, args) as a test 
var method = typeof(string).GetMethod("Format", new[] {typeof(string), typeof(object[])}); 
var param = method.GetParameters()[1]; 
Console.WriteLine(Attribute.IsDefined(param, typeof(ParamArrayAttribute))); 
+0

ya se ha dicho, y el uso Attribute.IsDefined lugar. – leppie

Cuestiones relacionadas