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

IsNeedXmlSerializationAttributes() private method

private IsNeedXmlSerializationAttributes ( ArrayMapping arrayMapping ) : bool
arrayMapping ArrayMapping
return bool
        private bool IsNeedXmlSerializationAttributes(ArrayMapping arrayMapping)
        {
            if (arrayMapping.Elements.Length != 1)
                return true;

            ElementAccessor item = arrayMapping.Elements[0];
            TypeMapping itemMapping = item.Mapping;

            if (item.Name != itemMapping.DefaultElementName)
                return true;

            if (item.Form != XmlSchemaForm.None && item.Form != XmlSchemaExporter.elementFormDefault)
                return true;

            if (item.Mapping.TypeDesc != null)
            {
                if (item.IsNullable != item.Mapping.TypeDesc.IsNullable)
                    return true;

                if (item.Mapping.TypeDesc.IsAmbiguousDataType)
                    return true;
            }
            return false;
        }