Exemplo n.º 1
0
        public FieldMetadata(FieldInfo field)
            : base(field.Name)
        {
            Type = TypeMetadata.EmitReference(field.FieldType);
            AttributesMetadata = TypeMetadata.EmitAttributes(field.GetCustomAttributes());

            EmitModifiers(field);
        }
Exemplo n.º 2
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())));
 }
Exemplo n.º 3
0
 public ParameterMetadata(ParameterInfo parameter)
     : base(parameter.Name)
 {
     Type = TypeMetadata.EmitReference(parameter.ParameterType);
     if (!parameter.GetCustomAttributes().IsNullOrEmpty())
     {
         Attributes = TypeMetadata.EmitAttributes(parameter.GetCustomAttributes());
     }
 }
Exemplo n.º 4
0
        private static TypeMetadata EmitReturnType(MethodBase method)
        {
            MethodInfo methodInfo = method as MethodInfo;

            if (methodInfo == null)
            {
                return(null);
            }
            return(TypeMetadata.EmitReference(methodInfo.ReturnType));
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 //methods
 private static IEnumerable <ParameterMetadata> EmitParameters(IEnumerable <ParameterInfo> parms)
 {
     return(from parm in parms
            select new ParameterMetadata(parm.Name, TypeMetadata.EmitReference(parm.ParameterType)));
 }
Exemplo n.º 7
0
 internal 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)));
 }