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

◆ FinishReadElementContentAsBinaryAsync()

async Task< bool > System.Xml.XmlSubtreeReader.FinishReadElementContentAsBinaryAsync ( )
inlineprivate

Definition at line 1851 of file XmlSubtreeReader.cs.

1852 {
1853 byte[] bytes = new byte[256];
1854 if (_state == State.ReadElementContentAsBase64)
1855 {
1856 while (await reader.ReadContentAsBase64Async(bytes, 0, 256).ConfigureAwait(continueOnCapturedContext: false) > 0)
1857 {
1858 }
1859 }
1860 else
1861 {
1862 while (await reader.ReadContentAsBinHexAsync(bytes, 0, 256).ConfigureAwait(continueOnCapturedContext: false) > 0)
1863 {
1864 }
1865 }
1866 if (NodeType != XmlNodeType.EndElement)
1867 {
1868 throw new XmlException(System.SR.Xml_InvalidNodeType, reader.NodeType.ToString(), reader as IXmlLineInfo);
1869 }
1870 _state = State.Interactive;
1872 if (reader.Depth == _initialDepth)
1873 {
1874 _state = State.EndOfFile;
1875 SetEmptyNode();
1876 return false;
1877 }
1878 return await ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
1879 }
static string Xml_InvalidNodeType
Definition SR.cs:88
Definition SR.cs:7
virtual Task< int > ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
virtual Task< int > ReadContentAsBase64Async(byte[] buffer, int index, int count)
XmlNodeType NodeType
Definition XmlReader.cs:62
override async Task< bool > ReadAsync()
override XmlNodeType NodeType

References System.Xml.XmlSubtreeReader._initialDepth, System.Xml.XmlSubtreeReader._state, System.bytes, System.Xml.XmlReader.Depth, System.Xml.XmlReader.NodeType, System.Xml.XmlSubtreeReader.NodeType, System.Xml.XmlSubtreeReader.ProcessNamespaces(), System.Xml.XmlSubtreeReader.ReadAsync(), System.Xml.XmlReader.ReadContentAsBase64Async(), System.Xml.XmlReader.ReadContentAsBinHexAsync(), System.Xml.XmlWrappingReader.reader, System.Xml.XmlSubtreeReader.SetEmptyNode(), System.SR.Xml_InvalidNodeType, and System.Xml.XmlException.

Referenced by System.Xml.XmlSubtreeReader.ReadAsync(), and System.Xml.XmlSubtreeReader.SkipAsync().