CodeAttributeArgumentCollection Clase

Definición

Representa una colección de objetos CodeAttributeArgument.

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
Herencia
CodeAttributeArgumentCollection
Atributos

Ejemplos

En el ejemplo siguiente se muestra el uso de los CodeAttributeArgumentCollection métodos de clase . En el ejemplo se crea una nueva instancia de la clase y se usan los métodos para agregar instrucciones a la colección, devolver su índice y agregar o quitar atributos en un punto de índice específico.

// 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)

Comentarios

La clase CodeAttributeArgumentCollection proporciona un objeto de colección simple que se puede utilizar para almacenar un conjunto de objetos CodeAttributeArgument.

Constructores

CodeAttributeArgumentCollection()

Inicializa una nueva instancia de la clase CodeAttributeArgumentCollection.

CodeAttributeArgumentCollection(CodeAttributeArgument[])

Inicializa una nueva instancia de la clase CodeAttributeArgumentCollection que contiene la matriz especificada de objetos CodeAttributeArgument.

CodeAttributeArgumentCollection(CodeAttributeArgumentCollection)

Inicializa una nueva instancia de la clase CodeAttributeArgumentCollection que contiene los elementos de la colección de origen especificada.

Propiedades

Capacity

Obtiene o establece el número de elementos que puede contener CollectionBase.

(Heredado de CollectionBase)
Count

Obtiene el número de elementos contenidos en la instancia de CollectionBase. Esta propiedad no se puede invalidar.

(Heredado de CollectionBase)
InnerList

Obtiene una colección ArrayList que contiene la lista de elementos incluidos en la instancia de CollectionBase.

(Heredado de CollectionBase)
Item[Int32]

Obtiene o establece el objeto CodeAttributeArgument en el índice especificado de la colección.

List

Obtiene una colección IList que contiene la lista de elementos incluidos en la instancia de CollectionBase.

(Heredado de CollectionBase)

Métodos

Add(CodeAttributeArgument)

Agrega a la colección el objeto CodeAttributeArgument especificado.

AddRange(CodeAttributeArgument[])

Copia los elementos de la matriz CodeAttributeArgument especificada al final de la colección.

AddRange(CodeAttributeArgumentCollection)

Copia el contenido de otro objeto CodeAttributeArgumentCollection al final de la colección.

Clear()

Elimina todos los objetos de la instancia de CollectionBase. Este método no se puede invalidar.

(Heredado de CollectionBase)
Contains(CodeAttributeArgument)

Obtiene un valor que indica si la colección contiene el objeto CodeAttributeArgument especificado.

CopyTo(CodeAttributeArgument[], Int32)

Copia los objetos de colección en una instancia Array unidimensional, comenzando a partir del índice especificado.

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetEnumerator()

Devuelve un enumerador que recorre en iteración la instancia de CollectionBase.

(Heredado de CollectionBase)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
IndexOf(CodeAttributeArgument)

Obtiene el índice del objeto CodeAttributeArgument especificado en la colección, si existe en la colección.

Insert(Int32, CodeAttributeArgument)

Inserta el objeto CodeAttributeArgument especificado en el índice especificado de la colección.

MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
OnClear()

Realiza procesos personalizados adicionales al borrar el contenido de la instancia CollectionBase.

(Heredado de CollectionBase)
OnClearComplete()

Realiza procesos personalizados adicionales después de borrar el contenido de la instancia de CollectionBase.

(Heredado de CollectionBase)
OnInsert(Int32, Object)

Realiza procesos personalizados adicionales antes de insertar un nuevo elemento en la instancia de CollectionBase.

(Heredado de CollectionBase)
OnInsertComplete(Int32, Object)

Realiza procesos personalizados adicionales después de insertar un nuevo elemento en la instancia de CollectionBase.

(Heredado de CollectionBase)
OnRemove(Int32, Object)

Realiza procesos de personalización adicionales al quitar un elemento de la instancia de CollectionBase.

(Heredado de CollectionBase)
OnRemoveComplete(Int32, Object)

Realiza procesos personalizados adicionales después de quitar un elemento de la instancia de CollectionBase.

(Heredado de CollectionBase)
OnSet(Int32, Object, Object)

Realiza procesos personalizados adicionales antes de establecer un valor en la instancia de CollectionBase.

(Heredado de CollectionBase)
OnSetComplete(Int32, Object, Object)

Realiza procesos personalizados adicionales después de establecer un valor en la instancia de CollectionBase.

(Heredado de CollectionBase)
OnValidate(Object)

Realiza procesos de personalización adicionales al validar un valor.

(Heredado de CollectionBase)
Remove(CodeAttributeArgument)

Quita el objeto CodeAttributeArgument especificado de la colección.

RemoveAt(Int32)

Quita el elemento que se encuentra en el índice especificado de la instancia de CollectionBase. Este método no se puede reemplazar.

(Heredado de CollectionBase)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Implementaciones de interfaz explícitas

ICollection.CopyTo(Array, Int32)

Copia la totalidad de CollectionBase en una matriz Array unidimensional compatible, comenzando en el índice especificado de la matriz de destino.

(Heredado de CollectionBase)
ICollection.IsSynchronized

Obtiene un valor que indica si el acceso a la interfaz CollectionBase está sincronizado (es seguro para subprocesos).

(Heredado de CollectionBase)
ICollection.SyncRoot

Obtiene un objeto que se puede usar para sincronizar el acceso a CollectionBase.

(Heredado de CollectionBase)
IList.Add(Object)

Agrega un objeto al final de CollectionBase.

(Heredado de CollectionBase)
IList.Contains(Object)

Determina si CollectionBase contiene un elemento específico.

(Heredado de CollectionBase)
IList.IndexOf(Object)

Busca el objeto Object especificado y devuelve el índice de base cero de la primera aparición en toda la colección CollectionBase.

(Heredado de CollectionBase)
IList.Insert(Int32, Object)

Inserta un elemento en CollectionBase en el índice especificado.

(Heredado de CollectionBase)
IList.IsFixedSize

Obtiene un valor que indica si la interfaz CollectionBase tiene un tamaño fijo.

(Heredado de CollectionBase)
IList.IsReadOnly

Obtiene un valor que indica si CollectionBase es de solo lectura.

(Heredado de CollectionBase)
IList.Item[Int32]

Obtiene o establece el elemento en el índice especificado.

(Heredado de CollectionBase)
IList.Remove(Object)

Quita la primera aparición de un objeto específico de la interfaz CollectionBase.

(Heredado de CollectionBase)

Métodos de extensión

Cast<TResult>(IEnumerable)

Convierte los elementos de IEnumerable en el tipo especificado.

OfType<TResult>(IEnumerable)

Filtra los elementos de IEnumerable en función de un tipo especificado.

AsParallel(IEnumerable)

Habilita la paralelización de una consulta.

AsQueryable(IEnumerable)

Convierte una interfaz IEnumerable en IQueryable.

Se aplica a

Consulte también