Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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())
                           )
                       ));
        }
Esempio n. 3
0
 internal static Arg SetParameters(ParameterInfo[] parameters)
 {
     return(result => result.FinalizeParameters(ParameterData.ConvertAll(parameters)));
 }