CompilerErrorCollection.AddRange Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Copia os elementos de um array para o final da coleção de erros.
Sobrecargas
| Name | Description |
|---|---|
| AddRange(CompilerError[]) |
Copia os elementos de um array para o final da coleção de erros. |
| AddRange(CompilerErrorCollection) |
Adiciona o conteúdo da coleção de erros do compilador especificada ao final da coleção de erros. |
AddRange(CompilerError[])
Copia os elementos de um array 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[]
Um array de tipos CompilerError que contém os objetos a adicionar à coleção.
Exceções
value é null.
Exemplos
O exemplo seguinte demonstra como usar o AddRange(CompilerError[]) método overload para adicionar um array 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)
Ver também
Aplica-se a
AddRange(CompilerErrorCollection)
Adiciona o conteúdo da coleção de erros do compilador especificada 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 adicionar à coleção.
Exceções
value é null.
Exemplos
O exemplo seguinte demonstra como usar o AddRange(CompilerErrorCollection) método sobrecarga para adicionar CompilerError objetos de um CompilerErrorCollection para 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)