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

◆ Union()

static NamespaceList System.Xml.Schema.NamespaceList.Union ( NamespaceList o1,
NamespaceList o2,
bool v1Compat )
inlinestatic

Definition at line 180 of file NamespaceList.cs.

181 {
182 NamespaceList namespaceList = null;
183 if (o1._type == ListType.Any)
184 {
185 namespaceList = new NamespaceList();
186 }
187 else if (o2._type == ListType.Any)
188 {
189 namespaceList = new NamespaceList();
190 }
191 else if (o1._type == ListType.Set && o2._type == ListType.Set)
192 {
193 namespaceList = o1.Clone();
194 foreach (string key in o2._set.Keys)
195 {
196 namespaceList._set[key] = key;
197 }
198 }
199 else if (o1._type == ListType.Other && o2._type == ListType.Other)
200 {
201 namespaceList = ((!(o1._targetNamespace == o2._targetNamespace)) ? new NamespaceList("##other", string.Empty) : o1.Clone());
202 }
203 else if (o1._type == ListType.Set && o2._type == ListType.Other)
204 {
205 namespaceList = (v1Compat ? ((!o1._set.Contains(o2._targetNamespace)) ? o2.Clone() : new NamespaceList()) : ((o2._targetNamespace != string.Empty) ? o1.CompareSetToOther(o2) : ((!o1._set.Contains(string.Empty)) ? new NamespaceList("##other", string.Empty) : new NamespaceList())));
206 }
207 else if (o2._type == ListType.Set && o1._type == ListType.Other)
208 {
209 namespaceList = (v1Compat ? ((!o2._set.Contains(o2._targetNamespace)) ? o1.Clone() : new NamespaceList()) : ((o1._targetNamespace != string.Empty) ? o2.CompareSetToOther(o1) : ((!o2._set.Contains(string.Empty)) ? new NamespaceList("##other", string.Empty) : new NamespaceList())));
210 }
211 return namespaceList;
212 }
NamespaceList CompareSetToOther(NamespaceList other)

References System.Xml.Schema.NamespaceList.NamespaceList(), System.Xml.Schema.NamespaceList._set, System.Xml.Schema.NamespaceList.Clone(), System.Xml.Dictionary, and System.key.

Referenced by System.Xml.Schema.XmlSchemaAnyAttribute.Union().