XmlWriter.WriteAttributesAsync(XmlReader, Boolean) 方法

定義

非同步寫出在 XmlReader 中的目前位置找到的所有屬性。

public:
 virtual System::Threading::Tasks::Task ^ WriteAttributesAsync(System::Xml::XmlReader ^ reader, bool defattr);
public virtual System.Threading.Tasks.Task WriteAttributesAsync (System.Xml.XmlReader reader, bool defattr);
abstract member WriteAttributesAsync : System.Xml.XmlReader * bool -> System.Threading.Tasks.Task
override this.WriteAttributesAsync : System.Xml.XmlReader * bool -> System.Threading.Tasks.Task
Public Overridable Function WriteAttributesAsync (reader As XmlReader, defattr As Boolean) As Task

參數

reader
XmlReader

要複製屬性的 XmlReader

defattr
Boolean

若要從 true 複製預設屬性,則為 XmlReader,否則為 false

傳回

表示非同步 WriteAttributes 作業的工作。

例外狀況

在先前的非同步作業完成前呼叫了 XmlWriter 方法。 在此情況下,會擲回 InvalidOperationException 與「非同步作業已經在進行中」的訊息。

-或-

在未將 Async 旗標設為 true的情況下呼叫了 XmlWriter 非同步方法。 在此情況下,就會擲回 InvalidOperationException 並顯示訊息「如果您要使用非同步方法,請將 XmlWriterSettings.Async 設為 true」。

備註

這是 的非同步版本 WriteAttributes ,具有相同的功能。 若要使用這個方法,您必須將 Async 旗標設定為 true

適用於

另請參閱