XDocument.LoadAsync Método

Definição

Sobrecargas

LoadAsync(TextReader, LoadOptions, CancellationToken)

Cria um novo XDocument e inicializa sua árvore XML subjacente usando o parâmetro TextReader especificado, preservando opcionalmente o espaço em branco.Creates a new XDocument and initializes its underlying XML tree using the specified TextReader parameter, optionally preserving white space.

LoadAsync(XmlReader, LoadOptions, CancellationToken)

Cria um novo XDocument que contém o conteúdo do XmlReader especificado.Creates a new XDocument containing the contents of the specified XmlReader.

LoadAsync(Stream, LoadOptions, CancellationToken)

Cria de forma assíncrona um novo XDocument e inicializa sua árvore XML subjacente a partir do fluxo especificado, preservando opcionalmente o espaço em branco.Asynchronously creates a new XDocument and initializes its underlying XML tree from the specified stream, optionally preserving white space.

LoadAsync(TextReader, LoadOptions, CancellationToken)

Cria um novo XDocument e inicializa sua árvore XML subjacente usando o parâmetro TextReader especificado, preservando opcionalmente o espaço em branco.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>
Public Shared Function LoadAsync (textReader As TextReader, options As LoadOptions, cancellationToken As CancellationToken) As Task(Of XDocument)

Parâmetros

textReader
TextReader

Um leitor que contém o XML bruto para ler no XDocument recém-criado.A reader that contains the raw XML to read into the newly created XDocument.

options
LoadOptions

Um conjunto de opções de carregamento.A set of load options.

cancellationToken
CancellationToken

Um token de cancelamento.A cancellation token.

Retornos

Task<XDocument>

Um novo XDocument que contém o conteúdo do TextReader especificado.A new XDocument containing the contents of the specified TextReader.

Comentários

Se LoadOptions.PreserveWhitespace for definido, a XmlReaderSettings.IgnoreWhitespace propriedade será definida como false .If LoadOptions.PreserveWhitespace is set, the XmlReaderSettings.IgnoreWhitespace property is set to false.

Aplica-se a

LoadAsync(XmlReader, LoadOptions, CancellationToken)

Cria um novo XDocument que contém o conteúdo do XmlReader especificado.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>
Public Shared Function LoadAsync (reader As XmlReader, options As LoadOptions, cancellationToken As CancellationToken) As Task(Of XDocument)

Parâmetros

reader
XmlReader

Um leitor que contém o XML que será lido no novo XDocument.A reader containing the XML to be read into the new XDocument.

options
LoadOptions

Um conjunto de opções de carregamento.A set of load options.

cancellationToken
CancellationToken

Um token de cancelamento.A cancellation token.

Retornos

Task<XDocument>

Um novo XDocument que contém o conteúdo do XmlReader especificado.A new XDocument containing the contents of the specified XmlReader.

Aplica-se a

LoadAsync(Stream, LoadOptions, CancellationToken)

Cria de forma assíncrona um novo XDocument e inicializa sua árvore XML subjacente a partir do fluxo especificado, preservando opcionalmente o espaço em branco.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>
Public Shared Function LoadAsync (stream As Stream, options As LoadOptions, cancellationToken As CancellationToken) As Task(Of XDocument)

Parâmetros

stream
Stream

Um fluxo que contém o XML bruto para ler no XDocument recém-criado.A stream containing the raw XML to read into the newly created XDocument.

options
LoadOptions

Um conjunto de opções de carregamento.A set of load options.

cancellationToken
CancellationToken

Um token de cancelamento.A cancellation token.

Retornos

Task<XDocument>

Um novo XDocument que contém o conteúdo do Stream especificado.A new XDocument containing the contents of the specified Stream.

Comentários

Se LoadOptions.PreserveWhitespace for definido, a XmlReaderSettings.IgnoreWhitespace Propriedade subjacente será definida como false .If LoadOptions.PreserveWhitespace is set, the underlying XmlReaderSettings.IgnoreWhitespace property is set to false.

Aplica-se a