public static List <PropertyModel> 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 PropertyModel(t.Name, TypeModel.GetOrAdd(t.PropertyType))).ToList()); }
private static TypeModel EmitReturnType(MethodBase method) { MethodInfo methodInfo = method as MethodInfo; if (methodInfo == null) { return(null); } TypeModel.StoreType(methodInfo.ReturnType); return(TypeModel.GetOrAdd(methodInfo.ReturnType)); }
public MethodModel(BaseCore.Model.MethodBase baseMethod) { this.Name = baseMethod.Name; this.IsAbstract = baseMethod.IsAbstract.ToLogicEnum(); this.Accessibility = baseMethod.Accessibility.ToLogicEnum(); this.Extension = baseMethod.Extension; this.ReturnType = TypeModel.GetOrAdd(baseMethod.ReturnType); this.IsStatic = baseMethod.IsStatic.ToLogicEnum(); this.IsVirtual = baseMethod.VirtualEnum.ToLogicEnum(); GenericArguments = baseMethod.GenericArguments?.Select(TypeModel.GetOrAdd).ToList(); Parameters = baseMethod.Parameters?.Select(t => new ParameterModel(t)).ToList(); }
private static List <ParameterModel> EmitParameters(MethodBase method) { return(method.GetParameters().Select(t => new ParameterModel(t.Name, TypeModel.GetOrAdd(t.ParameterType))).ToList()); }
private List <TypeModel> EmitGenericArguments(MethodBase method) { return(method.GetGenericArguments().Select(t => TypeModel.GetOrAdd(t)).ToList()); }
public NamespaceModel(NamespaceBase namespaceBase) { this.Name = namespaceBase.Name; this.Types = namespaceBase.Types?.Select(t => TypeModel.GetOrAdd(t)).ToList(); }
public NamespaceModel(string name, List <Type> types) { Name = name; Types = types.OrderBy(t => t.Name).Select(t => TypeModel.GetOrAdd(t)).ToList(); }
public FieldModel(FieldBase baseProperty) { Name = baseProperty.Name; Type = TypeModel.GetOrAdd(baseProperty.Type); }
public PropertyModel(PropertyBase baseProperty) { Name = baseProperty.Name; Type = TypeModel.GetOrAdd(baseProperty.Type); }
public ParameterModel(ParameterBase baseElement) { Name = baseElement.Name; Type = TypeModel.GetOrAdd(baseElement.Type); }