CodeCatchClauseCollection クラス
定義
CodeCatchClause オブジェクトのコレクションを表します。Represents a collection of CodeCatchClause objects.
public ref class CodeCatchClauseCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeCatchClauseCollection : System.Collections.CollectionBase
type CodeCatchClauseCollection = class
inherit CollectionBase
Public Class CodeCatchClauseCollection
Inherits CollectionBase
- 継承
- 属性
例
CodeCatchClauseCollectionクラスのメソッドの使用例を次に示します。The following example demonstrates the use of the CodeCatchClauseCollection class methods. この例では、クラスの新しいインスタンスを作成し、メソッドを使用して、ステートメントをコレクションに追加し、インデックスを返し、特定のインデックスポイントで属性を追加または削除します。The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
// Creates an empty CodeCatchClauseCollection.
CodeCatchClauseCollection^ collection = gcnew CodeCatchClauseCollection;
// Adds a CodeCatchClause to the collection.
collection->Add( gcnew CodeCatchClause( "e" ) );
// Adds an array of CodeCatchClause objects to the collection.
array<CodeCatchClause^>^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause};
collection->AddRange( clauses );
// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection;
clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) );
clausesCollection->Add( gcnew CodeCatchClause( "e" ) );
collection->AddRange( clausesCollection );
// Tests for the presence of a CodeCatchClause in the
// collection, and retrieves its index if it is found.
CodeCatchClause^ testClause = gcnew CodeCatchClause( "e" );
int itemIndex = -1;
if ( collection->Contains( testClause ) )
itemIndex = collection->IndexOf( testClause );
// Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
// 'clauses' is a CodeCatchClause array.
collection->CopyTo( clauses, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Inserts a CodeCatchClause at index 0 of the collection.
collection->Insert( 0, gcnew CodeCatchClause( "e" ) );
// Removes the specified CodeCatchClause from the collection.
CodeCatchClause^ clause = gcnew CodeCatchClause( "e" );
collection->Remove( clause );
// Removes the CodeCatchClause at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeCatchClauseCollection.
CodeCatchClauseCollection collection = new CodeCatchClauseCollection();
// Adds a CodeCatchClause to the collection.
collection.Add( new CodeCatchClause("e") );
// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );
// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );
// Tests for the presence of a CodeCatchClause in the
// collection, and retrieves its index if it is found.
CodeCatchClause testClause = new CodeCatchClause("e");
int itemIndex = -1;
if( collection.Contains( testClause ) )
itemIndex = collection.IndexOf( testClause );
// Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
// 'clauses' is a CodeCatchClause array.
collection.CopyTo( clauses, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeCatchClause at index 0 of the collection.
collection.Insert( 0, new CodeCatchClause("e") );
// Removes the specified CodeCatchClause from the collection.
CodeCatchClause clause = new CodeCatchClause("e");
collection.Remove( clause );
// Removes the CodeCatchClause at index 0.
collection.RemoveAt(0);
' Creates an empty CodeCatchClauseCollection.
Dim collection As New CodeCatchClauseCollection()
' Adds a CodeCatchClause to the collection.
collection.Add(New CodeCatchClause("e"))
' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)
' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)
' Tests for the presence of a CodeCatchClause in the
' collection, and retrieves its index if it is found.
Dim testClause As New CodeCatchClause("e")
Dim itemIndex As Integer = -1
If collection.Contains(testClause) Then
itemIndex = collection.IndexOf(testClause)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
' 'clauses' is a CodeCatchClause array.
collection.CopyTo(clauses, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeCatchClause at index 0 of the collection.
collection.Insert(0, New CodeCatchClause("e"))
' Removes the specified CodeCatchClause from the collection.
Dim clause As New CodeCatchClause("e")
collection.Remove(clause)
' Removes the CodeCatchClause at index 0.
collection.RemoveAt(0)
注釈
CodeCatchClauseCollection クラスには、一連の CodeCatchClause オブジェクトの格納に使用できる単純なコレクション オブジェクトが用意されています。The CodeCatchClauseCollection class provides a simple collection object that can be used to store a set of CodeCatchClause objects.
コンストラクター
CodeCatchClauseCollection() |
CodeCatchClauseCollection クラスの新しいインスタンスを初期化します。Initializes a new instance of the CodeCatchClauseCollection class. |
CodeCatchClauseCollection(CodeCatchClause[]) |
CodeCatchClauseCollection オブジェクトの指定した配列を格納する CodeCatchClause クラスの新しいインスタンスを初期化します。Initializes a new instance of the CodeCatchClauseCollection class containing the specified array of CodeCatchClause objects. |
CodeCatchClauseCollection(CodeCatchClauseCollection) |
指定したソース コレクションの要素を格納する CodeCatchClauseCollection クラスの新しいインスタンスを初期化します。Initializes a new instance of the CodeCatchClauseCollection class containing the elements of the specified source collection. |
プロパティ
Capacity |
CollectionBase に格納できる要素の数を取得または設定します。Gets or sets the number of elements that the CollectionBase can contain. (継承元 CollectionBase) |
Count |
CollectionBase インスタンスに格納されている要素の数を取得します。Gets the number of elements contained in the CollectionBase instance. このプロパティはオーバーライドできません。This property cannot be overridden. (継承元 CollectionBase) |
InnerList |
ArrayList インスタンス内の要素のリストを格納する CollectionBase を取得します。Gets an ArrayList containing the list of elements in the CollectionBase instance. (継承元 CollectionBase) |
Item[Int32] |
コレクション内の指定したインデックスでの CodeCatchClause オブジェクトを取得または設定します。Gets or sets the CodeCatchClause object at the specified index in the collection. |
List |
IList インスタンス内の要素のリストを格納する CollectionBase を取得します。Gets an IList containing the list of elements in the CollectionBase instance. (継承元 CollectionBase) |
メソッド
Add(CodeCatchClause) |
指定した CodeCatchClause オブジェクトをコレクションに追加します。Adds the specified CodeCatchClause object to the collection. |
AddRange(CodeCatchClause[]) |
指定した CodeCatchClause 配列の要素をコレクションの末尾にコピーします。Copies the elements of the specified CodeCatchClause array to the end of the collection. |
AddRange(CodeCatchClauseCollection) |
別の CodeCatchClauseCollection オブジェクトの内容をコレクションの末尾にコピーします。Copies the contents of another CodeCatchClauseCollection object to the end of the collection. |
Clear() |
CollectionBase インスタンスからすべてのオブジェクトを削除します。Removes all objects from the CollectionBase instance. このメソッドはオーバーライドできません。This method cannot be overridden. (継承元 CollectionBase) |
Contains(CodeCatchClause) |
指定した CodeCatchClause オブジェクトがコレクションに含まれているかどうかを示す値を取得します。Gets a value that indicates whether the collection contains the specified CodeCatchClause object. |
CopyTo(CodeCatchClause[], Int32) |
指定したインデックスをコピー開始位置として、1 次元の Array インスタンスにコレクション オブジェクトをコピーします。Copies the collection objects to a one-dimensional Array instance beginning at the specified index. |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判定します。Determines whether the specified object is equal to the current object. (継承元 Object) |
GetEnumerator() |
CollectionBase インスタンスを反復処理する列挙子を返します。Returns an enumerator that iterates through the CollectionBase instance. (継承元 CollectionBase) |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
IndexOf(CodeCatchClause) |
指定した CodeCatchClause オブジェクトがコレクション内に存在する場合は、コレクション内でのそのインデックスを取得します。Gets the index of the specified CodeCatchClause object in the collection, if it exists in the collection. |
Insert(Int32, CodeCatchClause) |
このコレクション内の指定したインデックス位置に、指定した CodeCatchClause オブジェクトを挿入します。Inserts the specified CodeCatchClause object into the collection at the specified index. |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
OnClear() |
CollectionBase インスタンスの内容を消去しているときに、追加のカスタム プロセスを実行します。Performs additional custom processes when clearing the contents of the CollectionBase instance. (継承元 CollectionBase) |
OnClearComplete() |
CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after clearing the contents of the CollectionBase instance. (継承元 CollectionBase) |
OnInsert(Int32, Object) |
CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。Performs additional custom processes before inserting a new element into the CollectionBase instance. (継承元 CollectionBase) |
OnInsertComplete(Int32, Object) |
CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after inserting a new element into the CollectionBase instance. (継承元 CollectionBase) |
OnRemove(Int32, Object) |
CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。Performs additional custom processes when removing an element from the CollectionBase instance. (継承元 CollectionBase) |
OnRemoveComplete(Int32, Object) |
CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after removing an element from the CollectionBase instance. (継承元 CollectionBase) |
OnSet(Int32, Object, Object) |
CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。Performs additional custom processes before setting a value in the CollectionBase instance. (継承元 CollectionBase) |
OnSetComplete(Int32, Object, Object) |
CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。Performs additional custom processes after setting a value in the CollectionBase instance. (継承元 CollectionBase) |
OnValidate(Object) |
値を検証するときに、追加のカスタム プロセスを実行します。Performs additional custom processes when validating a value. (継承元 CollectionBase) |
Remove(CodeCatchClause) |
指定した CodeCatchClause オブジェクトをコレクションから削除します。Removes the specified CodeCatchClause object from the collection. |
RemoveAt(Int32) |
CollectionBase インスタンスの指定したインデックスにある要素を削除します。Removes the element at the specified index of the CollectionBase instance. このメソッドはオーバーライドできません。This method is not overridable. (継承元 CollectionBase) |
ToString() |
現在のオブジェクトを表す string を返します。Returns a string that represents the current object. (継承元 Object) |
明示的なインターフェイスの実装
ICollection.CopyTo(Array, Int32) |
CollectionBase 全体を、互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まる部分に行います。Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (継承元 CollectionBase) |
ICollection.IsSynchronized |
CollectionBase へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。Gets a value indicating whether access to the CollectionBase is synchronized (thread safe). (継承元 CollectionBase) |
ICollection.SyncRoot |
CollectionBase へのアクセスを同期するために使用できるオブジェクトを取得します。Gets an object that can be used to synchronize access to the CollectionBase. (継承元 CollectionBase) |
IList.Add(Object) |
CollectionBase の末尾にオブジェクトを追加します。Adds an object to the end of the CollectionBase. (継承元 CollectionBase) |
IList.Contains(Object) |
CollectionBase に特定の要素が格納されているかどうかを判断します。Determines whether the CollectionBase contains a specific element. (継承元 CollectionBase) |
IList.IndexOf(Object) |
指定した Object を検索し、CollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックスを返します。Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase. (継承元 CollectionBase) |
IList.Insert(Int32, Object) |
CollectionBase 内の指定したインデックスの位置に要素を挿入します。Inserts an element into the CollectionBase at the specified index. (継承元 CollectionBase) |
IList.IsFixedSize |
CollectionBase が固定サイズかどうかを示す値を取得します。Gets a value indicating whether the CollectionBase has a fixed size. (継承元 CollectionBase) |
IList.IsReadOnly |
CollectionBase が読み取り専用かどうかを示す値を取得します。Gets a value indicating whether the CollectionBase is read-only. (継承元 CollectionBase) |
IList.Item[Int32] |
指定したインデックスにある要素を取得または設定します。Gets or sets the element at the specified index. (継承元 CollectionBase) |
IList.Remove(Object) |
特定のオブジェクトが CollectionBase 内にあるときに、最初に出現したものを削除します。Removes the first occurrence of a specific object from the CollectionBase. (継承元 CollectionBase) |
拡張メソッド
Cast<TResult>(IEnumerable) |
IEnumerable の要素を、指定した型にキャストします。Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
指定された型に基づいて IEnumerable の要素をフィルター処理します。Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
クエリの並列化を有効にします。Enables parallelization of a query. |
AsQueryable(IEnumerable) |
IEnumerable を IQueryable に変換します。Converts an IEnumerable to an IQueryable. |