System.Xml.Serialization.XmlSchemaImporter.ImportType C# (CSharp) Method

ImportType() private method

private ImportType ( XmlSchemaComplexType type, string typeNs, string identifier, Type desiredMappingType, Type baseType, TypeFlags flags ) : TypeMapping
type System.Xml.Schema.XmlSchemaComplexType
typeNs string
identifier string
desiredMappingType Type
baseType Type
flags TypeFlags
return TypeMapping
        private TypeMapping ImportType(XmlSchemaComplexType type, string typeNs, string identifier, Type desiredMappingType, Type baseType, TypeFlags flags)
        {
            if (type.Redefined != null)
            {
                // we do not support redefine in the current version
                throw new NotSupportedException(SR.Format(SR.XmlUnsupportedRedefine, type.Name, typeNs));
            }
            if (desiredMappingType == typeof(TypeMapping))
            {
                TypeMapping mapping = null;

                if (baseType == null)
                {
                    if ((mapping = ImportArrayMapping(type, identifier, typeNs, false)) == null)
                    {
                        mapping = ImportAnyMapping(type, identifier, typeNs, false);
                    }
                }
                if (mapping == null)
                {
                    mapping = ImportStructType(type, typeNs, identifier, baseType, false);

                    if (mapping != null && type.Name != null && type.Name.Length != 0)
                        ImportDerivedTypes(new XmlQualifiedName(identifier, typeNs));
                }
                return mapping;
            }
            else if (desiredMappingType == typeof(MembersMapping))
                return ImportMembersType(type, typeNs, identifier);
            else
                throw new ArgumentException(SR.XmlInternalError, nameof(desiredMappingType));
        }

Same methods

XmlSchemaImporter::ImportType ( XmlQualifiedName name, Type desiredMappingType, Type baseType, TypeFlags flags, bool addref ) : TypeMapping