Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ImportAttribute()

AttributeAccessor System.Xml.Serialization.XmlSchemaImporter.ImportAttribute ( XmlSchemaAttribute attribute,
string identifier,
string ns,
XmlSchemaAttribute defaultValueProvider )
inlineprivate

Definition at line 1640 of file XmlSchemaImporter.cs.

1641 {
1642 if (attribute.Use == XmlSchemaUse.Prohibited)
1643 {
1644 return null;
1645 }
1646 if (!attribute.RefName.IsEmpty)
1647 {
1648 if (attribute.RefName.Namespace == "http://www.w3.org/XML/1998/namespace")
1649 {
1651 }
1653 }
1654 if (attribute.Name.Length == 0)
1655 {
1657 }
1658 identifier = ((identifier.Length != 0) ? (identifier + CodeIdentifier.MakePascal(attribute.Name)) : CodeIdentifier.MakeValid(attribute.Name));
1659 TypeMapping typeMapping = ((!attribute.SchemaTypeName.IsEmpty) ? ImportType(attribute.SchemaTypeName, typeof(TypeMapping), null, TypeFlags.CanBeAttributeValue, addref: false) : ((attribute.SchemaType == null) ? GetDefaultMapping(TypeFlags.CanBeAttributeValue) : ImportDataType(attribute.SchemaType, ns, identifier, null, TypeFlags.CanBeAttributeValue, isList: false)));
1660 if (typeMapping != null && !typeMapping.TypeDesc.IsMappedType)
1661 {
1662 RunSchemaExtensions(typeMapping, attribute.SchemaTypeName, attribute.SchemaType, attribute, (TypeFlags)56);
1663 }
1664 AttributeAccessor attributeAccessor = new AttributeAccessor();
1668 attributeAccessor.CheckSpecial();
1672 if (defaultValueProvider.DefaultValue != null)
1673 {
1675 }
1676 else if (defaultValueProvider.FixedValue != null)
1677 {
1680 }
1681 else if (attribute != defaultValueProvider)
1682 {
1683 if (attribute.DefaultValue != null)
1684 {
1685 attributeAccessor.Default = attribute.DefaultValue;
1686 }
1687 else if (attribute.FixedValue != null)
1688 {
1691 }
1692 }
1693 return attributeAccessor;
1694 }
static string XmlAttributeHasNoName
Definition SR.cs:1484
Definition SR.cs:7
TypeMapping ImportType(XmlQualifiedName name, Type desiredMappingType, Type baseType, TypeFlags flags, bool addref)
AttributeAccessor ImportSpecialAttribute(XmlQualifiedName name, string identifier)
void RunSchemaExtensions(TypeMapping mapping, XmlQualifiedName qname, XmlSchemaType type, XmlSchemaObject context, TypeFlags flags)
TypeMapping GetDefaultMapping(TypeFlags flags)
XmlSchemaForm AttributeForm(string ns, XmlSchemaAttribute attribute)
XmlSchemaAttribute FindAttribute(XmlQualifiedName name)
AttributeAccessor ImportAttribute(XmlSchemaAttribute attribute, string identifier, string ns, XmlSchemaAttribute defaultValueProvider)
TypeMapping ImportDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, Type baseType, TypeFlags flags, bool isList)

References System.Xml.Serialization.XmlSchemaImporter.AttributeForm(), System.Xml.Dictionary, System.Xml.Serialization.XmlSchemaImporter.FindAttribute(), System.Xml.Serialization.XmlSchemaImporter.GetDefaultMapping(), System.Xml.Serialization.XmlSchemaImporter.ImportAttribute(), System.Xml.Serialization.XmlSchemaImporter.ImportDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportSpecialAttribute(), System.Xml.Serialization.XmlSchemaImporter.ImportType(), System.Xml.Serialization.CodeIdentifier.MakePascal(), System.Xml.Serialization.CodeIdentifier.MakeValid(), System.Xml.Serialization.XmlSchemaImporter.RunSchemaExtensions(), and System.SR.XmlAttributeHasNoName.

Referenced by System.Xml.Serialization.XmlSchemaImporter.ImportAttribute(), and System.Xml.Serialization.XmlSchemaImporter.ImportAttributeMember().