예제 #1
0
        private static DTGTypeMetadata EmitReturnTypeDTG(XMLMethodMetadata method)
        {
            XMLMethodMetadata methodInfo = method as XMLMethodMetadata;

            if (methodInfo == null)
            {
                return(null);
            }
            return(SerializationTypeMapper.EmitReferenceDTG(methodInfo.ReturnType));
        }
예제 #2
0
        private static XMLTypeMetadata EmitReturnTypeXML(DTGMethodMetadata method)
        {
            DTGMethodMetadata methodInfo = method as DTGMethodMetadata;

            if (methodInfo == null)
            {
                return(null);
            }
            return(SerializationTypeMapper.EmitReferenceXML(methodInfo.ReturnType));
        }
예제 #3
0
        public static XMLPropertyMetadata MapToXML(DTGPropertyMetadata propertyMetadata)
        {
            XMLPropertyMetadata propertyModel = new XMLPropertyMetadata
            {
                Name         = propertyMetadata.Name,
                TypeMetadata = SerializationTypeMapper.EmitReferenceXML(propertyMetadata.TypeMetadata)
            };

            return(propertyModel);
        }
        public static XMLParameterMetadata MapToXML(DTGParameterMetadata parameterMetadata)
        {
            XMLParameterMetadata parameterModel = new XMLParameterMetadata
            {
                Name         = parameterMetadata.Name,
                TypeMetadata = SerializationTypeMapper.EmitReferenceXML(parameterMetadata.TypeMetadata),
            };

            return(parameterModel);
        }
예제 #5
0
        public static XMLMethodMetadata MapToXML(DTGMethodMetadata methodMetadata)
        {
            XMLMethodMetadata methodModel = new XMLMethodMetadata
            {
                Name             = methodMetadata.Name,
                GenericArguments = SerializationTypeMapper.EmitGenericArgumentsXML(methodMetadata.GenericArguments),
                ReturnType       = EmitReturnTypeXML(methodMetadata),
                Parameters       = EmitParametersXML(methodMetadata.Parameters),
            };

            return(methodModel);
        }
예제 #6
0
        public static DTGMethodMetadata MapToDTG(XMLMethodMetadata methodMetadata)
        {
            DTGMethodMetadata methodModel = new DTGMethodMetadata
            {
                Name             = methodMetadata.Name,
                GenericArguments = SerializationTypeMapper.EmitGenericArgumentsDTG(methodMetadata.GenericArgumentsL),
                ReturnType       = EmitReturnTypeDTG(methodMetadata),
                Parameters       = EmitParametersDTG(methodMetadata.ParametersL),
            };

            return(methodModel);
        }
        public static XMLNamespaceMetadata MapToXML(DTGNamespaceMetadata namespaceMetadata)
        {
            var m_NamespaceName = namespaceMetadata.NamespaceName;

            //May be even more beneficial to create all types from all namespaces beforehand
            foreach (var type in namespaceMetadata.Types)
            {
                HelperDictonaries.TypeDictonaryToXML[type] = SerializationTypeMapper.MapToXML(type);
            }
            var m_Types = from type in namespaceMetadata.Types orderby type.TypeName select SerializationTypeMapper.FillTypeXML(HelperDictonaries.TypeDictonaryToXML[type], type);

            XMLNamespaceMetadata namespaceModel = new XMLNamespaceMetadata
            {
                NamespaceName = m_NamespaceName,
                Types         = m_Types
            };

            return(namespaceModel);
        }