Пример #1
0
        public static DTGTypeMetadata MapToDTGModel(TypeMetadata typeMetadata)
        {
            DTGTypeMetadata dTG2TypeMetadata = new DTGTypeMetadata
            {
                TypeName              = typeMetadata.TypeName,
                DeclaringType         = EmitDeclaringTypeDTG(typeMetadata.DeclaringType),
                Constructors          = MethodMapper.EmitMethodsDTG(typeMetadata.Constructors),
                Methods               = MethodMapper.EmitMethodsDTG(typeMetadata.Methods),
                NestedTypes           = EmitNestedTypesDTG(typeMetadata.NestedTypes),
                ImplementedInterfaces = EmitImplementsDTG(typeMetadata.ImplementedInterfaces),
                GenericArguments      = CheckGenericArgumentsDTG(typeMetadata),
                BaseType              = EmitExtendsDTG(typeMetadata.BaseType),
                Properties            = PropertyMapper.EmitPropertiesDTG(typeMetadata.Properties),
                IsGenericType         = typeMetadata.IsGenericType
            };

            return(dTG2TypeMetadata);
        }
Пример #2
0
        public static DTGTypeMetadata FillTypeDTG(DTGTypeMetadata dtg2TypeMetadata, TypeMetadata typeMetadata)
        {
            dtg2TypeMetadata.TypeName              = typeMetadata.TypeName;
            dtg2TypeMetadata.DeclaringType         = EmitDeclaringTypeDTG(typeMetadata.DeclaringType);
            dtg2TypeMetadata.Constructors          = MethodMapper.EmitMethodsDTG(typeMetadata.Constructors);
            dtg2TypeMetadata.Methods               = MethodMapper.EmitMethodsDTG(typeMetadata.Methods);
            dtg2TypeMetadata.NestedTypes           = EmitNestedTypesDTG(typeMetadata.NestedTypes);
            dtg2TypeMetadata.ImplementedInterfaces = EmitImplementsDTG(typeMetadata.ImplementedInterfaces);
            if (typeMetadata.GenericArguments != null)
            {
                dtg2TypeMetadata.GenericArguments = EmitGenericArgumentsDTG(typeMetadata.GenericArguments);
            }
            else
            {
                dtg2TypeMetadata.GenericArguments = null;
            }
            //dtg2TypeMetadata.Modifiers = EmitModifiers(typeMetadata);
            dtg2TypeMetadata.BaseType   = EmitExtendsDTG(typeMetadata.BaseType);
            dtg2TypeMetadata.Properties = PropertyMapper.EmitPropertiesDTG(typeMetadata.Properties);

            return(dtg2TypeMetadata);
        }