Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Xml.​XmlWriter

Assembly: System.Xml.ReaderWriter

Inheritance: object → XmlWriter

Implemented Interfaces

Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data.

Properties

Settings
Gets the <see cref="T:System.Xml.XmlWriterSettings" /> object used to create this <see cref="T:System.Xml.XmlWriter" /> instance.
public WriteState
WriteState
When overridden in a derived class, gets the state of the writer.
public string
XmlLang
When overridden in a derived class, gets the current <see langword="xml:lang" /> scope.
public XmlSpace
XmlSpace
When overridden in a derived class, gets an <see cref="T:System.Xml.XmlSpace" /> representing the current <see langword="xml:space" /> scope.

Methods

public void
Close​()
When overridden in a derived class, closes this stream and the underlying stream.
public static XmlWriter
Create​(IO.​Stream output)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified stream.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The stream to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified stream.
public static XmlWriter
Create​(IO.​Stream output, XmlWriterSettings? settings)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the stream and <see cref="T:System.Xml.XmlWriterSettings" /> object.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The stream to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified stream.
settings The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" /> , a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used. If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.
public static XmlWriter
Create​(IO.​TextWriter output)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.IO.TextWriter" /> .
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.IO.TextWriter" /> to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified <see cref="T:System.IO.TextWriter" /> .
public static XmlWriter
Create​(IO.​TextWriter output, XmlWriterSettings? settings)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the <see cref="T:System.IO.TextWriter" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.IO.TextWriter" /> to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> writes XML 1.0 text syntax and appends it to the specified <see cref="T:System.IO.TextWriter" /> .
settings The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" /> , a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used. If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.
public static XmlWriter
Create​(string outputFileName)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified filename.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
outputFileName The file to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> creates a file at the specified path and writes to it in XML 1.0 text syntax. The <paramref name="outputFileName" /> must be a file system path.
public static XmlWriter
Create​(string outputFileName, XmlWriterSettings? settings)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the filename and <see cref="T:System.Xml.XmlWriterSettings" /> object.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
outputFileName The file to which you want to write. The <see cref="T:System.Xml.XmlWriter" /> creates a file at the specified path and writes to it in XML 1.0 text syntax. The <paramref name="outputFileName" /> must be a file system path.
settings The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" /> , a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used. If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.
public static XmlWriter
Create​(Text.​StringBuilder output)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Text.StringBuilder" /> .
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.Text.StringBuilder" /> to which to write to. Content written by the <see cref="T:System.Xml.XmlWriter" /> is appended to the <see cref="T:System.Text.StringBuilder" /> .
public static XmlWriter
Create​(Text.​StringBuilder output, XmlWriterSettings? settings)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the <see cref="T:System.Text.StringBuilder" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.
Returns An <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.Text.StringBuilder" /> to which to write to. Content written by the <see cref="T:System.Xml.XmlWriter" /> is appended to the <see cref="T:System.Text.StringBuilder" /> .
settings The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" /> , a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used. If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.
public static XmlWriter
Create​(XmlWriter output)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Xml.XmlWriter" /> object.
Returns An <see cref="T:System.Xml.XmlWriter" /> object that is wrapped around the specified <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.Xml.XmlWriter" /> object that you want to use as the underlying writer.
public static XmlWriter
Create​(XmlWriter output, XmlWriterSettings? settings)
Creates a new <see cref="T:System.Xml.XmlWriter" /> instance using the specified <see cref="T:System.Xml.XmlWriter" /> and <see cref="T:System.Xml.XmlWriterSettings" /> objects.
Returns An <see cref="T:System.Xml.XmlWriter" /> object that is wrapped around the specified <see cref="T:System.Xml.XmlWriter" /> object.
output The <see cref="T:System.Xml.XmlWriter" /> object that you want to use as the underlying writer.
settings The <see cref="T:System.Xml.XmlWriterSettings" /> object used to configure the new <see cref="T:System.Xml.XmlWriter" /> instance. If this is <see langword="null" /> , a <see cref="T:System.Xml.XmlWriterSettings" /> with default settings is used. If the <see cref="T:System.Xml.XmlWriter" /> is being used with the <see cref="M:System.Xml.Xsl.XslCompiledTransform.Transform(System.String,System.Xml.XmlWriter)" /> method, you should use the <see cref="P:System.Xml.Xsl.XslCompiledTransform.OutputSettings" /> property to obtain an <see cref="T:System.Xml.XmlWriterSettings" /> object with the correct settings. This ensures that the created <see cref="T:System.Xml.XmlWriter" /> object has the correct output settings.
public void
Dispose​()
Releases all resources used by the current instance of the <see cref="T:System.Xml.XmlWriter" /> class.
protected void
Dispose​(bool disposing)
Releases the unmanaged resources used by the <see cref="T:System.Xml.XmlWriter" /> and optionally releases the managed resources.
disposing <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
public void
Flush​()
When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.
FlushAsync​()
Asynchronously flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.
Returns The task that represents the asynchronous <see langword="Flush" /> operation.
public string
LookupPrefix​(string ns)
When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI.
Returns The matching prefix or <see langword="null" /> if no matching namespace URI is found in the current scope.
ns The namespace URI whose prefix you want to find.
public void
WriteAttributes​(XmlReader reader, bool defattr)
When overridden in a derived class, writes out all the attributes found at the current position in the <see cref="T:System.Xml.XmlReader" /> .
reader The <see langword="XmlReader" /> from which to copy the attributes.
defattr <see langword="true" /> to copy the default attributes from the <see langword="XmlReader" /> ; otherwise, <see langword="false" /> .
WriteAttributesAsync​(XmlReader reader, bool defattr)
Asynchronously writes out all the attributes found at the current position in the <see cref="T:System.Xml.XmlReader" /> .
Returns The task that represents the asynchronous <see langword="WriteAttributes" /> operation.
reader The <see langword="XmlReader" /> from which to copy the attributes.
defattr <see langword="true" /> to copy the default attributes from the <see langword="XmlReader" /> ; otherwise, <see langword="false" /> .
public void
WriteAttributeString​(string localName, string value)
When overridden in a derived class, writes out the attribute with the specified local name and value.
localName The local name of the attribute.
value The value of the attribute.
public void
WriteAttributeString​(string localName, string ns, string value)
When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.
localName The local name of the attribute.
ns The namespace URI to associate with the attribute.
value The value of the attribute.
public void
WriteAttributeString​(string prefix, string localName, string ns, string value)
When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value.
prefix The namespace prefix of the attribute.
localName The local name of the attribute.
ns The namespace URI of the attribute.
value The value of the attribute.
WriteAttributeStringAsync​(string prefix, string localName, string ns, string value)
Asynchronously writes out the attribute with the specified prefix, local name, namespace URI, and value.
Returns The task that represents the asynchronous <see langword="WriteAttributeString" /> operation.
prefix The namespace prefix of the attribute.
localName The local name of the attribute.
ns The namespace URI of the attribute.
value The value of the attribute.
public void
WriteBase64​(byte[] buffer, int index, int count)
When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text.
buffer Byte array to encode.
index The position in the buffer indicating the start of the bytes to write.
count The number of bytes to write.
WriteBase64Async​(byte[] buffer, int index, int count)
Asynchronously encodes the specified binary bytes as Base64 and writes out the resulting text.
Returns The task that represents the asynchronous <see langword="WriteBase64" /> operation.
buffer Byte array to encode.
index The position in the buffer indicating the start of the bytes to write.
count The number of bytes to write.
public void
WriteBinHex​(byte[] buffer, int index, int count)
When overridden in a derived class, encodes the specified binary bytes as <see langword="BinHex" /> and writes out the resulting text.
buffer Byte array to encode.
index The position in the buffer indicating the start of the bytes to write.
count The number of bytes to write.
WriteBinHexAsync​(byte[] buffer, int index, int count)
Asynchronously encodes the specified binary bytes as <see langword="BinHex" /> and writes out the resulting text.
Returns The task that represents the asynchronous <see langword="WriteBinHex" /> operation.
buffer Byte array to encode.
index The position in the buffer indicating the start of the bytes to write.
count The number of bytes to write.
public void
WriteCData​(string text)
When overridden in a derived class, writes out a &lt;![CDATA[...]]&gt; block containing the specified text.
text The text to place inside the CDATA block.
WriteCDataAsync​(string text)
Asynchronously writes out a &lt;![CDATA[...]]&gt; block containing the specified text.
Returns The task that represents the asynchronous <see langword="WriteCData" /> operation.
text The text to place inside the CDATA block.
public void
WriteCharEntity​(char ch)
When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.
ch The Unicode character for which to generate a character entity.
WriteCharEntityAsync​(char ch)
Asynchronously forces the generation of a character entity for the specified Unicode character value.
Returns The task that represents the asynchronous <see langword="WriteCharEntity" /> operation.
ch The Unicode character for which to generate a character entity.
public void
WriteChars​(char[] buffer, int index, int count)
When overridden in a derived class, writes text one buffer at a time.
buffer Character array containing the text to write.
index The position in the buffer indicating the start of the text to write.
count The number of characters to write.
WriteCharsAsync​(char[] buffer, int index, int count)
Asynchronously writes text one buffer at a time.
Returns The task that represents the asynchronous <see langword="WriteChars" /> operation.
buffer Character array containing the text to write.
index The position in the buffer indicating the start of the text to write.
count The number of characters to write.
public void
WriteComment​(string text)
When overridden in a derived class, writes out a comment &lt;!--...--&gt; containing the specified text.
text Text to place inside the comment.
WriteCommentAsync​(string text)
Asynchronously writes out a comment &lt;!--...--&gt; containing the specified text.
Returns The task that represents the asynchronous <see langword="WriteComment" /> operation.
text Text to place inside the comment.
public void
WriteDocType​(string name, string pubid, string sysid, string subset)
When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes.
name The name of the DOCTYPE. This must be non-empty.
pubid If non-null it also writes PUBLIC "pubid" "sysid" where <paramref name="pubid" /> and <paramref name="sysid" /> are replaced with the value of the given arguments.
sysid If <paramref name="pubid" /> is <see langword="null" /> and <paramref name="sysid" /> is non-null it writes SYSTEM "sysid" where <paramref name="sysid" /> is replaced with the value of this argument.
subset If non-null it writes [subset] where subset is replaced with the value of this argument.
WriteDocTypeAsync​(string name, string pubid, string sysid, string subset)
Asynchronously writes the DOCTYPE declaration with the specified name and optional attributes.
Returns The task that represents the asynchronous <see langword="WriteDocType" /> operation.
name The name of the DOCTYPE. This must be non-empty.
pubid If non-null it also writes PUBLIC "pubid" "sysid" where <paramref name="pubid" /> and <paramref name="sysid" /> are replaced with the value of the given arguments.
sysid If <paramref name="pubid" /> is <see langword="null" /> and <paramref name="sysid" /> is non-null it writes SYSTEM "sysid" where <paramref name="sysid" /> is replaced with the value of this argument.
subset If non-null it writes [subset] where subset is replaced with the value of this argument.
public void
WriteElementString​(string localName, string value)
Writes an element with the specified local name and value.
localName The local name of the element.
value The value of the element.
public void
WriteElementString​(string localName, string ns, string value)
Writes an element with the specified local name, namespace URI, and value.
localName The local name of the element.
ns The namespace URI to associate with the element.
value The value of the element.
public void
WriteElementString​(string prefix, string localName, string ns, string value)
Writes an element with the specified prefix, local name, namespace URI, and value.
prefix The prefix of the element.
localName The local name of the element.
ns The namespace URI of the element.
value The value of the element.
WriteElementStringAsync​(string prefix, string localName, string ns, string value)
Asynchronously writes an element with the specified prefix, local name, namespace URI, and value.
Returns The task that represents the asynchronous <see langword="WriteElementString" /> operation.
prefix The prefix of the element.
localName The local name of the element.
ns The namespace URI of the element.
value The value of the element.
public void
WriteEndAttribute​()
When overridden in a derived class, closes the previous <see cref="M:System.Xml.XmlWriter.WriteStartAttribute(System.String,System.String)" /> call.
public void
WriteEndDocument​()
When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state.
WriteEndDocumentAsync​()
Asynchronously closes any open elements or attributes and puts the writer back in the Start state.
Returns The task that represents the asynchronous <see langword="WriteEndDocument" /> operation.
public void
WriteEndElement​()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
WriteEndElementAsync​()
Asynchronously closes one element and pops the corresponding namespace scope.
Returns The task that represents the asynchronous <see langword="WriteEndElement" /> operation.
public void
WriteEntityRef​(string name)
When overridden in a derived class, writes out an entity reference as <see langword="&amp;name;" /> .
name The name of the entity reference.
WriteEntityRefAsync​(string name)
Asynchronously writes out an entity reference as <see langword="&amp;name;" /> .
Returns The task that represents the asynchronous <see langword="WriteEntityRef" /> operation.
name The name of the entity reference.
public void
WriteFullEndElement​()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
WriteFullEndElementAsync​()
Asynchronously closes one element and pops the corresponding namespace scope.
Returns The task that represents the asynchronous <see langword="WriteFullEndElement" /> operation.
public void
WriteName​(string name)
When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
name The name to write.
WriteNameAsync​(string name)
Asynchronously writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
Returns The task that represents the asynchronous <see langword="WriteName" /> operation.
name The name to write.
public void
WriteNmToken​(string name)
When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
name The name to write.
WriteNmTokenAsync​(string name)
Asynchronously writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
Returns The task that represents the asynchronous <see langword="WriteNmToken" /> operation.
name The name to write.
public void
WriteNode​(XmlReader reader, bool defattr)
When overridden in a derived class, copies everything from the reader to the writer and moves the reader to the start of the next sibling.
reader The <see cref="T:System.Xml.XmlReader" /> to read from.
defattr <see langword="true" /> to copy the default attributes from the <see langword="XmlReader" /> ; otherwise, <see langword="false" /> .
public void
WriteNode​(XPathNavigator navigator, bool defattr)
Copies everything from the <see cref="T:System.Xml.XPath.XPathNavigator" /> object to the writer. The position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> remains unchanged.
navigator The <see cref="T:System.Xml.XPath.XPathNavigator" /> to copy from.
defattr <see langword="true" /> to copy the default attributes; otherwise, <see langword="false" /> .
WriteNodeAsync​(XmlReader reader, bool defattr)
Asynchronously copies everything from the reader to the writer and moves the reader to the start of the next sibling.
Returns The task that represents the asynchronous <see langword="WriteNode" /> operation.
reader The <see cref="T:System.Xml.XmlReader" /> to read from.
defattr <see langword="true" /> to copy the default attributes from the <see langword="XmlReader" /> ; otherwise, <see langword="false" /> .
WriteNodeAsync​(XPathNavigator navigator, bool defattr)
Asynchronously copies everything from the <see cref="T:System.Xml.XPath.XPathNavigator" /> object to the writer. The position of the <see cref="T:System.Xml.XPath.XPathNavigator" /> remains unchanged.
Returns The task that represents the asynchronous <see langword="WriteNode" /> operation.
navigator The <see cref="T:System.Xml.XPath.XPathNavigator" /> to copy from.
defattr <see langword="true" /> to copy the default attributes; otherwise, <see langword="false" /> .
public void
WriteProcessingInstruction​(string name, string text)
When overridden in a derived class, writes out a processing instruction with a space between the name and text as follows: &lt;?name text?&gt;.
name The name of the processing instruction.
text The text to include in the processing instruction.
WriteProcessingInstructionAsync​(string name, string text)
Asynchronously writes out a processing instruction with a space between the name and text as follows: &lt;?name text?&gt;.
Returns The task that represents the asynchronous <see langword="WriteProcessingInstruction" /> operation.
name The name of the processing instruction.
text The text to include in the processing instruction.
public void
WriteQualifiedName​(string localName, string ns)
When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.
localName The local name to write.
ns The namespace URI for the name.
WriteQualifiedNameAsync​(string localName, string ns)
Asynchronously writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.
Returns The task that represents the asynchronous <see langword="WriteQualifiedName" /> operation.
localName The local name to write.
ns The namespace URI for the name.
public void
WriteRaw​(char[] buffer, int index, int count)
When overridden in a derived class, writes raw markup manually from a character buffer.
buffer Character array containing the text to write.
index The position within the buffer indicating the start of the text to write.
count The number of characters to write.
public void
WriteRaw​(string data)
When overridden in a derived class, writes raw markup manually from a string.
data String containing the text to write.
WriteRawAsync​(char[] buffer, int index, int count)
Asynchronously writes raw markup manually from a character buffer.
Returns The task that represents the asynchronous <see langword="WriteRaw" /> operation.
buffer Character array containing the text to write.
index The position within the buffer indicating the start of the text to write.
count The number of characters to write.
WriteRawAsync​(string data)
Asynchronously writes raw markup manually from a string.
Returns The task that represents the asynchronous <see langword="WriteRaw" /> operation.
data String containing the text to write.
public void
WriteStartAttribute​(string localName)
Writes the start of an attribute with the specified local name.
localName The local name of the attribute.
public void
WriteStartAttribute​(string localName, string ns)
Writes the start of an attribute with the specified local name and namespace URI.
localName The local name of the attribute.
ns The namespace URI of the attribute.
public void
WriteStartAttribute​(string prefix, string localName, string ns)
When overridden in a derived class, writes the start of an attribute with the specified prefix, local name, and namespace URI.
prefix The namespace prefix of the attribute.
localName The local name of the attribute.
ns The namespace URI for the attribute.
public void
WriteStartDocument​()
When overridden in a derived class, writes the XML declaration with the version "1.0".
public void
WriteStartDocument​(bool standalone)
When overridden in a derived class, writes the XML declaration with the version "1.0" and the standalone attribute.
standalone If <see langword="true" /> , it writes "standalone=yes"; if <see langword="false" /> , it writes "standalone=no".
WriteStartDocumentAsync​()
Asynchronously writes the XML declaration with the version "1.0".
Returns The task that represents the asynchronous <see langword="WriteStartDocument" /> operation.
WriteStartDocumentAsync​(bool standalone)
Asynchronously writes the XML declaration with the version "1.0" and the standalone attribute.
Returns The task that represents the asynchronous <see langword="WriteStartDocument" /> operation.
standalone If <see langword="true" /> , it writes "standalone=yes"; if <see langword="false" /> , it writes "standalone=no".
public void
WriteStartElement​(string localName)
When overridden in a derived class, writes out a start tag with the specified local name.
localName The local name of the element.
public void
WriteStartElement​(string localName, string ns)
When overridden in a derived class, writes the specified start tag and associates it with the given namespace.
localName The local name of the element.
ns The namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix, the writer automatically writes that prefix also.
public void
WriteStartElement​(string prefix, string localName, string ns)
When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix.
prefix The namespace prefix of the element.
localName The local name of the element.
ns The namespace URI to associate with the element.
WriteStartElementAsync​(string prefix, string localName, string ns)
Asynchronously writes the specified start tag and associates it with the given namespace and prefix.
Returns The task that represents the asynchronous <see langword="WriteStartElement" /> operation.
prefix The namespace prefix of the element.
localName The local name of the element.
ns The namespace URI to associate with the element.
public void
WriteString​(string text)
When overridden in a derived class, writes the given text content.
text The text to write.
WriteStringAsync​(string text)
Asynchronously writes the given text content.
Returns The task that represents the asynchronous <see langword="WriteString" /> operation.
text The text to write.
public void
WriteSurrogateCharEntity​(char lowChar, char highChar)
When overridden in a derived class, generates and writes the surrogate character entity for the surrogate character pair.
lowChar The low surrogate. This must be a value between 0xDC00 and 0xDFFF.
highChar The high surrogate. This must be a value between 0xD800 and 0xDBFF.
WriteSurrogateCharEntityAsync​(char lowChar, char highChar)
Asynchronously generates and writes the surrogate character entity for the surrogate character pair.
Returns The task that represents the asynchronous <see langword="WriteSurrogateCharEntity" /> operation.
lowChar The low surrogate. This must be a value between 0xDC00 and 0xDFFF.
highChar The high surrogate. This must be a value between 0xD800 and 0xDBFF.
public void
WriteValue​(bool value)
Writes a <see cref="T:System.Boolean" /> value.
value The <see cref="T:System.Boolean" /> value to write.
public void
WriteValue​(DateTime value)
Writes a <see cref="T:System.DateTime" /> value.
value The <see cref="T:System.DateTime" /> value to write.
public void
WriteValue​(DateTimeOffset value)
Writes a <see cref="T:System.DateTimeOffset" /> value.
value The <see cref="T:System.DateTimeOffset" /> value to write.
public void
WriteValue​(decimal value)
Writes a <see cref="T:System.Decimal" /> value.
value The <see cref="T:System.Decimal" /> value to write.
public void
WriteValue​(double value)
Writes a <see cref="T:System.Double" /> value.
value The <see cref="T:System.Double" /> value to write.
public void
WriteValue​(int value)
Writes a <see cref="T:System.Int32" /> value.
value The <see cref="T:System.Int32" /> value to write.
public void
WriteValue​(long value)
Writes a <see cref="T:System.Int64" /> value.
value The <see cref="T:System.Int64" /> value to write.
public void
WriteValue​(object value)
Writes the object value.
value The object value to write. Note With the release of the .NET Framework 3.5, this method accepts <see cref="T:System.DateTimeOffset" /> as a parameter.
public void
WriteValue​(Single value)
Writes a single-precision floating-point number.
value The single-precision floating-point number to write.
public void
WriteValue​(string value)
Writes a <see cref="T:System.String" /> value.
value The <see cref="T:System.String" /> value to write.
public void
WriteWhitespace​(string ws)
When overridden in a derived class, writes out the given white space.
ws The string of white space characters.
WriteWhitespaceAsync​(string ws)
Asynchronously writes out the given white space.
Returns The task that represents the asynchronous <see langword="WriteWhitespace" /> operation.
ws The string of white space characters.
DisposeAsync​()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Returns A task that represents the asynchronous dispose operation.
DisposeAsyncCore​()
Performs application-defined tasks associated with freeing, releasing, or resetting managed resources asynchronously.
Returns A task that represents the asynchronous dispose operation.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object