Example #1
0
 public static TypeMetadata fillType(TypeMetadata typeMetadata, Type type)
 {
     typeMetadata.TypeName              = type.Name;
     typeMetadata.DeclaringType         = EmitDeclaringType(type.DeclaringType);
     typeMetadata.Constructors          = MethodMetadata.EmitMethods(type.GetConstructors());
     typeMetadata.Methods               = MethodMetadata.EmitMethods(type.GetMethods());
     typeMetadata.NestedTypes           = EmitNestedTypes(type.GetNestedTypes());
     typeMetadata.ImplementedInterfaces = EmitImplements(type.GetInterfaces());
     typeMetadata.GenericArguments      = !type.IsGenericTypeDefinition ? null : TypeMetadata.EmitGenericArguments(type.GetGenericArguments());
     typeMetadata.Modifiers             = EmitModifiers(type);
     typeMetadata.BaseType              = EmitExtends(type.BaseType);
     typeMetadata.Properties            = PropertyMetadata.EmitProperties(type.GetProperties());
     typeMetadata.IsGenericType         = type.IsGenericType;
     return(typeMetadata);
 }
Example #2
0
 public TypeMetadata(Type type)
 {
     m_typeName              = type.Name;
     m_DeclaringType         = EmitDeclaringType(type.DeclaringType);
     m_Constructors          = MethodMetadata.EmitMethods(type.GetConstructors());
     m_Methods               = MethodMetadata.EmitMethods(type.GetMethods());
     m_NestedTypes           = EmitNestedTypes(type.GetNestedTypes());
     m_ImplementedInterfaces = EmitImplements(type.GetInterfaces());
     m_GenericArguments      = !type.IsGenericTypeDefinition ? null : TypeMetadata.EmitGenericArguments(type.GetGenericArguments());
     m_Modifiers             = EmitModifiers(type);
     m_BaseType              = EmitExtends(type.BaseType);
     m_Properties            = PropertyMetadata.EmitProperties(type.GetProperties());
     m_TypeKind              = GetTypeKind(type);
     m_isGenericType         = type.IsGenericType;
 }