Пример #1
0
        private static TypeMetadata EmitReturnType(MethodBase method)
        {
            MethodInfo methodInfo = method as MethodInfo;

            if (methodInfo == null)
            {
                return(null);
            }
            return(TypeMetadata.EmitReference(methodInfo.ReturnType));
        }
Пример #2
0
        public static List <PropertyMetadata> EmitProperties(Type type)
        {
            //use binding flags to get not only public stuff
            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());
        }
Пример #3
0
 private static List <ParameterMetadata> EmitParameters(MethodBase method)
 {
     return(method.GetParameters().Select(t => new ParameterMetadata(t.Name, TypeMetadata.EmitReference(t.ParameterType))).ToList());
 }