System.Xml.Serialization.XmlSerializer.GetKnownMapping C# (CSharp) Method

GetKnownMapping() private static method

private static GetKnownMapping ( Type type, string ns ) : XmlTypeMapping
type System.Type
ns string
return XmlTypeMapping
        private static XmlTypeMapping GetKnownMapping(Type type, string ns)
        {
            if (ns != null && ns != string.Empty)
                return null;
            TypeDesc typeDesc = (TypeDesc)TypeScope.PrimtiveTypes[type];
            if (typeDesc == null)
                return null;
            ElementAccessor element = new ElementAccessor();
            element.Name = typeDesc.DataType.Name;
            XmlTypeMapping mapping = new XmlTypeMapping(null, element);
            mapping.SetKeyInternal(XmlMapping.GenerateKey(type, null, null));
            return mapping;
        }