ParserErrorCollection.AddRange Methode

Definition

Fügt einer Auflistung Objekte hinzu ParserError .

Überlädt

Name Beschreibung
AddRange(ParserError[])

Fügt der Auflistung ein Array von ParserError Objekten hinzu.

AddRange(ParserErrorCollection)

Fügt die Objekte in einer vorhandenen ParserErrorCollection Auflistung hinzu.

AddRange(ParserError[])

Fügt der Auflistung ein Array von ParserError Objekten hinzu.

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())

Parameter

value
ParserError[]

Ein Array vom Typ ParserError , das die Werte angibt, die der Auflistung hinzugefügt werden sollen.

Ausnahmen

value ist null.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie einem ParserErrorCollection Objekt ein Objektbereich ParserError hinzugefügt wird.

// 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)

Hinweise

Verwenden Sie die AddRange Methode, um der Auflistung ein Array von ParserError Objekten hinzuzufügen. Die AddRange Methode ist nützlich, wenn Sie mehrere ParserError Objekte erstellen und der Auflistung mit einem einzelnen Methodenaufruf hinzufügen möchten. Verwenden Sie die Add Methode, um der Auflistung einzelne ParserError Objekte hinzuzufügen.

Gilt für:

AddRange(ParserErrorCollection)

Fügt die Objekte in einer vorhandenen ParserErrorCollection Auflistung hinzu.

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)

Parameter

value
ParserErrorCollection

A ParserErrorCollection containing the ParserError objects to add to the collection.

Ausnahmen

Der wert ParserError ist null.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie einem ParserErrorCollection Objekt ein Objektbereich ParserError hinzugefügt wird.

// 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)

Hinweise

Add Im Gegensatz zur Methode verfügt die AddRange Methode nicht über einen Rückgabewert, der verwendet werden kann, um zu bestimmen, ob ein ParserError hinzugefügtes Objekt bereits in der Auflistung enthalten ist. Wenn Sie diese Informationen benötigen, verwenden Sie die Contains Methode vor der Verwendung AddRange.

Gilt für: