예제 #1
0
        public static DTGTypeMetadata MapToDTG(XMLTypeMetadata typeMetadata)
        {
            DTGTypeMetadata xmlTypeMetadata = new DTGTypeMetadata
            {
                TypeName              = typeMetadata.TypeName,
                DeclaringType         = EmitDeclaringTypeDTG(typeMetadata.DeclaringType),
                Constructors          = SerializationMethodMapper.EmitMethodsDTG(typeMetadata.ConstructorsL),
                Methods               = SerializationMethodMapper.EmitMethodsDTG(typeMetadata.MethodsL),
                NestedTypes           = EmitNestedTypesDTG(typeMetadata.NestedTypesL),
                ImplementedInterfaces = EmitImplementsDTG(typeMetadata.ImplementedInterfacesL),
                GenericArguments      = CheckGenericArgumentsDTG(typeMetadata),
                BaseType              = EmitExtendsDTG(typeMetadata.BaseType),
                Properties            = SerializationPropertyMapper.EmitPropertiesDTG(typeMetadata.PropertiesL),
                IsGenericType         = typeMetadata.IsGenericType
            };

            return(xmlTypeMetadata);
        }
예제 #2
0
        public static DTGTypeMetadata fillType(DTGTypeMetadata dtg2TypeMetadata, XMLTypeMetadata typeMetadata)
        {
            dtg2TypeMetadata.TypeName              = typeMetadata.TypeName;
            dtg2TypeMetadata.DeclaringType         = EmitDeclaringTypeDTG(typeMetadata.DeclaringType);
            dtg2TypeMetadata.Constructors          = SerializationMethodMapper.EmitMethodsDTG(typeMetadata.ConstructorsL);
            dtg2TypeMetadata.Methods               = SerializationMethodMapper.EmitMethodsDTG(typeMetadata.MethodsL);
            dtg2TypeMetadata.NestedTypes           = EmitNestedTypesDTG(typeMetadata.NestedTypesL);
            dtg2TypeMetadata.ImplementedInterfaces = EmitImplementsDTG(typeMetadata.ImplementedInterfacesL);
            if (typeMetadata.GenericArguments != null)
            {
                dtg2TypeMetadata.GenericArguments = EmitGenericArgumentsDTG(typeMetadata.GenericArguments);
            }
            else
            {
                dtg2TypeMetadata.GenericArguments = null;
            }
            //dtg2TypeMetadata.Modifiers = EmitModifiers(typeMetadata);
            dtg2TypeMetadata.BaseType   = EmitExtendsDTG(typeMetadata.BaseType);
            dtg2TypeMetadata.Properties = SerializationPropertyMapper.EmitPropertiesDTG(typeMetadata.PropertiesL);

            return(dtg2TypeMetadata);
        }