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

◆ WriteStartAttributeAsync_NoAdvanceState() [1/2]

Task System.Xml.XmlWellFormedWriter.WriteStartAttributeAsync_NoAdvanceState ( string prefix,
string localName,
string namespaceName )
inlineprivate

Definition at line 3433 of file XmlWellFormedWriter.cs.

3434 {
3435 try
3436 {
3437 if (prefix == null)
3438 {
3439 if (namespaceName != null && (!(localName == "xmlns") || !(namespaceName == "http://www.w3.org/2000/xmlns/")))
3440 {
3442 }
3443 if (prefix == null)
3444 {
3445 prefix = string.Empty;
3446 }
3447 }
3448 if (namespaceName == null)
3449 {
3450 if (prefix.Length > 0)
3451 {
3453 }
3454 if (namespaceName == null)
3455 {
3456 namespaceName = string.Empty;
3457 }
3458 }
3459 if (prefix.Length == 0)
3460 {
3461 if (localName[0] != 'x' || !(localName == "xmlns"))
3462 {
3463 if (namespaceName.Length > 0)
3464 {
3466 if (prefix == null || prefix.Length == 0)
3467 {
3469 }
3470 }
3471 goto IL_01bc;
3472 }
3473 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/2000/xmlns/")
3474 {
3476 }
3477 _curDeclPrefix = string.Empty;
3478 SetSpecialAttribute(SpecialAttribute.DefaultXmlns);
3479 }
3480 else
3481 {
3482 if (prefix[0] != 'x')
3483 {
3484 goto IL_0188;
3485 }
3486 if (prefix == "xmlns")
3487 {
3488 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/2000/xmlns/")
3489 {
3491 }
3492 _curDeclPrefix = localName;
3493 SetSpecialAttribute(SpecialAttribute.PrefixedXmlns);
3494 }
3495 else
3496 {
3497 if (!(prefix == "xml"))
3498 {
3499 goto IL_0188;
3500 }
3501 if (namespaceName.Length > 0 && namespaceName != "http://www.w3.org/XML/1998/namespace")
3502 {
3504 }
3505 if (!(localName == "space"))
3506 {
3507 if (!(localName == "lang"))
3508 {
3509 goto IL_0188;
3510 }
3511 SetSpecialAttribute(SpecialAttribute.XmlLang);
3512 }
3513 else
3514 {
3515 SetSpecialAttribute(SpecialAttribute.XmlSpace);
3516 }
3517 }
3518 }
3519 goto IL_01cc;
3520 IL_0188:
3522 if (namespaceName.Length == 0)
3523 {
3524 prefix = string.Empty;
3525 }
3526 else
3527 {
3529 if (text != null && text != namespaceName)
3530 {
3532 }
3533 }
3534 goto IL_01bc;
3535 IL_01bc:
3536 if (prefix.Length != 0)
3537 {
3539 }
3540 goto IL_01cc;
3541 IL_01cc:
3542 AddAttribute(prefix, localName, namespaceName);
3543 if (_specAttr == SpecialAttribute.No)
3544 {
3546 }
3547 return Task.CompletedTask;
3548 }
3549 catch
3550 {
3551 _currentState = State.Error;
3552 throw;
3553 }
3554 }
static string Xml_XmlPrefix
Definition SR.cs:304
static string Xml_XmlnsPrefix
Definition SR.cs:306
Definition SR.cs:7
static Task CompletedTask
Definition Task.cs:1120
void AddAttribute(string prefix, string localName, string namespaceName)
void PushNamespaceImplicit(string prefix, string ns)
string LookupLocalNamespace(string prefix)
void SetSpecialAttribute(SpecialAttribute special)
override string LookupPrefix(string ns)
virtual Task WriteStartAttributeAsync(string? prefix, string localName, string? ns)
Definition XmlWriter.cs:628

References System.Xml.XmlWellFormedWriter._curDeclPrefix, System.Xml.XmlWellFormedWriter._currentState, System.Xml.XmlWellFormedWriter._specAttr, System.Xml.XmlWellFormedWriter._writer, System.Xml.XmlWellFormedWriter.AddAttribute(), System.Xml.ArgumentException, System.Xml.XmlWellFormedWriter.CheckNCName(), System.Threading.Tasks.Task< TResult >.CompletedTask, System.Xml.Dictionary, System.Xml.XmlWellFormedWriter.GeneratePrefix(), System.Xml.XmlWellFormedWriter.LookupLocalNamespace(), System.Xml.XmlWellFormedWriter.LookupNamespace(), System.Xml.XmlWellFormedWriter.LookupPrefix(), System.prefix, System.Xml.XmlWellFormedWriter.PushNamespaceImplicit(), System.Xml.XmlWellFormedWriter.SetSpecialAttribute(), System.text, System.Xml.XmlWellFormedWriter.TryReturnTask(), System.Xml.XmlWriter.WriteStartAttributeAsync(), System.SR.Xml_XmlnsPrefix, and System.SR.Xml_XmlPrefix.

Referenced by System.Xml.XmlWellFormedWriter.WriteStartAttributeAsync(), and System.Xml.XmlWellFormedWriter.WriteStartAttributeAsync_NoAdvanceState().