ParserErrorCollection.AddRange Método

Definición

Agrega ParserError objetos a una colección.

Sobrecargas

Nombre Description
AddRange(ParserError[])

Agrega una matriz de ParserError objetos a la colección.

AddRange(ParserErrorCollection)

Agrega los objetos de una colección existente ParserErrorCollection a la colección.

AddRange(ParserError[])

Agrega una matriz de ParserError objetos a la colección.

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

Parámetros

value
ParserError[]

Matriz de tipo ParserError que especifica los valores que se van a agregar a la colección.

Excepciones

value es null.

Ejemplos

En el ejemplo de código siguiente se muestra cómo agregar un intervalo de ParserError objetos a un ParserErrorCollection objeto .

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

Comentarios

Use el AddRange método para agregar una matriz de ParserError objetos a la colección. El AddRange método es útil al crear varios ParserError objetos y desea agregarlos a la colección con una sola llamada de método. Para agregar objetos individuales ParserError a la colección, use el Add método .

Se aplica a

AddRange(ParserErrorCollection)

Agrega los objetos de una colección existente ParserErrorCollection a la colección.

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)

Parámetros

value
ParserErrorCollection

que ParserErrorCollection contiene los ParserError objetos que se van a agregar a la colección.

Excepciones

El valor de ParserError es null.

Ejemplos

En el ejemplo de código siguiente se muestra cómo agregar un intervalo de ParserError objetos a un ParserErrorCollection objeto .

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

Comentarios

A diferencia del Add método , el AddRange método no tiene un valor devuelto que se puede usar para determinar si un ParserError objeto que se va a agregar ya está en la colección. Si necesita esta información, use el Contains método antes de usar AddRange.

Se aplica a