Share via


CompilerErrorCollection.AddRange メソッド

定義

配列の要素をエラー コレクションの末尾にコピーします。

オーバーロード

AddRange(CompilerError[])

配列の要素をエラー コレクションの末尾にコピーします。

AddRange(CompilerErrorCollection)

指定したコンパイラ エラー コレクションの内容をエラー コレクションの末尾に追加します。

AddRange(CompilerError[])

ソース:
CompilerErrorCollection.cs
ソース:
CompilerErrorCollection.cs
ソース:
CompilerErrorCollection.cs

配列の要素をエラー コレクションの末尾にコピーします。

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

パラメーター

value
CompilerError[]

コレクションに追加するオブジェクトを格納している CompilerError 型の配列。

例外

valuenullです。

次の例では、 メソッドオーバーロードを AddRange(CompilerError[]) 使用して オブジェクトの CompilerError 配列を に追加する方法を 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 );
// 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)

こちらもご覧ください

適用対象

AddRange(CompilerErrorCollection)

ソース:
CompilerErrorCollection.cs
ソース:
CompilerErrorCollection.cs
ソース:
CompilerErrorCollection.cs

指定したコンパイラ エラー コレクションの内容をエラー コレクションの末尾に追加します。

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)

パラメーター

value
CompilerErrorCollection

コレクションに追加するオブジェクトが格納された CompilerErrorCollection オブジェクト。

例外

valuenullです。

次の例では、 メソッドオーバーロードを使用AddRange(CompilerErrorCollection)して、オブジェクトを別CompilerErrorCollectionCompilerErrorCollection に追加CompilerErrorする方法を示します。

// 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 );
// 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)

こちらもご覧ください

適用対象