CodeAttributeArgumentCollection Třída

Definice

Představuje kolekci CodeAttributeArgument objektů.

public ref class CodeAttributeArgumentCollection : System::Collections::CollectionBase
public class CodeAttributeArgumentCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAttributeArgumentCollection : System.Collections.CollectionBase
type CodeAttributeArgumentCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAttributeArgumentCollection = class
    inherit CollectionBase
Public Class CodeAttributeArgumentCollection
Inherits CollectionBase
Dědičnost
CodeAttributeArgumentCollection
Atributy

Příklady

Následující příklad ukazuje použití CodeAttributeArgumentCollection metod třídy. Příklad vytvoří novou instanci třídy a použije metody k přidání příkazů do kolekce, vrácení jejich indexu a přidání nebo odebrání atributů v určitém bodu indexu.

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

// Adds a CodeAttributeArgument to the collection.
collection->Add( gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );

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

// Adds a collection of CodeAttributeArgument objects to 
// the collection.
CodeAttributeArgumentCollection^ argumentsCollection = gcnew CodeAttributeArgumentCollection;
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestBooleanArgument",gcnew CodePrimitiveExpression( true ) ) );
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestIntArgument",gcnew CodePrimitiveExpression( 1 ) ) );
collection->AddRange( argumentsCollection );

// Tests for the presence of a CodeAttributeArgument 
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument^ testArgument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
int itemIndex = -1;
if ( collection->Contains( testArgument ) )
   itemIndex = collection->IndexOf( testArgument );

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

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

// Inserts a CodeAttributeArgument at index 0 of the collection.
collection->Insert( 0, gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );

// Removes the specified CodeAttributeArgument from the collection.
CodeAttributeArgument^ argument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
collection->Remove( argument );

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

// Adds a CodeAttributeArgument to the collection.
collection.Add( new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );

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

// Adds a collection of CodeAttributeArgument objects to
// the collection.
CodeAttributeArgumentCollection argumentsCollection = new CodeAttributeArgumentCollection();
argumentsCollection.Add( new CodeAttributeArgument("TestBooleanArgument", new CodePrimitiveExpression(true)) );
argumentsCollection.Add( new CodeAttributeArgument("TestIntArgument", new CodePrimitiveExpression(1)) );
collection.AddRange( argumentsCollection );

// Tests for the presence of a CodeAttributeArgument
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument testArgument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
int itemIndex = -1;
if( collection.Contains( testArgument ) )
    itemIndex = collection.IndexOf( testArgument );

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

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

// Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert( 0, new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );

// Removes the specified CodeAttributeArgument from the collection.
CodeAttributeArgument argument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
collection.Remove( argument );

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

' Adds a CodeAttributeArgument to the collection.
collection.Add(New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

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

' Adds a collection of CodeAttributeArgument objects to the collection.
Dim argumentsCollection As New CodeAttributeArgumentCollection()
argumentsCollection.Add(New CodeAttributeArgument("TestBooleanArgument", New CodePrimitiveExpression(True)))
argumentsCollection.Add(New CodeAttributeArgument("TestIntArgument", New CodePrimitiveExpression(1)))
collection.AddRange(argumentsCollection)

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

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

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

' Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert(0, New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

' Removes the specified CodeAttributeArgument from the collection.
Dim argument As New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True))
collection.Remove(argument)

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

Poznámky

Třída CodeAttributeArgumentCollection poskytuje jednoduchý objekt kolekce, který lze použít k uložení sady CodeAttributeArgument objektů.

Konstruktory

CodeAttributeArgumentCollection()

Inicializuje novou instanci CodeAttributeArgumentCollection třídy .

CodeAttributeArgumentCollection(CodeAttributeArgument[])

Inicializuje novou instanci CodeAttributeArgumentCollection třídy obsahující zadané pole CodeAttributeArgument objektů.

CodeAttributeArgumentCollection(CodeAttributeArgumentCollection)

Inicializuje novou instanci CodeAttributeArgumentCollection třídy obsahující prvky zadané kolekce zdrojů.

Vlastnosti

Capacity

Získá nebo nastaví počet prvků, které CollectionBase mohou obsahovat.

(Zděděno od CollectionBase)
Count

Získá počet prvků obsažených CollectionBase v instanci. Tuto vlastnost nelze přepsat.

(Zděděno od CollectionBase)
InnerList

Získá obsahující ArrayList seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)
Item[Int32]

Získá nebo nastaví CodeAttributeArgument objekt v zadaném indexu v kolekci.

List

Získá obsahující IList seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)

Metody

Add(CodeAttributeArgument)

Přidá zadaný CodeAttributeArgument objekt do kolekce.

AddRange(CodeAttributeArgument[])

