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

◆ Intersection()

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

Definition at line 232 of file NamespaceList.cs.

233 {
234 NamespaceList namespaceList = null;
235 if (o1._type == ListType.Any)
236 {
237 namespaceList = o2.Clone();
238 }
239 else if (o2._type == ListType.Any)
240 {
241 namespaceList = o1.Clone();
242 }
243 else if (o1._type == ListType.Set && o2._type == ListType.Other)
244 {
245 namespaceList = o1.Clone();
246 namespaceList.RemoveNamespace(o2._targetNamespace);
247 if (!v1Compat)
248 {
249 namespaceList.RemoveNamespace(string.Empty);
250 }
251 }
252 else if (o1._type == ListType.Other && o2._type == ListType.Set)
253 {
254 namespaceList = o2.Clone();
255 namespaceList.RemoveNamespace(o1._targetNamespace);
256 if (!v1Compat)
257 {
258 namespaceList.RemoveNamespace(string.Empty);
259 }
260 }
261 else if (o1._type == ListType.Set && o2._type == ListType.Set)
262 {
263 namespaceList = o1.Clone();
264 namespaceList = new NamespaceList();
265 namespaceList._type = ListType.Set;
267 foreach (string key in o1._set.Keys)
268 {
269 if (o2._set.Contains(key))
270 {
271 namespaceList._set.Add(key, key);
272 }
273 }
274 }
275 else if (o1._type == ListType.Other && o2._type == ListType.Other)
276 {
277 if (o1._targetNamespace == o2._targetNamespace)
278 {
279 return o1.Clone();
280 }
281 if (!v1Compat)
282 {
283 if (o1._targetNamespace == string.Empty)
284 {
285 namespaceList = o2.Clone();
286 }
287 else if (o2._targetNamespace == string.Empty)
288 {
289 namespaceList = o1.Clone();
290 }
291 }
292 }
293 return namespaceList;
294 }

References System.Xml.Schema.NamespaceList.NamespaceList(), System.Xml.Schema.NamespaceList._set, System.Collections.Hashtable.Add(), System.Xml.Schema.NamespaceList.Clone(), System.Xml.Dictionary, System.key, and System.Xml.Schema.NamespaceList.RemoveNamespace().

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