The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CompilerErrorCollection::AddRange Method (CompilerErrorCollection^)
.NET Framework (current version)
Adds the contents of the specified compiler error collection to the end of the error collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom.Compiler::CompilerErrorCollection^
A CompilerErrorCollection object that contains the objects to add to the collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | value is null. |
The following example demonstrates how to use the AddRange(CompilerErrorCollection^) method overload to add CompilerError objects from one CompilerErrorCollection to another CompilerErrorCollection.
// Adds an array of CompilerError objects to the collection. array<CompilerError^>^errors = {gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ),gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example error text" )}; collection->AddRange( errors ); // Adds a collection of CompilerError objects to the collection. CompilerErrorCollection^ errorsCollection = gcnew CompilerErrorCollection; errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) ); errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) ); collection->AddRange( errorsCollection );
.NET Framework
Available since 1.1
Available since 1.1
Show: