CodeAttributeDeclarationCollection クラス

定義

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

public ref class CodeAttributeDeclarationCollection : System::Collections::CollectionBase
public class CodeAttributeDeclarationCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAttributeDeclarationCollection : System.Collections.CollectionBase
type CodeAttributeDeclarationCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAttributeDeclarationCollection = class
    inherit CollectionBase
Public Class CodeAttributeDeclarationCollection
Inherits CollectionBase
継承
CodeAttributeDeclarationCollection
属性

次の例では、クラス メソッドの使用を CodeAttributeDeclarationCollection 示します。

// Creates an empty CodeAttributeDeclarationCollection.
CodeAttributeDeclarationCollection^ collection = gcnew CodeAttributeDeclarationCollection;

// Adds a CodeAttributeDeclaration to the collection.
array<CodeAttributeArgument^>^temp = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
collection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp ) );

// Adds an array of CodeAttributeDeclaration objects 
// to the collection.
array<CodeAttributeDeclaration^>^declarations = {gcnew CodeAttributeDeclaration,gcnew CodeAttributeDeclaration};
collection->AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects 
// to the collection.
CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
array<CodeAttributeArgument^>^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
array<CodeAttributeArgument^>^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
collection->AddRange( declarationsCollection );

// Tests for the presence of a CodeAttributeDeclaration in 
// the collection, and retrieves its index if it is found.
array<CodeAttributeArgument^>^temp3 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
CodeAttributeDeclaration^ testdeclaration = gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp3 );
int itemIndex = -1;
if ( collection->Contains( testdeclaration ) )
   itemIndex = collection->IndexOf( testdeclaration );

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

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

// Inserts a CodeAttributeDeclaration at index 0 of the collection.
array<CodeAttributeArgument^>^temp4 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
collection->Insert( 0, gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp4 ) );

// Removes the specified CodeAttributeDeclaration from 
// the collection.
array<CodeAttributeArgument^>^temp5 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
CodeAttributeDeclaration^ declaration = gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp5 );
collection->Remove( declaration );

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

// Adds a CodeAttributeDeclaration to the collection.
collection.Add( new CodeAttributeDeclaration("DescriptionAttribute",  new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );

// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );

// Tests for the presence of a CodeAttributeDeclaration in
// the collection, and retrieves its index if it is found.
CodeAttributeDeclaration testdeclaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
int itemIndex = -1;
if( collection.Contains( testdeclaration ) )
    itemIndex = collection.IndexOf( testdeclaration );

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

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

// Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );

// Removes the specified CodeAttributeDeclaration from
// the collection.
CodeAttributeDeclaration declaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
collection.Remove( declaration );

// Removes the CodeAttributeDeclaration at index 0.
collection.RemoveAt(0);
' Creates an empty CodeAttributeDeclarationCollection.
Dim collection As New CodeAttributeDeclarationCollection()

' Adds a CodeAttributeDeclaration to the collection.
collection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))

' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

' Tests for the presence of a CodeAttributeDeclaration in the 
' collection, and retrieves its index if it is found.
Dim testdeclaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
Dim itemIndex As Integer = -1
If collection.Contains(testdeclaration) Then
    itemIndex = collection.IndexOf(testdeclaration)
End If

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

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

' Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))

' Removes the specified CodeAttributeDeclaration from the collection.
Dim declaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
collection.Remove(declaration)

' Removes the CodeAttributeDeclaration at index 0.
collection.RemoveAt(0)

注釈

CodeAttributeDeclarationCollection クラスには、一連の CodeAttributeDeclaration オブジェクトの格納に使用できる単純なコレクション オブジェクトが用意されています。

コンストラクター

CodeAttributeDeclarationCollection()

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

CodeAttributeDeclarationCollection(CodeAttributeDeclaration[])

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

CodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection)

指定したソース コレクションの要素を格納する CodeAttributeDeclarationCollection クラスの新しいインスタンスを初期化します。

プロパティ

Capacity

CollectionBase に格納できる要素の数を取得または設定します。

(継承元 CollectionBase)
Count

CollectionBase インスタンスに含まれる要素の数を取得します。 このプロパティはオーバーライドできません。

(継承元 CollectionBase)
InnerList