Zkopíruje prvky zadaného CodeAttributeArgument pole na konec kolekce.

AddRange(CodeAttributeArgumentCollection)

Zkopíruje obsah jiného CodeAttributeArgumentCollection objektu na konec kolekce.

Clear()

Odebere z instance všechny objekty CollectionBase . Tuto metodu nelze přepsat.

(Zděděno od CollectionBase)
Contains(CodeAttributeArgument)

Získá hodnotu, která označuje, zda kolekce obsahuje zadaný CodeAttributeArgument objekt.

CopyTo(CodeAttributeArgument[], Int32)

Zkopíruje objekty kolekce do jednorozměrné Array instance začínající na zadaném indexu.

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

(Zděděno od Object)
GetEnumerator()

Vrátí enumerátor, který iteruje prostřednictvím CollectionBase instance.

(Zděděno od CollectionBase)
GetHashCode()

Slouží jako výchozí hashovací funkce.

(Zděděno od Object)
GetType()

Type Získá z aktuální instance.

(Zděděno od Object)
IndexOf(CodeAttributeArgument)

Získá index zadaného CodeAttributeArgument objektu v kolekci, pokud existuje v kolekci.

Insert(Int32, CodeAttributeArgument)

Vloží zadaný CodeAttributeArgument objekt do kolekce v zadaném indexu.

MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
OnClear()

Provádí další vlastní procesy při vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnClearComplete()

Provádí další vlastní procesy po vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnInsert(Int32, Object)

Provádí další vlastní procesy před vložením nového prvku do CollectionBase instance.

(Zděděno od CollectionBase)
OnInsertComplete(Int32, Object)

Provádí další vlastní procesy po vložení nového prvku do CollectionBase instance.

(Zděděno od CollectionBase)
OnRemove(Int32, Object)

Provádí další vlastní procesy při odebírání prvku z CollectionBase instance.

(Zděděno od CollectionBase)
OnRemoveComplete(Int32, Object)

Provádí další vlastní procesy po odebrání prvku z CollectionBase instance.

(Zděděno od CollectionBase)
OnSet(Int32, Object, Object)

Před nastavením hodnoty v CollectionBase instanci provede další vlastní procesy.

(Zděděno od CollectionBase)
OnSetComplete(Int32, Object, Object)

Provádí další vlastní procesy po nastavení hodnoty v CollectionBase instanci.

(Zděděno od CollectionBase)
OnValidate(Object)

Provádí další vlastní procesy při ověřování hodnoty.

(Zděděno od CollectionBase)
Remove(CodeAttributeArgument)

Odebere zadaný CodeAttributeArgument objekt z kolekce.

RemoveAt(Int32)

Odebere prvek v zadaném indexu CollectionBase instance. Tuto metodu nelze přepisovat.

(Zděděno od CollectionBase)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

ICollection.CopyTo(Array, Int32)

Zkopíruje celek CollectionBase do kompatibilního jednorozměrného Arrayobjektu počínaje zadaným indexem cílového pole.

(Zděděno od CollectionBase)
ICollection.IsSynchronized

Získá hodnotu označující, zda přístup k objektu CollectionBase je synchronizován (bezpečný pro přístup z více vláken).

(Zděděno od CollectionBase)
ICollection.SyncRoot

Získá objekt, který lze použít k synchronizaci přístupu k .CollectionBase

(Zděděno od CollectionBase)
IList.Add(Object)

Přidá objekt na konec objektu CollectionBase.

(Zděděno od CollectionBase)
IList.Contains(Object)

Určuje, zda obsahuje CollectionBase určitý prvek.

(Zděděno od CollectionBase)
IList.IndexOf(Object)

Vyhledá zadaný Object a vrátí index od nuly prvního výskytu v rámci celého CollectionBaseobjektu .

(Zděděno od CollectionBase)
IList.Insert(Int32, Object)

Vloží prvek do objektu CollectionBase v zadaném indexu.

(Zděděno od CollectionBase)
IList.IsFixedSize

Získá hodnotu označující, zda CollectionBase má pevnou velikost.

(Zděděno od CollectionBase)
IList.IsReadOnly

Získá hodnotu, která určuje, zda je CollectionBase určena jen pro čtení.

(Zděděno od CollectionBase)
IList.Item[Int32]

Získá nebo nastaví prvek u zadaného indexu.

(Zděděno od CollectionBase)
IList.Remove(Object)

Odebere první výskyt konkrétního objektu z objektu CollectionBase.

(Zděděno od CollectionBase)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypuje prvky objektu na IEnumerable zadaný typ.

OfType<TResult>(IEnumerable)

Filtruje prvky objektu IEnumerable na základě zadaného typu.

AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede objekt na IEnumerableIQueryable.

Platí pro

Viz také