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

◆ AddNamespace() [1/2]

void System.Xml.XmlBaseWriter.NamespaceManager.AddNamespace ( string prefix,
string uri,
XmlDictionaryString uriDictionaryString )
inline

Definition at line 410 of file XmlBaseWriter.cs.

411 {
412 if (prefix.Length >= 3 && (prefix[0] & -33) == 88 && (prefix[1] & -33) == 77 && (prefix[2] & -33) == 76)
413 {
414 if ((!(prefix == "xml") || !(uri == "http://www.w3.org/XML/1998/namespace")) && (!(prefix == "xmlns") || !(uri == "http://www.w3.org/2000/xmlns/")))
415 {
417 }
418 return;
419 }
420 Namespace @namespace;
421 for (int num = _nsCount - 1; num >= 0; num--)
422 {
423 @namespace = _namespaces[num];
424 if (@namespace.Depth != _depth)
425 {
426 break;
427 }
428 if (@namespace.Prefix == prefix)
429 {
430 if (@namespace.Uri == uri)
431 {
432 return;
433 }
435 }
436 }
437 if (prefix.Length != 0 && uri.Length == 0)
438 {
440 }
441 if (uri.Length == "http://www.w3.org/2000/xmlns/".Length && uri == "http://www.w3.org/2000/xmlns/")
442 {
444 }
445 if (uri.Length == "http://www.w3.org/XML/1998/namespace".Length && uri[18] == 'X' && uri == "http://www.w3.org/XML/1998/namespace")
446 {
448 }
449 if (_namespaces.Length == _nsCount)
450 {
451 Namespace[] array = new Namespace[_nsCount * 2];
454 }
455 @namespace = _namespaces[_nsCount];
456 if (@namespace == null)
457 {
458 @namespace = new Namespace();
459 _namespaces[_nsCount] = @namespace;
460 }
463 @namespace.Uri = uri;
465 _nsCount++;
466 _lastNameSpace = null;
467 }
static string XmlSpecificBindingNamespace
Definition SR.cs:494
static string XmlEmptyNamespaceRequiresNullPrefix
Definition SR.cs:378
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlReservedPrefix
Definition SR.cs:490
static string XmlPrefixBoundToNamespace
Definition SR.cs:486
Definition SR.cs:7

References System.Xml.XmlBaseWriter.NamespaceManager._depth, System.Xml.XmlBaseWriter.NamespaceManager._lastNameSpace, System.Xml.XmlBaseWriter.NamespaceManager._namespaces, System.Xml.XmlBaseWriter.NamespaceManager._nsCount, System.Xml.ArgumentException, System.array, System.Array.Copy(), System.Xml.Dictionary, System.SR.Format(), System.prefix, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.SR.XmlEmptyNamespaceRequiresNullPrefix, System.SR.XmlPrefixBoundToNamespace, System.SR.XmlReservedPrefix, and System.SR.XmlSpecificBindingNamespace.