public static PropertyName FromPropertyInfo(System.Reflection.PropertyInfo property) { if (property == null) { throw new ArgumentNullException("property"); } var declaringType = TypeName.FromType(property.DeclaringType); var propertyType = TypeName.FromType(property.PropertyType); var parms = ParameterData.ConvertAll(property.GetIndexParameters()); return(new PropertyName(declaringType, property.Name, propertyType, parms)); }
public static MethodName FromConstructorInfo(System.Reflection.ConstructorInfo constructor) { if (constructor == null) { throw new ArgumentNullException("constructor"); } return(new DefaultMethodName( TypeName.FromType(constructor.DeclaringType), constructor.Name, DefaultMethodName.SetGenericMangle(0), DefaultMethodName.SetParameters( ParameterData.ConvertAll(constructor.GetParameters()) ) )); }
internal static Arg SetParameters(ParameterInfo[] parameters) { return(result => result.FinalizeParameters(ParameterData.ConvertAll(parameters))); }