次の方法で共有


CompilerErrorCollection.AddRange メソッド (CompilerError )

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

Overloads Public Sub AddRange( _
   ByVal value() As CompilerError _)
[C#]
public void AddRange(CompilerError[] value);
[C++]
public: void AddRange(CompilerError* value[]);
[JScript]
public function AddRange(
   value : CompilerError[]);

パラメータ

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

使用例

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

[C#] 
// 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 );

[C++] 
// Adds an array of CompilerError objects to the collection.
CompilerError* errors[] = { new CompilerError(S"Testfile.cs", 5, 10, S"CS0001", S"Example error text"), new CompilerError(S"Testfile::cs", 5, 10, S"CS0001", S"Example error text") };
collection->AddRange(errors);

// Adds a collection of CompilerError objects to the collection.
CompilerErrorCollection* errorsCollection = new CompilerErrorCollection();
errorsCollection->Add(new CompilerError(S"Testfile.cs", 5, 10, S"CS0001", S"Example error text"));
errorsCollection->Add(new CompilerError(S"Testfile.cs", 5, 10, S"CS0001", S"Example error text"));
collection->AddRange(errorsCollection);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

CompilerErrorCollection クラス | CompilerErrorCollection メンバ | System.CodeDom.Compiler 名前空間 | CompilerErrorCollection.AddRange オーバーロードの一覧 | Add