System.Xml.Serialization.XmlReflectionImporter.GetTypeMapping C# (CSharp) Method

GetTypeMapping() private method

private GetTypeMapping ( string typeName, string ns, TypeDesc typeDesc, NameTable typeLib, Type type ) : TypeMapping
typeName string
ns string
typeDesc TypeDesc
typeLib NameTable
type System.Type
return TypeMapping
        private TypeMapping GetTypeMapping(string typeName, string ns, TypeDesc typeDesc, NameTable typeLib, Type type)
        {
            TypeMapping mapping;
            if (typeName == null || typeName.Length == 0)
                mapping = type == null ? null : (TypeMapping)_anonymous[type];
            else
                mapping = (TypeMapping)typeLib[typeName, ns];

            if (mapping == null) return null;
            if (!mapping.IsAnonymousType && mapping.TypeDesc != typeDesc)
                throw new InvalidOperationException(SR.Format(SR.XmlTypesDuplicate, typeDesc.FullName, mapping.TypeDesc.FullName, typeName, ns));
            return mapping;
        }