Beispiel #1
0
 public static IEnumerable <PropertyMetadata> EmitProperties(IEnumerable <PropertyInfo> props)
 {
     return(from prop
            in props
            //where prop.GetGetMethod().GetVisible() || prop.GetSetMethod().GetVisible()
            select new PropertyMetadata(prop.Name, TypeMetadata.EmitReference(prop.PropertyType),
                                        TypeMetadata.EmitAttributes(prop.GetCustomAttributes())));
 }
Beispiel #2
0
        public FieldMetadata(FieldInfo field)
            : base(field.Name)
        {
            Type = TypeMetadata.EmitReference(field.FieldType);
            AttributesMetadata = TypeMetadata.EmitAttributes(field.GetCustomAttributes());

            EmitModifiers(field);
        }
Beispiel #3
0
 public ParameterMetadata(ParameterInfo parameter)
     : base(parameter.Name)
 {
     Type = TypeMetadata.EmitReference(parameter.ParameterType);
     if (!parameter.GetCustomAttributes().IsNullOrEmpty())
     {
         Attributes = TypeMetadata.EmitAttributes(parameter.GetCustomAttributes());
     }
 }
Beispiel #4
0
        public MethodMetadata(MethodBase method)
            : base(method.IsConstructor ? method.ReflectedType.Name : method.Name)
        {
            GenericArguments   = !method.IsGenericMethodDefinition ? null : TypeMetadata.EmitGenericArguments(method.GetGenericArguments()).ToList();
            Parameters         = EmitParameters(method.GetParameters()).ToList();
            AttributesMetadata = TypeMetadata.EmitAttributes(method.GetCustomAttributes());

            ReturnType    = EmitReturnType(method);
            ReflectedType = TypeMetadata.EmitReference(method.ReflectedType);

            EmitModifiers(method);
            Extension = EmitExtension(method);
        }