예제 #1
0
        public static XMLTypeMetadata MapToXML(DTGTypeMetadata typeMetadata)
        {
            XMLTypeMetadata xmlTypeMetadata = new XMLTypeMetadata
            {
                TypeName              = typeMetadata.TypeName,
                DeclaringType         = EmitDeclaringTypeXML(typeMetadata.DeclaringType),
                Constructors          = SerializationMethodMapper.EmitMethodsXML(typeMetadata.Constructors),
                Methods               = SerializationMethodMapper.EmitMethodsXML(typeMetadata.Methods),
                NestedTypes           = EmitNestedTypesXML(typeMetadata.NestedTypes),
                ImplementedInterfaces = EmitImplementsXML(typeMetadata.ImplementedInterfaces),
                GenericArguments      = CheckGenericArgumentsXML(typeMetadata),
                BaseType              = EmitExtendsXML(typeMetadata.BaseType),
                Properties            = SerializationPropertyMapper.EmitPropertiesXML(typeMetadata.Properties),
                IsGenericType         = typeMetadata.IsGenericType
            };

            return(xmlTypeMetadata);
        }
예제 #2
0
        public static XMLTypeMetadata FillTypeXML(XMLTypeMetadata dtg2TypeMetadata, DTGTypeMetadata typeMetadata)
        {
            dtg2TypeMetadata.TypeName              = typeMetadata.TypeName;
            dtg2TypeMetadata.DeclaringType         = EmitDeclaringTypeXML(typeMetadata.DeclaringType);
            dtg2TypeMetadata.Constructors          = SerializationMethodMapper.EmitMethodsXML(typeMetadata.Constructors);
            dtg2TypeMetadata.Methods               = SerializationMethodMapper.EmitMethodsXML(typeMetadata.Methods);
            dtg2TypeMetadata.NestedTypes           = EmitNestedTypesXML(typeMetadata.NestedTypes);
            dtg2TypeMetadata.ImplementedInterfaces = EmitImplementsXML(typeMetadata.ImplementedInterfaces);
            if (typeMetadata.GenericArguments != null)
            {
                dtg2TypeMetadata.GenericArguments = EmitGenericArgumentsXML(typeMetadata.GenericArguments);
            }
            else
            {
                dtg2TypeMetadata.GenericArguments = null;
            }
            //dtg2TypeMetadata.Modifiers = EmitModifiers(typeMetadata);
            dtg2TypeMetadata.BaseType   = EmitExtendsXML(typeMetadata.BaseType);
            dtg2TypeMetadata.Properties = SerializationPropertyMapper.EmitPropertiesXML(typeMetadata.Properties);

            return(dtg2TypeMetadata);
        }