CompilerErrorCollection.AddRange Método

Definição

Copia os elementos de uma matriz para o final da coleção de erros.

Sobrecargas

Nome Description
AddRange(CompilerError[])

Copia os elementos de uma matriz para o final da coleção de erros.

AddRange(CompilerErrorCollection)

Adiciona o conteúdo da coleção de erros do compilador especificado ao final da coleção de erros.

AddRange(CompilerError[])

Copia os elementos de uma matriz para o final da coleção de erros.

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

Parâmetros

value
CompilerError[]

Uma matriz de tipo CompilerError que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga do AddRange(CompilerError[]) método para adicionar uma matriz de CompilerError objetos a um CompilerErrorCollection.

// Adds an array of CompilerError objects to the collection.
CompilerError[] errors = { new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"), new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") };
collection.AddRange( errors );

// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection errorsCollection = new CompilerErrorCollection();
errorsCollection.Add( new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
errorsCollection.Add( new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
collection.AddRange( errorsCollection );
' Adds an array of CompilerError objects to the collection.
Dim errors As CompilerError() = {New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"), New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text")}
collection.AddRange(errors)

' Adds a collection of CompilerError objects to the collection.
Dim errorsCollection As New CompilerErrorCollection()
errorsCollection.Add(New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))
errorsCollection.Add(New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))
collection.AddRange(errorsCollection)

Confira também

Aplica-se a

AddRange(CompilerErrorCollection)

Adiciona o conteúdo da coleção de erros do compilador especificado ao final da coleção de erros.

public:
 void AddRange(System::CodeDom::Compiler::CompilerErrorCollection ^ value);
public void AddRange(System.CodeDom.Compiler.CompilerErrorCollection value);
member this.AddRange : System.CodeDom.Compiler.CompilerErrorCollection -> unit
Public Sub AddRange (value As CompilerErrorCollection)

Parâmetros

value
CompilerErrorCollection

Um CompilerErrorCollection objeto que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga do AddRange(CompilerErrorCollection) método para adicionar CompilerError objetos de um CompilerErrorCollection a outro CompilerErrorCollection.

// Adds an array of CompilerError objects to the collection.
CompilerError[] errors = { new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"), new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") };
collection.AddRange( errors );

// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection errorsCollection = new CompilerErrorCollection();
errorsCollection.Add( new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
errorsCollection.Add( new CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text") );
collection.AddRange( errorsCollection );
' Adds an array of CompilerError objects to the collection.
Dim errors As CompilerError() = {New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"), New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text")}
collection.AddRange(errors)

' Adds a collection of CompilerError objects to the collection.
Dim errorsCollection As New CompilerErrorCollection()
errorsCollection.Add(New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))
errorsCollection.Add(New CompilerError("Testfile.cs", 5, 10, "CS0001", "Example error text"))
collection.AddRange(errorsCollection)

Confira também

Aplica-se a