XElement.LoadAsync XElement.LoadAsync XElement.LoadAsync Method

Definition

Overloads

LoadAsync(Stream, LoadOptions, CancellationToken) LoadAsync(Stream, LoadOptions, CancellationToken) LoadAsync(Stream, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified stream, optionally preserving white space.

LoadAsync(TextReader, LoadOptions, CancellationToken) LoadAsync(TextReader, LoadOptions, CancellationToken) LoadAsync(TextReader, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified text reader, optionally preserving white space.

LoadAsync(XmlReader, LoadOptions, CancellationToken) LoadAsync(XmlReader, LoadOptions, CancellationToken) LoadAsync(XmlReader, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified XML reader, optionally preserving white space.

LoadAsync(Stream, LoadOptions, CancellationToken) LoadAsync(Stream, LoadOptions, CancellationToken) LoadAsync(Stream, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified stream, optionally preserving white space.

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XElement ^> ^ LoadAsync(System::IO::Stream ^ stream, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XElement> LoadAsync (System.IO.Stream stream, System.Xml.Linq.LoadOptions options, System.Threading.CancellationToken cancellationToken);
static member LoadAsync : System.IO.Stream * System.Xml.Linq.LoadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Xml.Linq.XElement>

Parameters

stream
Stream Stream Stream

The stream containing the raw XML to read.

options
LoadOptions LoadOptions LoadOptions

A bitwise combination of the enumeration values that specify the load options to parse the XML.

cancellationToken
CancellationToken CancellationToken CancellationToken

A token that can be used to request cancellation of the asynchronous operation.

Returns

A new XElement containing the contents of the specified stream.

Remarks

If options is set to PreserveWhitespace, then the IgnoreWhitespace property is set to false.

LoadAsync(TextReader, LoadOptions, CancellationToken) LoadAsync(TextReader, LoadOptions, CancellationToken) LoadAsync(TextReader, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified text reader, optionally preserving white space.

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XElement ^> ^ LoadAsync(System::IO::TextReader ^ textReader, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XElement> LoadAsync (System.IO.TextReader textReader, System.Xml.Linq.LoadOptions options, System.Threading.CancellationToken cancellationToken);
static member LoadAsync : System.IO.TextReader * System.Xml.Linq.LoadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Xml.Linq.XElement>

Parameters

textReader
TextReader TextReader TextReader

A reader containing the raw XML to read.

options
LoadOptions LoadOptions LoadOptions

A bitwise combination of the enumeration values that specify the load options to parse the XML.

cancellationToken
CancellationToken CancellationToken CancellationToken

A token that can be used to request cancellation of the asynchronous operation.

Returns

A new XElement containing the contents of the specified reader.

Remarks

If options is set to PreserveWhitespace, then the IgnoreWhitespace property is set to false.

LoadAsync(XmlReader, LoadOptions, CancellationToken) LoadAsync(XmlReader, LoadOptions, CancellationToken) LoadAsync(XmlReader, LoadOptions, CancellationToken)

Asynchronously creates a new XElement and initializes its underlying XML tree using the specified XML reader, optionally preserving white space.

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XElement ^> ^ LoadAsync(System::Xml::XmlReader ^ reader, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XElement> LoadAsync (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options, System.Threading.CancellationToken cancellationToken);
static member LoadAsync : System.Xml.XmlReader * System.Xml.Linq.LoadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Xml.Linq.XElement>

Parameters

reader
XmlReader XmlReader XmlReader

A reader containing the XML to be read.

options
LoadOptions LoadOptions LoadOptions

A bitwise combination of the enumeration values that specify the load options to parse the XML.

cancellationToken
CancellationToken CancellationToken CancellationToken

A token that can be used to request cancellation of the asynchronous operation.

Returns

A new XElement containing the contents of the specified reader.

Applies to