ParserErrorCollection.AddRange Metodo

Definizione

Aggiunge ParserError oggetti a una raccolta.

Overload

Nome Descrizione
AddRange(ParserError[])

Aggiunge una matrice di ParserError oggetti all'insieme.

AddRange(ParserErrorCollection)

Aggiunge gli oggetti in un oggetto esistente ParserErrorCollection all'insieme.

AddRange(ParserError[])

Aggiunge una matrice di ParserError oggetti all'insieme.

public:
 void AddRange(cli::array <System::Web::ParserError ^> ^ value);
public void AddRange(System.Web.ParserError[] value);
member this.AddRange : System.Web.ParserError[] -> unit
Public Sub AddRange (value As ParserError())

Parametri

value
ParserError[]

Matrice di tipo ParserError che specifica i valori da aggiungere alla raccolta.

Eccezioni

value è null.

Esempio

Nell'esempio di codice seguente viene illustrato come aggiungere un intervallo di ParserError oggetti a un ParserErrorCollection oggetto .

// Add an array of ParserError objects to the collection.
ParserError[] errors = 
    { new ParserError("Error 2", "Path", 1), 
    new ParserError("Error 3", "Path", 1) };
collection.AddRange(errors);

// Add a collection of ParserError objects to the collection.
ParserErrorCollection errorsCollection = new ParserErrorCollection();
errorsCollection.Add(new ParserError("Error", "Path", 1));
errorsCollection.Add(new ParserError("Error", "Path", 1));
collection.AddRange(errorsCollection);
' Add an array of ParserError objects to the collection.
Dim errors As ParserError() = _
    {New ParserError("Error 2", "Path", 1), _
    New ParserError("Error 3", "Path", 1)}
collection.AddRange(errors)

' Ads a collection of ParserError objects to the collection.
Dim errorsCollection As New ParserErrorCollection()
errorsCollection.Add(New ParserError("Error", "Path", 1))
errorsCollection.Add(New ParserError("Error", "Path", 1))
collection.AddRange(errorsCollection)

Commenti

Utilizzare il AddRange metodo per aggiungere una matrice di ParserError oggetti all'insieme. Il AddRange metodo è utile quando si creano più ParserError oggetti e si desidera aggiungerli alla raccolta con una singola chiamata al metodo. Per aggiungere singoli ParserError oggetti all'insieme, utilizzare il Add metodo .

Si applica a

AddRange(ParserErrorCollection)

Aggiunge gli oggetti in un oggetto esistente ParserErrorCollection all'insieme.

public:
 void AddRange(System::Web::ParserErrorCollection ^ value);
public void AddRange(System.Web.ParserErrorCollection value);
member this.AddRange : System.Web.ParserErrorCollection -> unit
Public Sub AddRange (value As ParserErrorCollection)

Parametri

value
ParserErrorCollection

Oggetto ParserErrorCollection contenente gli ParserError oggetti da aggiungere all'insieme.

Eccezioni

Il valore ParserError è null.

Esempio

Nell'esempio di codice seguente viene illustrato come aggiungere un intervallo di ParserError oggetti a un ParserErrorCollection oggetto .

// Add an array of ParserError objects to the collection.
ParserError[] errors = 
    { new ParserError("Error 2", "Path", 1), 
    new ParserError("Error 3", "Path", 1) };
collection.AddRange(errors);

// Add a collection of ParserError objects to the collection.
ParserErrorCollection errorsCollection = new ParserErrorCollection();
errorsCollection.Add(new ParserError("Error", "Path", 1));
errorsCollection.Add(new ParserError("Error", "Path", 1));
collection.AddRange(errorsCollection);
' Add an array of ParserError objects to the collection.
Dim errors As ParserError() = _
    {New ParserError("Error 2", "Path", 1), _
    New ParserError("Error 3", "Path", 1)}
collection.AddRange(errors)

' Ads a collection of ParserError objects to the collection.
Dim errorsCollection As New ParserErrorCollection()
errorsCollection.Add(New ParserError("Error", "Path", 1))
errorsCollection.Add(New ParserError("Error", "Path", 1))
collection.AddRange(errorsCollection)

Commenti

A differenza del Add metodo , il AddRange metodo non dispone di un valore restituito che può essere utilizzato per determinare se un ParserError oggetto da aggiungere è già presente nell'insieme. Se sono necessarie queste informazioni, usare il Contains metodo prima di usare AddRange.

Si applica a