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

◆ ReadElementContentAsBase64Async()

override async Task< int > System.Xml.XmlSubtreeReader.ReadElementContentAsBase64Async ( byte[] buffer,
int index,
int count )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1615 of file XmlSubtreeReader.cs.

1616 {
1617 switch (_state)
1618 {
1619 case State.Initial:
1620 case State.Error:
1621 case State.EndOfFile:
1622 case State.Closed:
1623 return 0;
1624 case State.Interactive:
1625 case State.PopNamespaceScope:
1626 case State.ClearNsAttributes:
1627 if (!(await InitReadElementContentAsBinaryAsync(State.ReadElementContentAsBase64).ConfigureAwait(continueOnCapturedContext: false)))
1628 {
1629 return 0;
1630 }
1631 goto case State.ReadElementContentAsBase64;
1632 case State.ReadElementContentAsBase64:
1633 {
1635 if (num > 0 || count == 0)
1636 {
1637 return num;
1638 }
1639 if (NodeType != XmlNodeType.EndElement)
1640 {
1641 throw new XmlException(System.SR.Xml_InvalidNodeType, reader.NodeType.ToString(), reader as IXmlLineInfo);
1642 }
1643 _state = State.Interactive;
1645 if (reader.Depth != _initialDepth)
1646 {
1648 }
1649 else
1650 {
1651 _state = State.EndOfFile;
1652 SetEmptyNode();
1653 }
1654 return 0;
1655 }
1656 case State.ReadElementContentAsBinHex:
1657 case State.ReadContentAsBase64:
1658 case State.ReadContentAsBinHex:
1660 default:
1661 return 0;
1662 }
1663 }
static string Xml_InvalidNodeType
Definition SR.cs:88
static string Xml_MixingBinaryContentMethods
Definition SR.cs:184
Definition SR.cs:7
virtual Task< int > ReadContentAsBase64Async(byte[] buffer, int index, int count)
XmlNodeType NodeType
Definition XmlReader.cs:62
override async Task< bool > ReadAsync()
async Task< bool > InitReadElementContentAsBinaryAsync(State binaryState)
override XmlNodeType NodeType

References System.Xml.XmlSubtreeReader._initialDepth, System.Xml.XmlSubtreeReader._state, System.buffer, System.count, System.Xml.XmlReader.Depth, System.index, System.Xml.XmlSubtreeReader.InitReadElementContentAsBinaryAsync(), System.Xml.XmlReader.NodeType, System.Xml.XmlSubtreeReader.NodeType, System.Xml.XmlSubtreeReader.ProcessNamespaces(), System.Xml.XmlSubtreeReader.ReadAsync(), System.Xml.XmlReader.ReadContentAsBase64Async(), System.Xml.XmlWrappingReader.reader, System.Xml.XmlSubtreeReader.SetEmptyNode(), System.SR.Xml_InvalidNodeType, System.SR.Xml_MixingBinaryContentMethods, and System.Xml.XmlException.