CodeAttributeDeclarationCollection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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 示します。
// 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) |
メソッド
明示的なインターフェイスの実装
拡張メソッド
Cast<TResult>(IEnumerable) |
IEnumerable の要素を、指定した型にキャストします。 |
OfType<TResult>(IEnumerable) |
指定された型に基づいて IEnumerable の要素をフィルター処理します。 |
AsParallel(IEnumerable) |
クエリの並列化を有効にします。 |
AsQueryable(IEnumerable) |
IEnumerable を IQueryable に変換します。 |
適用対象
こちらもご覧ください
.NET