XmlWriter.WriteStartDocumentAsync XmlWriter.WriteStartDocumentAsync XmlWriter.WriteStartDocumentAsync XmlWriter.WriteStartDocumentAsync Method

定義

以非同步的方式寫入 XML 宣告。Asynchronously writes the XML declaration.

多載

WriteStartDocumentAsync() WriteStartDocumentAsync() WriteStartDocumentAsync() WriteStartDocumentAsync()

以非同步的方式使用「1.0」版寫入 XML 宣告。Asynchronously writes the XML declaration with the version "1.0".

WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean)

以非同步的方式使用「1.0」版寫入 XML 宣告與獨立屬性。Asynchronously writes the XML declaration with the version "1.0" and the standalone attribute.

備註

這是非同步的WriteStartDocument,使用相同的功能。This is the asynchronous version of WriteStartDocument, with the same functionality. 若要使用此方法,您必須設定Async旗標設為trueTo use this method, you must set the Async flag to true.

WriteStartDocumentAsync() WriteStartDocumentAsync() WriteStartDocumentAsync() WriteStartDocumentAsync()

以非同步的方式使用「1.0」版寫入 XML 宣告。Asynchronously writes the XML declaration with the version "1.0".

public:
 virtual System::Threading::Tasks::Task ^ WriteStartDocumentAsync();
public virtual System.Threading.Tasks.Task WriteStartDocumentAsync ();
abstract member WriteStartDocumentAsync : unit -> System.Threading.Tasks.Task
override this.WriteStartDocumentAsync : unit -> System.Threading.Tasks.Task
Public Overridable Function WriteStartDocumentAsync () As Task

傳回

表示非同步 WriteStartDocument 作業的工作。The task that represents the asynchronous WriteStartDocument operation.

例外狀況

在先前的非同步作業完成前呼叫了 XmlWriter 方法。An XmlWriter method was called before a previous asynchronous operation finished. 在此情況下,會擲回 InvalidOperationException 與「非同步作業已經在進行中」的訊息。In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

-或--or-

在未將 Async 旗標設為 true的情況下呼叫了 XmlWriter 非同步方法。An XmlWriter asynchronous method was called without setting the Async flag to true. 在此情況下,就會擲回 InvalidOperationException 並顯示訊息「如果您要使用非同步方法,請將 XmlWriterSettings.Async 設為 true」。In this case, InvalidOperationException is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."

備註

這是非同步的WriteStartDocument,使用相同的功能。This is the asynchronous version of WriteStartDocument, with the same functionality. 若要使用此方法,您必須設定Async旗標設為trueTo use this method, you must set the Async flag to true.

另請參閱

WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean) WriteStartDocumentAsync(Boolean)

以非同步的方式使用「1.0」版寫入 XML 宣告與獨立屬性。Asynchronously writes the XML declaration with the version "1.0" and the standalone attribute.

public:
 virtual System::Threading::Tasks::Task ^ WriteStartDocumentAsync(bool standalone);
public virtual System.Threading.Tasks.Task WriteStartDocumentAsync (bool standalone);
abstract member WriteStartDocumentAsync : bool -> System.Threading.Tasks.Task
override this.WriteStartDocumentAsync : bool -> System.Threading.Tasks.Task
Public Overridable Function WriteStartDocumentAsync (standalone As Boolean) As Task

參數

standalone
Boolean Boolean Boolean Boolean

如果 true,它會寫入「standalone=yes」;如果 false,它會寫入「standalone=no」。If true, it writes "standalone=yes"; if false, it writes "standalone=no".

傳回

表示非同步 WriteStartDocument 作業的工作。The task that represents the asynchronous WriteStartDocument operation.

例外狀況

在先前的非同步作業完成前呼叫了 XmlWriter 方法。An XmlWriter method was called before a previous asynchronous operation finished. 在此情況下,會擲回 InvalidOperationException 與「非同步作業已經在進行中」的訊息。In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

-或--or-

在未將 Async 旗標設為 true的情況下呼叫了 XmlWriter 非同步方法。An XmlWriter asynchronous method was called without setting the Async flag to true. 在此情況下,就會擲回 InvalidOperationException 並顯示訊息「如果您要使用非同步方法,請將 XmlWriterSettings.Async 設為 true」。In this case, InvalidOperationException is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods."

備註

這是非同步的WriteStartDocument,使用相同的功能。This is the asynchronous version of WriteStartDocument, with the same functionality. 若要使用此方法,您必須設定Async旗標設為trueTo use this method, you must set the Async flag to true.

另請參閱

適用於