CodeAttributeArgumentCollection Clase

Definición

Representa una colección de CodeAttributeArgument objetos.

public ref 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
[<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 = 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 CodeAttributeArgumentCollection clase proporciona un objeto de colección simple que se puede usar para almacenar un conjunto de CodeAttributeArgument objetos.

Constructores

Nombre Description
CodeAttributeArgumentCollection()

Inicializa una nueva instancia de la clase CodeAttributeArgumentCollection.

CodeAttributeArgumentCollection(CodeAttributeArgument[])

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

CodeAttributeArgumentCollection(CodeAttributeArgumentCollection)

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

Propiedades

Nombre Description
Capacity

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

(Heredado de CollectionBase)
Count

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

(Heredado de CollectionBase)
InnerList

Obtiene un ArrayList objeto que contiene la lista de elementos de la CollectionBase instancia de .

(Heredado de CollectionBase)
Item[Int32]

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

List

Obtiene un IList objeto que contiene la lista de elementos de la CollectionBase instancia de .

(Heredado de CollectionBase)

Métodos

Nombre Description
Add(CodeAttributeArgument)

Agrega el objeto especificado CodeAttributeArgument a la colección.

AddRange(CodeAttributeArgument[])

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

AddRange(CodeAttributeArgumentCollection)

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

Clear()

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

(Heredado de CollectionBase)
Contains(CodeAttributeArgument)

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

CopyTo(CodeAttributeArgument[], Int32)

Copia los objetos de colección en una instancia unidimensional Array que comienza en el índice especificado.

Equals(Object)

Determina si el objeto especificado es igual al objeto actual.

(Heredado de Object)
GetEnumerator()

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

(Heredado de CollectionBase)
GetHashCode()

Actúa 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 especificado CodeAttributeArgument en la colección, si existe en la colección.

Insert(Int32, CodeAttributeArgument)

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

MemberwiseClone()

Crea una copia superficial del Objectactual.

(Heredado de Object)
OnClear()

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

(Heredado de CollectionBase)
OnClearComplete()

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

(Heredado de CollectionBase)
OnInsert(Int32, Object)

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

(Heredado de CollectionBase)
OnInsertComplete(Int32, Object)

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

(Heredado de CollectionBase)
OnRemove(Int32, Object)

Realiza procesos personalizados adicionales al quitar un elemento de la CollectionBase instancia.

(Heredado de CollectionBase)
OnRemoveComplete(Int32, Object)

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

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

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

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

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

(Heredado de CollectionBase)
OnValidate(Object)

Realiza procesos personalizados adicionales al validar un valor.

(Heredado de CollectionBase)
Remove(CodeAttributeArgument)

Quita el objeto especificado CodeAttributeArgument de la colección.

RemoveAt(Int32)

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

(Heredado de CollectionBase)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Implementaciones de interfaz explícitas

Nombre Description
ICollection.CopyTo(Array, Int32)

Copia todo en CollectionBase una unidimensional Arraycompatible, empezando por el índice especificado de la matriz de destino.

(Heredado de CollectionBase)
ICollection.IsSynchronized

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

(Heredado de CollectionBase)
ICollection.SyncRoot

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

(Heredado de CollectionBase)
IList.Add(Object)

Agrega un objeto al final de .CollectionBase

(Heredado de CollectionBase)
IList.Contains(Object)

Determina si contiene CollectionBase un elemento específico.

(Heredado de CollectionBase)
IList.IndexOf(Object)

Busca el especificado Object y devuelve el índice de base cero de la primera aparición dentro de todo CollectionBase.

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

Inserta un elemento en en el CollectionBase índice especificado.

(Heredado de CollectionBase)
IList.IsFixedSize

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

(Heredado de CollectionBase)
IList.IsReadOnly

Obtiene un valor que indica si el 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 .CollectionBase

(Heredado de CollectionBase)

Métodos de extensión

Nombre Description
AsParallel(IEnumerable)

Habilita la paralelización de una consulta.

AsQueryable(IEnumerable)

Convierte un IEnumerable en un IQueryable.

Cast<TResult>(IEnumerable)

Convierte los elementos de un IEnumerable al tipo especificado.

OfType<TResult>(IEnumerable)

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

Se aplica a

Consulte también