ArrayList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)
Item[Int32]

指定したインデックスの位置にある CodeAttributeDeclaration オブジェクトを取得または設定します。

List

IList インスタンス内の要素のリストを格納する CollectionBase を取得します。

(継承元 CollectionBase)

メソッド

Add(CodeAttributeDeclaration)

指定した値で、CodeAttributeDeclaration オブジェクトをコレクションに追加します。

AddRange(CodeAttributeDeclaration[])

指定した CodeAttributeDeclaration 配列の要素をコレクションの末尾にコピーします。

AddRange(CodeAttributeDeclarationCollection)

別の CodeAttributeDeclarationCollection オブジェクトの内容をコレクションの末尾にコピーします。

Clear()

CollectionBase インスタンスからすべてのオブジェクトを削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
Contains(CodeAttributeDeclaration)

指定した CodeAttributeDeclaration オブジェクトがコレクションに含まれているかどうかを示す値を取得または設定します。

CopyTo(CodeAttributeDeclaration[], Int32)

指定したインデックスをコピー開始位置として、1 次元の Array インスタンスにコレクション オブジェクトをコピーします。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

CollectionBase インスタンスを反復処理する列挙子を返します。

(継承元 CollectionBase)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(CodeAttributeDeclaration)

指定した CodeAttributeDeclaration オブジェクトがコレクション内に存在する場合は、コレクション内でのそのインデックスを取得します。

Insert(Int32, CodeAttributeDeclaration)

このコレクション内の指定したインデックス位置に、指定した CodeAttributeDeclaration オブジェクトを挿入します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
OnClear()

CollectionBase インスタンスの内容を消去しているときに、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnClearComplete()

CollectionBase インスタンスの内容を消去した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsert(Int32, Object)

CollectionBase インスタンスに新しい要素を挿入する前に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnInsertComplete(Int32, Object)

CollectionBase インスタンスに新しい要素を挿入した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnRemove(Int32, Object)

CollectionBase インスタンスから要素を削除するときに、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnRemoveComplete(Int32, Object)

CollectionBase インスタンスから要素を削除した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnSet(Int32, Object, Object)

CollectionBase インスタンスに値を設定する前に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnSetComplete(Int32, Object, Object)

CollectionBase インスタンスに値を設定した後に、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
OnValidate(Object)

値を検証するときに、追加のカスタム プロセスを実行します。

(継承元 CollectionBase)
Remove(CodeAttributeDeclaration)

指定した CodeAttributeDeclaration オブジェクトをコレクションから削除します。

RemoveAt(Int32)

CollectionBase インスタンスの指定したインデックスにある要素を削除します。 このメソッドはオーバーライドできません。

(継承元 CollectionBase)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

CollectionBase 全体を互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まります。

(継承元 CollectionBase)
ICollection.IsSynchronized

CollectionBase へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。

(継承元 CollectionBase)
ICollection.SyncRoot

CollectionBase へのアクセスを同期するために使用できるオブジェクトを取得します。

(継承元 CollectionBase)
IList.Add(Object)

CollectionBase の末尾にオブジェクトを追加します。

(継承元 CollectionBase)
IList.Contains(Object)

CollectionBase に特定の要素が格納されているかどうかを判断します。

(継承元 CollectionBase)
IList.IndexOf(Object)

指定した Object を検索し、CollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックスを返します。

(継承元 CollectionBase)
IList.Insert(Int32, Object)

CollectionBase 内の指定したインデックスの位置に要素を挿入します。

(継承元 CollectionBase)
IList.IsFixedSize

CollectionBase が固定サイズかどうかを示す値を取得します。

(継承元 CollectionBase)
IList.IsReadOnly

CollectionBase が読み取り専用かどうかを示す値を取得します。

(継承元 CollectionBase)
IList.Item[Int32]

指定したインデックスにある要素を取得または設定します。

(継承元 CollectionBase)
IList.Remove(Object)

特定のオブジェクトが CollectionBase 内にあるときに、最初に出現したものを削除します。

(継承元 CollectionBase)

拡張メソッド

Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。

OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。

AsParallel(IEnumerable)

クエリの並列化を有効にします。

AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。

適用対象

こちらもご覧ください