CompilerErrorCollectionとは? わかりやすく解説

CompilerErrorCollection クラス

CompilerError オブジェクトのコレクションを表します。

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

<SerializableAttribute> _
Public Class CompilerErrorCollection
    Inherits CollectionBase
Dim instance As CompilerErrorCollection
[SerializableAttribute] 
public class CompilerErrorCollection : CollectionBase
[SerializableAttribute] 
public ref class CompilerErrorCollection :
 public CollectionBase
/** @attribute SerializableAttribute() */ 
public class CompilerErrorCollection extends
 CollectionBase
SerializableAttribute 
public class CompilerErrorCollection extends
 CollectionBase
解説解説
使用例使用例
' Creates an empty CompilerErrorCollection.
Dim collection As New CompilerErrorCollection()

' Adds a CompilerError to the collection.
collection.Add(New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"))

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

' Tests for the presence of a CompilerError in the 
' collection, and retrieves its index if it is found.
Dim testError As New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text")
Dim itemIndex As Integer
 = -1
If collection.Contains(testError) Then
    itemIndex = collection.IndexOf(testError)
End If

' Copies the contents of the collection, beginning at index 0, 
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer
 = collection.Count

' Inserts a CompilerError at index 0 of the collection.
collection.Insert(0, New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text"))

' Removes the specified CompilerError from the collection.
Dim [error] As New CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error
 text")
collection.Remove([error])

' Removes the CompilerError at index 0.
collection.RemoveAt(0)
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();
                        

// Adds a CompilerError to the collection.
collection.Add( new CompilerError("Testfile.cs", 5,
 10, "CS0001", "Example error text") );

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

// Tests for the presence of a CompilerError in the 
// collection, and retrieves its index if it is found.
CompilerError testError = new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text");
int itemIndex = -1;
if( collection.Contains( testError ) )
    itemIndex = collection.IndexOf( testError );

// Copies the contents of the collection, beginning at index 0, 
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo( errors, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CompilerError at index 0 of the collection.
collection.Insert( 0, new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text") );

// Removes the specified CompilerError from the collection.
CompilerError error = new CompilerError("Testfile.cs",
 5, 10, "CS0001", "Example error text");
collection.Remove( error );

// Removes the CompilerError at index 0.
collection.RemoveAt(0);
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection^ collection = gcnew CompilerErrorCollection;

// Adds a CompilerError to the collection.
collection->Add( gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example
 error text" ) );

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

// Tests for the presence of a CompilerError in the
// collection, and retrieves its index if it is found.
CompilerError^ testError = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" );
int itemIndex = -1;
if ( collection->Contains( testError ) )
   itemIndex = collection->IndexOf( testError );

// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection->CopyTo( errors, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a CompilerError at index 0 of the collection.
collection->Insert( 0, gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" ) );

// Removes the specified CompilerError from the collection.
CompilerError^ error = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example
 error text" );
collection->Remove( error );

// Removes the CompilerError at index 0.
collection->RemoveAt( 0 );
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();

// Adds a CompilerError to the collection.
collection.Add(new CompilerError("Testfile.cs", 5, 10,
 "CS0001", 
    "Example error text"));

// Adds an array of CompilerError objects to the collection.
CompilerError errors[] =  { new CompilerError("Testfile.cs",
 5, 10, 
    "CS0001", "Example error text"), new CompilerError("Testfile.jsl",
 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.jsl",
 5, 10, "CS0001",
    "Example error text"));
errorsCollection.Add(new CompilerError("Testfile.jsl",
 5, 10, "JSL0001",
    "Example error text"));
collection.AddRange(errorsCollection);

// Tests for the presence of a CompilerError in the 
// collection, and retrieves its index if it is found.
CompilerError testError = new CompilerError("Testfile.JSL",
 5, 10,
    "JSL0001", "Example error text");
int itemIndex = -1;
if (collection.Contains(testError)) {
    itemIndex = collection.IndexOf(testError);
}

// Copies the contents of the collection, beginning at index 0, 
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo(errors, 0);

// Retrieves the count of the items in the collection.
int collectionCount = collection.get_Count();

// Inserts a CompilerError at index 0 of the collection.
collection.Insert(0, new CompilerError("Testfile.cs",
 5, 10, "JSL0001",
    "Example error text"));

// Removes the specified CompilerError from the collection.
CompilerError error = new CompilerError("Testfile.cs",
 5, 10, "JSL0001",
    "Example error text");
collection.Remove(error);

// Removes the CompilerError at index 0.
collection.RemoveAt(0);
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
   System.Collections.CollectionBase
    System.CodeDom.Compiler.CompilerErrorCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間
CompilerErrorCollection クラス

CompilerErrorCollection コンストラクタ ()

CompilerErrorCollection クラスの新しいインスタンスを初期化します。

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

Dim instance As New CompilerErrorCollection
public CompilerErrorCollection ()
public:
CompilerErrorCollection ()
public CompilerErrorCollection ()
public function CompilerErrorCollection ()
使用例使用例
' Creates an empty CompilerErrorCollection.
Dim collection As New CompilerErrorCollection()
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();                        
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection^ collection = gcnew CompilerErrorCollection;
// Creates an empty CompilerErrorCollection.
CompilerErrorCollection collection = new CompilerErrorCollection();
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerErrorCollection クラス
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間

CompilerErrorCollection コンストラクタ (CompilerError[])

CompilerError オブジェクトの指定した配列を格納する CompilerErrorCollection の新しいインスタンスを初期化します。

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    value As CompilerError() _
)
Dim value As CompilerError()

Dim instance As New CompilerErrorCollection(value)
public CompilerErrorCollection (
    CompilerError[] value
)
public:
CompilerErrorCollection (
    array<CompilerError^>^ value
)
public CompilerErrorCollection (
    CompilerError[] value
)
public function CompilerErrorCollection (
    value : CompilerError[]
)

パラメータ

value

コレクションを初期化するために使用する CompilerError オブジェクトの配列。

例外例外
例外の種類条件

ArgumentNullException

value が null 参照 (Visual Basic では Nothing) です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerErrorCollection クラス
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間

CompilerErrorCollection コンストラクタ (CompilerErrorCollection)

指定した CompilerErrorCollection の内容を格納する CompilerErrorCollection の新しいインスタンスを初期化します。

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

Public Sub New ( _
    value As CompilerErrorCollection _
)
Dim value As CompilerErrorCollection

Dim instance As New CompilerErrorCollection(value)
public CompilerErrorCollection (
    CompilerErrorCollection value
)
public:
CompilerErrorCollection (
    CompilerErrorCollection^ value
)
public CompilerErrorCollection (
    CompilerErrorCollection value
)
public function CompilerErrorCollection (
    value : CompilerErrorCollection
)

パラメータ

value

内容のコピー元の CompilerErrorCollection。

例外例外
例外の種類条件

ArgumentNullException

value が null 参照 (Visual Basic では Nothing) です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerErrorCollection クラス
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間

CompilerErrorCollection コンストラクタ

CompilerErrorCollection クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
CompilerErrorCollection () CompilerErrorCollection クラスの新しいインスタンスを初期化します。
CompilerErrorCollection (CompilerError[]) CompilerError オブジェクトの指定した配列を格納する CompilerErrorCollection の新しいインスタンスを初期化します。
CompilerErrorCollection (CompilerErrorCollection) 指定した CompilerErrorCollection の内容を格納する CompilerErrorCollection の新しいインスタンスを初期化します。
参照参照

関連項目

CompilerErrorCollection クラス
CompilerErrorCollection メンバ
System.CodeDom.Compiler 名前空間

CompilerErrorCollection プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Capacity  CollectionBase に格納できる要素の数を取得または設定します。 ( CollectionBase から継承されます。)
パブリック プロパティ Count  CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック プロパティ HasErrors コレクションにエラーが格納されているかどうかを示す値を取得します。
パブリック プロパティ HasWarnings コレクションに警告が格納されているかどうかを示す値を取得します。
パブリック プロパティ Item 指定したインデックス位置にある CompilerError を取得または設定します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。 ( CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素のリストを格納する IList を取得します。 ( CollectionBase から継承されます。)
参照参照

関連項目

CompilerErrorCollection クラス
System.CodeDom.Compiler 名前空間
CompilerErrorCollection クラス

CompilerErrorCollection メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Add 指定した CompilerError をエラー コレクションに追加します。
パブリック メソッド AddRange オーバーロードされます。 配列の要素をエラー コレクションの末尾にコピーします。
パブリック メソッド Clear  CollectionBase インスタンスからすべてのオブジェクトを削除します。このメソッドはオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック メソッド Contains 指定した CompilerError がコレクションに格納されているかどうかを示す値を取得します。
パブリック メソッド CopyTo 1 次元の Array インスタンスの指定したインデックス位置に、コレクション値をコピーします。
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド GetEnumerator  CollectionBase インスタンスを反復処理する列挙子を返します。 ( CollectionBase から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド IndexOf 指定した CompilerError がコレクション内に存在する場合は、そのインデックスを取得します。
パブリック メソッド Insert コレクション内の指定したインデックス位置に、指定した CompilerError を挿入します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド Remove コレクションから特定の CompilerError を削除します。
パブリック メソッド RemoveAt  CollectionBase インスタンスの指定したインデックスにある要素を削除します。このメソッドはオーバーライドできません。 ( CollectionBase から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 ( Object から継承されます。)
プロテクト メソッド OnClear  CollectionBase インスタンスの内容を消去するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnClearComplete  CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnInsert  CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnInsertComplete  CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnRemove  CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnRemoveComplete  CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnSet  CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnSetComplete  CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
プロテクト メソッド OnValidate  値を検証するときに、追加のカスタム プロセスを実行します。 ( CollectionBase から継承されます。)
参照参照

関連項目

CompilerErrorCollection クラス
System.CodeDom.Compiler 名前空間
CompilerErrorCollection クラス

CompilerErrorCollection メンバ

CompilerError オブジェクトのコレクションを表します。

CompilerErrorCollection データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド CompilerErrorCollection オーバーロードされます。 CompilerErrorCollection クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Capacity  CollectionBase に格納できる要素の数を取得または設定します。(CollectionBase から継承されます。)
パブリック プロパティ Count  CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。(CollectionBase から継承されます。)
パブリック プロパティ HasErrors コレクションにエラーが格納されているかどうかを示す値を取得します。
パブリック プロパティ HasWarnings コレクションに警告が格納されているかどうかを示す値を取得します。
パブリック プロパティ Item 指定したインデックス位置にある CompilerError を取得または設定します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ InnerList  CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。(CollectionBase から継承されます。)
プロテクト プロパティ List  CollectionBase インスタンス内の要素のリストを格納する IList を取得します。(CollectionBase から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Add 指定した CompilerError をエラー コレクションに追加します。
パブリック メソッド AddRange オーバーロードされます。 配列の要素をエラー コレクションの末尾にコピーします。
パブリック メソッド Clear  CollectionBase インスタンスからすべてのオブジェクトを削除します。このメソッドはオーバーライドできません。 (CollectionBase から継承されます。)
パブリック メソッド Contains 指定した CompilerError がコレクションに格納されているかどうかを示す値を取得します。
パブリック メソッド CopyTo 1 次元の Array インスタンスの指定したインデックス位置に、コレクション値をコピーします。
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド GetEnumerator  CollectionBase インスタンスを反復処理する列挙子を返します。 (CollectionBase から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド IndexOf 指定した CompilerError がコレクション内に存在する場合は、そのインデックスを取得します。
パブリック メソッド Insert コレクション内の指定したインデックス位置に、指定した CompilerError を挿入します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド Remove コレクションから特定の CompilerError を削除します。
パブリック メソッド RemoveAt  CollectionBase インスタンスの指定したインデックスにある要素を削除します。このメソッドはオーバーライドできません。 (CollectionBase から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
プロテクト メソッド OnClear  CollectionBase インスタンスの内容を消去するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnClearComplete  CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnInsert  CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnInsertComplete  CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnRemove  CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnRemoveComplete  CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnSet  CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnSetComplete  CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
プロテクト メソッド OnValidate  値を検証するときに、追加のカスタム プロセスを実行します。 (CollectionBase から継承されます。)
参照参照

関連項目

CompilerErrorCollection クラス
System.CodeDom.Compiler 名前空間
CompilerErrorCollection クラス



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「CompilerErrorCollection」の関連用語

CompilerErrorCollectionのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CompilerErrorCollectionのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS