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

◆ CannonicalizeAll()

XmlSchemaParticle System.Xml.Schema.SchemaCollectionCompiler.CannonicalizeAll ( XmlSchemaAll all,
bool root,
bool substitution )
inlineprivate

Definition at line 1074 of file SchemaCollectionCompiler.cs.

1075 {
1076 if (all.Items.Count > 0)
1077 {
1078 XmlSchemaAll xmlSchemaAll = new XmlSchemaAll();
1079 xmlSchemaAll.MinOccurs = all.MinOccurs;
1080 xmlSchemaAll.MaxOccurs = all.MaxOccurs;
1081 xmlSchemaAll.SourceUri = all.SourceUri;
1082 xmlSchemaAll.LineNumber = all.LineNumber;
1083 xmlSchemaAll.LinePosition = all.LinePosition;
1084 for (int i = 0; i < all.Items.Count; i++)
1085 {
1086 XmlSchemaParticle xmlSchemaParticle = CannonicalizeParticle((XmlSchemaElement)all.Items[i], root: false, substitution);
1087 if (xmlSchemaParticle != XmlSchemaParticle.Empty)
1088 {
1090 }
1091 }
1092 all = xmlSchemaAll;
1093 }
1094 if (all.Items.Count == 0)
1095 {
1096 return XmlSchemaParticle.Empty;
1097 }
1098 if (root && all.Items.Count == 1)
1099 {
1100 XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
1101 xmlSchemaSequence.MinOccurs = all.MinOccurs;
1102 xmlSchemaSequence.MaxOccurs = all.MaxOccurs;
1103 xmlSchemaSequence.Items.Add((XmlSchemaParticle)all.Items[0]);
1104 return xmlSchemaSequence;
1105 }
1106 if (!root && all.Items.Count == 1 && all.MinOccurs == 1m && all.MaxOccurs == 1m)
1107 {
1108 return (XmlSchemaParticle)all.Items[0];
1109 }
1110 if (!root)
1111 {
1113 return XmlSchemaParticle.Empty;
1114 }
1115 return all;
1116 }
void Add(TKey key, TValue value)
static string Sch_NotAllAlone
Definition SR.cs:1040
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
XmlSchemaParticle CannonicalizeParticle(XmlSchemaParticle particle, bool root, bool substitution)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.SchemaCollectionCompiler.CannonicalizeParticle(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.Empty, System.SR.Sch_NotAllAlone, and System.Xml.Schema.BaseProcessor.SendValidationEvent().

Referenced by System.Xml.Schema.SchemaCollectionCompiler.CannonicalizeParticle().