CodeStatementCollection クラス
アセンブリ: System (system.dll 内)

<SerializableAttribute> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class CodeStatementCollection Inherits CollectionBase
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class CodeStatementCollection : CollectionBase
[SerializableAttribute] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class CodeStatementCollection : public CollectionBase


' Creates an empty CodeStatementCollection. Dim collection As New CodeStatementCollection ' Adds a CodeStatement to the collection. collection.Add(New CodeCommentStatement("Test comment statement")) ' Adds an array of CodeStatement objects to the collection. Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")} collection.AddRange(statements) ' Adds a collection of CodeStatement objects to the collection. Dim testStatement As New CodeStatement Dim statementsCollection As New CodeStatementCollection statementsCollection.Add(New CodeCommentStatement("Test comment statement")) statementsCollection.Add(New CodeCommentStatement("Test comment statement")) statementsCollection.Add(testStatement) collection.AddRange(statementsCollection) ' Tests for the presence of a CodeStatement in the ' collection, and retrieves its index if it is found. Dim itemIndex As Integer = -1 If collection.Contains(testStatement) Then itemIndex = collection.IndexOf(testStatement) End If ' Copies the contents of the collection beginning at index 0 to the specified CodeStatement array. ' 'statements' is a CodeStatement array. Dim statementArray(collection.Count) As CodeStatement collection.CopyTo(statementArray, 0) ' Retrieves the count of the items in the collection. Dim collectionCount As Integer = collection.Count ' Inserts a CodeStatement at index 0 of the collection. collection.Insert(0, New CodeCommentStatement("Test comment statement")) ' Removes the specified CodeStatement from the collection. collection.Remove(testStatement) ' Removes the CodeStatement at index 0. collection.RemoveAt(0)
// Creates an empty CodeStatementCollection. CodeStatementCollection collection = new CodeStatementCollection(); // Adds a CodeStatement to the collection. collection.Add( new CodeCommentStatement("Test comment statement") ); // Adds an array of CodeStatement objects to the collection. CodeStatement[] statements = { new CodeCommentStatement("Test comment statement"), new CodeCommentStatement("Test comment statement")}; collection.AddRange( statements ); // Adds a collection of CodeStatement objects to the collection. CodeStatement testStatement = new CodeCommentStatement("Test comment statement"); CodeStatementCollection statementsCollection = new CodeStatementCollection(); statementsCollection.Add( new CodeCommentStatement("Test comment statement") ); statementsCollection.Add( new CodeCommentStatement("Test comment statement") ); statementsCollection.Add( testStatement ); collection.AddRange( statementsCollection ); // Tests for the presence of a CodeStatement in the // collection, and retrieves its index if it is found. int itemIndex = -1; if( collection.Contains( testStatement ) ) itemIndex = collection.IndexOf( testStatement ); // Copies the contents of the collection beginning at index 0 to the specified CodeStatement array. // 'statements' is a CodeStatement array. CodeStatement[] statementArray = new CodeStatement[collection.Count]; collection.CopyTo( statementArray, 0 ); // Retrieves the count of the items in the collection. int collectionCount = collection.Count; // Inserts a CodeStatement at index 0 of the collection. collection.Insert( 0, new CodeCommentStatement("Test comment statement") ); // Removes the specified CodeStatement from the collection. collection.Remove( testStatement ); // Removes the CodeStatement at index 0. collection.RemoveAt(0);
// Creates an empty CodeStatementCollection. CodeStatementCollection^ collection = gcnew CodeStatementCollection; // Adds a CodeStatement to the collection. collection->Add( gcnew CodeCommentStatement( "Test comment statement" ) ); // Adds an array of CodeStatement objects to the collection. array<CodeStatement^>^statements = {gcnew CodeCommentStatement( "Test comment statement" ),gcnew CodeCommentStatement( "Test comment statement" )}; collection->AddRange( statements ); // Adds a collection of CodeStatement objects to the collection. CodeStatement^ testStatement = gcnew CodeCommentStatement( "Test comment statement" ); CodeStatementCollection^ statementsCollection = gcnew CodeStatementCollection; statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) ); statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) ); statementsCollection->Add( testStatement ); collection->AddRange( statementsCollection ); // Tests for the presence of a CodeStatement in the // collection, and retrieves its index if it is found. int itemIndex = -1; if ( collection->Contains( testStatement ) ) itemIndex = collection->IndexOf( testStatement ); // Copies the contents of the collection beginning at index 0 to the specified CodeStatement array. // 'statements' is a CodeStatement array. collection->CopyTo( statements, 0 ); // Retrieves the count of the items in the collection. int collectionCount = collection->Count; // Inserts a CodeStatement at index 0 of the collection. collection->Insert( 0, gcnew CodeCommentStatement( "Test comment statement" ) ); // Removes the specified CodeStatement from the collection. collection->Remove( testStatement ); // Removes the CodeStatement at index 0. collection->RemoveAt( 0 );
// Creates an empty CodeStatementCollection. CodeStatementCollection collection = new CodeStatementCollection(); // Adds a CodeStatement to the collection. collection.Add( new CodeCommentStatement("Test comment statement") ); // Adds an array of CodeStatement objects to the collection. CodeStatement[] statements = { new CodeCommentStatement("Test comment statement"), new CodeCommentStatement("Test comment statement")}; collection.AddRange( statements ); // Adds a collection of CodeStatement objects to the collection. CodeStatement testStatement = new CodeCommentStatement("Test comment statement"); CodeStatementCollection statementsCollection = new CodeStatementCollection(); statementsCollection.Add( new CodeCommentStatement("Test comment statement") ); statementsCollection.Add( new CodeCommentStatement("Test comment statement") ); statementsCollection.Add( testStatement ); collection.AddRange( statementsCollection ); // Tests for the presence of a CodeStatement in the // collection, and retrieves its index if it is found. int itemIndex = -1; if( collection.Contains( testStatement ) ) itemIndex = collection.IndexOf( testStatement ); // Copies the contents of the collection beginning at index 0 to the specified CodeStatement array. // 'statements' is a CodeStatement array. CodeStatement[] statementArray = new CodeStatement[collection.get_Count()]; collection.CopyTo( statementArray, 0 ); // Retrieves the count of the items in the collection. int collectionCount = collection.get_Count(); // Inserts a CodeStatement at index 0 of the collection. collection.Insert( 0, new CodeCommentStatement("Test comment statement") ); // Removes the specified CodeStatement from the collection. collection.Remove( testStatement ); // Removes the CodeStatement at index 0. collection.RemoveAt(0);

