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

◆ SwitchUseToOptional()

void System.Xml.Schema.XmlSchemaInference.SwitchUseToOptional ( XmlSchemaObjectCollection attributes,
XmlSchemaObjectCollection attributesInInstance )
inlineprivate

Definition at line 1186 of file XmlSchemaInference.cs.

1187 {
1188 for (int i = 0; i < attributes.Count; i++)
1189 {
1190 if (!(attributes[i] is XmlSchemaAttribute xmlSchemaAttribute))
1191 {
1192 continue;
1193 }
1194 if (attributesInInstance != null)
1195 {
1196 if (xmlSchemaAttribute.RefName.Name.Length == 0)
1197 {
1199 {
1200 xmlSchemaAttribute.Use = XmlSchemaUse.Optional;
1201 }
1202 }
1203 else if (FindAttributeRef(attributesInInstance, xmlSchemaAttribute.RefName.Name, xmlSchemaAttribute.RefName.Namespace) == null)
1204 {
1205 xmlSchemaAttribute.Use = XmlSchemaUse.Optional;
1206 }
1207 }
1208 else
1209 {
1210 xmlSchemaAttribute.Use = XmlSchemaUse.Optional;
1211 }
1212 }
1213 }
XmlSchemaAttribute FindAttributeRef(ICollection attributes, string attributeName, string nsURI)
XmlSchemaAttribute FindAttribute(ICollection attributes, string attrName)

References System.Collections.CollectionBase.Count.