CompilerErrorCollection.AddRange Metod

Definition

Kopierar elementen i en matris till slutet av felsamlingen.

Överlagringar

Name Description
AddRange(CompilerError[])

Kopierar elementen i en matris till slutet av felsamlingen.

AddRange(CompilerErrorCollection)

Lägger till innehållet i den angivna kompilatorfelsamlingen i slutet av felsamlingen.

AddRange(CompilerError[])

Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs

Kopierar elementen i en matris till slutet av felsamlingen.

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

Parametrar

value
CompilerError[]

En matris av typen CompilerError som innehåller de objekt som ska läggas till i samlingen.

Undantag

value är null.

Exempel

I följande exempel visas hur du använder AddRange(CompilerError[]) metodens överlagring för att lägga till en matris med CompilerError objekt i en 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)

Se även

Gäller för

AddRange(CompilerErrorCollection)

Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs
Källa:
CompilerErrorCollection.cs

Lägger till innehållet i den angivna kompilatorfelsamlingen i slutet av felsamlingen.

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)

Parametrar

value
CompilerErrorCollection

Ett CompilerErrorCollection objekt som innehåller de objekt som ska läggas till i samlingen.

Undantag

value är null.

Exempel

I följande exempel visas hur du använder AddRange(CompilerErrorCollection) metodens överlagring för att lägga CompilerError till objekt från ett till ett CompilerErrorCollection annat 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)

Se även

Gäller för