CompilerErrorCollection.AddRange メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
配列の要素をエラー コレクションの末尾にコピーします。
オーバーロード
| 名前 | 説明 |
|---|---|
| AddRange(CompilerError[]) |
配列の要素をエラー コレクションの末尾にコピーします。 |
| AddRange(CompilerErrorCollection) |
指定したコンパイラ エラー コレクションの内容をエラー コレクションの末尾に追加します。 |
AddRange(CompilerError[])
配列の要素をエラー コレクションの末尾にコピーします。
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 型の配列。
例外
value は nullです。
例
次の例では、 AddRange(CompilerError[]) メソッドのオーバーロードを使用して、 CompilerError オブジェクトの配列を 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)
こちらもご覧ください
適用対象
AddRange(CompilerErrorCollection)
指定したコンパイラ エラー コレクションの内容をエラー コレクションの末尾に追加します。
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 オブジェクト。
例外
value は nullです。
例
次の例では、AddRange(CompilerErrorCollection) メソッドオーバーロードを使用して、あるCompilerErrorから別のCompilerErrorCollectionに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)