System.Collections.CollectionBase
System.CodeDom.CodeStatementCollection


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeStatementCollection コンストラクタ ()
アセンブリ: System (system.dll 内)


' Creates an empty CodeStatementCollection. Dim collection As New CodeStatementCollection
// Creates an empty CodeStatementCollection. CodeStatementCollection collection = new CodeStatementCollection();
// Creates an empty CodeStatementCollection. CodeStatementCollection^ collection = gcnew CodeStatementCollection;
// Creates an empty CodeStatementCollection. CodeStatementCollection collection = new CodeStatementCollection();

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeStatementCollection コンストラクタ (CodeStatementCollection)
アセンブリ: System (system.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeStatementCollection コンストラクタ (CodeStatement[])
アセンブリ: System (system.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CodeStatementCollection コンストラクタ

名前 | 説明 |
---|---|
CodeStatementCollection () | CodeStatementCollection クラスの新しいインスタンスを初期化します。 |
CodeStatementCollection (CodeStatement[]) | CodeStatement オブジェクトの指定した配列を格納する CodeStatementCollection クラスの新しいインスタンスを初期化します。 |
CodeStatementCollection (CodeStatementCollection) | 指定したソース コレクションの要素を格納する CodeStatementCollection クラスの新しいインスタンスを初期化します。 |

CodeStatementCollection プロパティ

名前 | 説明 | |
---|---|---|
![]() | Capacity | CollectionBase に格納できる要素の数を取得または設定します。 ( CollectionBase から継承されます。) |
![]() | Count | CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。 ( CollectionBase から継承されます。) |
![]() | Item | コレクション内の指定したインデックスでの CodeStatement を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | InnerList | CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。 ( CollectionBase から継承されます。) |
![]() | List | CollectionBase インスタンス内の要素のリストを格納する IList を取得します。 ( CollectionBase から継承されます。) |

CodeStatementCollection メソッド


名前 | 説明 | |
---|---|---|
![]() | 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 から継承されます。) |

CodeStatementCollection メンバ
CodeStatement オブジェクトのコレクションを表します。
CodeStatementCollection データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Capacity | CollectionBase に格納できる要素の数を取得または設定します。(CollectionBase から継承されます。) |
![]() | Count | CollectionBase インスタンスに格納されている要素の数を取得します。このプロパティはオーバーライドできません。(CollectionBase から継承されます。) |
![]() | Item | コレクション内の指定したインデックスでの CodeStatement を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | InnerList | CollectionBase インスタンス内の要素のリストを格納する ArrayList を取得します。(CollectionBase から継承されます。) |
![]() | List | CollectionBase インスタンス内の要素のリストを格納する IList を取得します。(CollectionBase から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | 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 から継承されます。) |

- CodeStatementCollectionのページへのリンク