Пример #1
0
        public static List <PropertyMetadata> EmitProperties(Type type)
        {
            List <PropertyInfo> props = type
                                        .GetProperties(BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.Public |
                                                       BindingFlags.Static | BindingFlags.Instance).ToList();//

            return(props.Where(t => t.GetGetMethod().GetVisible() || t.GetSetMethod().GetVisible())
                   .Select(t => new PropertyMetadata(t.Name, TypeMetadata.EmitReference(t.PropertyType))).ToList());
        }
Пример #2
0
        private static TypeMetadata EmitReturnType(MethodBase method)
        {
            MethodInfo methodInfo = method as MethodInfo;

            if (methodInfo == null)
            {
                return(null);
            }
            TypeMetadata.StoreType(methodInfo.ReturnType);
            return(TypeMetadata.EmitReference(methodInfo.ReturnType));
        }
Пример #3
0
 private static List <ParameterMetadata> EmitParameters(MethodBase method)
 {
     return(method.GetParameters().Select(t => new ParameterMetadata(t.Name, TypeMetadata.EmitReference(t.ParameterType))).ToList());
 }