CompilerErrorCollection.AddRange Metodo

Definizione

Copia gli elementi di una matrice alla fine dell'insieme di errori.

Overload

Nome Descrizione
AddRange(CompilerError[])

Copia gli elementi di una matrice alla fine dell'insieme di errori.

AddRange(CompilerErrorCollection)

Aggiunge il contenuto della raccolta di errori del compilatore specificata alla fine della raccolta degli errori.

AddRange(CompilerError[])

Copia gli elementi di una matrice alla fine dell'insieme di errori.

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

Parametri

value
CompilerError[]

Matrice di tipo CompilerError che contiene gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come utilizzare l'overload del AddRange(CompilerError[]) metodo per aggiungere una matrice di CompilerError oggetti a un oggetto 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)

Vedi anche

Si applica a

AddRange(CompilerErrorCollection)

Aggiunge il contenuto della raccolta di errori del compilatore specificata alla fine della raccolta degli errori.

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)

Parametri

value
CompilerErrorCollection

Oggetto CompilerErrorCollection contenente gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CompilerErrorCollection) metodo per aggiungere CompilerError oggetti da uno CompilerErrorCollection a un altro 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)

Vedi anche

Si applica a