XDocument.LoadAsync XDocument.LoadAsync XDocument.LoadAsync Method

Definition

Overloads

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

Creates a new XDocument and initializes its underlying XML tree using the specified TextReader parameter, optionally preserving white space.

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

Creates a new XDocument containing the contents of the specified XmlReader.

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

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

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

Creates a new XDocument and initializes its underlying XML tree using the specified TextReader parameter, optionally preserving white space.

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XDocument ^> ^ LoadAsync(System::IO::TextReader ^ textReader, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XDocument> 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.XDocument>

Parameters

textReader
TextReader TextReader TextReader

A reader that contains the raw XML to read into the newly created XDocument.

options
LoadOptions LoadOptions LoadOptions

A set of load options.

cancellationToken
CancellationToken CancellationToken CancellationToken

A cancellation token.

Returns

A new XDocument containing the contents of the specified TextReader.

Remarks

If LoadOptions.PreserveWhitespace is set, the XmlReaderSettings.IgnoreWhitespace property is set to false.

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

Creates a new XDocument containing the contents of the specified XmlReader.

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XDocument ^> ^ LoadAsync(System::Xml::XmlReader ^ reader, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XDocument> 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.XDocument>

Parameters

reader
XmlReader XmlReader XmlReader

A reader containing the XML to be read into the new XDocument.

options
LoadOptions LoadOptions LoadOptions

A set of load options.

cancellationToken
CancellationToken CancellationToken CancellationToken

A cancellation token.

Returns

A new XDocument containing the contents of the specified XmlReader.

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

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

public:
 static System::Threading::Tasks::Task<System::Xml::Linq::XDocument ^> ^ LoadAsync(System::IO::Stream ^ stream, System::Xml::Linq::LoadOptions options, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<System.Xml.Linq.XDocument> 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.XDocument>

Parameters

stream
Stream Stream Stream

A stream containing the raw XML to read into the newly created XDocument.

options
LoadOptions LoadOptions LoadOptions

A set of load options.

cancellationToken
CancellationToken CancellationToken CancellationToken

A cancellation token.

Returns

A new XDocument containing the contents of the specified Stream.

Remarks

If LoadOptions.PreserveWhitespace is set, the underlying XmlReaderSettings.IgnoreWhitespace property is set to false.

Applies to