XmlWriter.WriteAttributesAsync(XmlReader, Boolean) Metoda

Definicja

Asynchronicznie zapisuje wszystkie atrybuty znalezione w bieżącej pozycji w elemencie 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

Parametry

reader
XmlReader

Element XmlReader , z którego mają być skopiowane atrybuty.

defattr
Boolean

true aby skopiować atrybuty domyślne z elementu XmlReader; w przeciwnym razie false.

Zwraca

Zadanie reprezentujące operację asynchroniczną WriteAttributes .

Wyjątki

Metoda XmlWriter została wywołana przed zakończeniem poprzedniej operacji asynchronicznej. W tym przypadku InvalidOperationException jest zgłaszany komunikat "Operacja asynchroniczna jest już w toku".

-lub-

Wywołano XmlWriter metodę asynchroniczną bez ustawienia flagi Async na true. W takim przypadku InvalidOperationException jest zgłaszany komunikat "Ustaw wartość XmlWriterSettings.Async na wartość true, jeśli chcesz użyć metod asynchronicznych".

Uwagi

Jest to asynchroniczna wersja programu WriteAttributes, z tą samą funkcjonalnością. Aby użyć tej metody, należy ustawić flagę Async na true.

Dotyczy

Zobacz też