CodeCommentStatementCollection Clase
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Representa una colección de CodeCommentStatement objetos.
public ref class CodeCommentStatementCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeCommentStatementCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeCommentStatementCollection = class
inherit CollectionBase
Public Class CodeCommentStatementCollection
Inherits CollectionBase
- Herencia
- Atributos
Ejemplos
En el ejemplo siguiente se muestra el uso de los CodeCommentStatementCollection 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 CodeCommentStatementCollection.
CodeCommentStatementCollection collection = new CodeCommentStatementCollection();
// Adds a CodeCommentStatement to the collection.
collection.Add( new CodeCommentStatement("Test comment") );
// Adds an array of CodeCommentStatement objects to the collection.
CodeCommentStatement[] comments = { new CodeCommentStatement("Test comment"), new CodeCommentStatement("Another test comment") };
collection.AddRange( comments );
// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection commentsCollection = new CodeCommentStatementCollection();
commentsCollection.Add( new CodeCommentStatement("Test comment") );
commentsCollection.Add( new CodeCommentStatement("Another test comment") );
collection.AddRange( commentsCollection );
// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement testComment = new CodeCommentStatement("Test comment");
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeCommentStatement array.
// 'comments' is a CodeCommentStatement array.
collection.CopyTo( comments, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeCommentStatement at index 0 of the collection.
collection.Insert( 0, new CodeCommentStatement("Test comment") );
// Removes the specified CodeCommentStatement from the collection.
CodeCommentStatement comment = new CodeCommentStatement("Test comment");
collection.Remove( comment );
// Removes the CodeCommentStatement at index 0.
collection.RemoveAt(0);
' Creates an empty CodeCommentStatementCollection.
Dim collection As New CodeCommentStatementCollection()
' Adds a CodeCommentStatement to the collection.
collection.Add(New CodeCommentStatement("Test comment"))
' Adds an array of CodeCommentStatement objects to the collection.
Dim comments As CodeCommentStatement() = {New CodeCommentStatement("Test comment"), New CodeCommentStatement("Another test comment")}
collection.AddRange(comments)
' Adds a collection of CodeCommentStatement objects to the
' collection.
Dim commentsCollection As New CodeCommentStatementCollection()
commentsCollection.Add(New CodeCommentStatement("Test comment"))
commentsCollection.Add(New CodeCommentStatement("Another test comment"))
collection.AddRange(commentsCollection)
' Tests for the presence of a CodeCommentStatement in the
' collection, and retrieves its index if it is found.
Dim testComment As New CodeCommentStatement("Test comment")
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeCommentStatement array.
' 'comments' is a CodeCommentStatement array.
collection.CopyTo(comments, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeCommentStatement at index 0 of the collection.
collection.Insert(0, New CodeCommentStatement("Test comment"))
' Removes the specified CodeCommentStatement from the collection.
Dim comment As New CodeCommentStatement("Test comment")
collection.Remove(comment)
' Removes the CodeCommentStatement at index 0.
collection.RemoveAt(0)
Comentarios
La CodeCommentStatementCollection clase proporciona un objeto de colección simple que se puede usar para almacenar un conjunto de CodeCommentStatement objetos.
Constructores
| Nombre | Description |
|---|---|
| CodeCommentStatementCollection() |
Inicializa una nueva instancia de la clase CodeCommentStatementCollection. |
| CodeCommentStatementCollection(CodeCommentStatement[]) |
Inicializa una nueva instancia de la CodeCommentStatementCollection clase que contiene la matriz de CodeCommentStatement objetos especificada. |
| CodeCommentStatementCollection(CodeCommentStatementCollection) |
Inicializa una nueva instancia de la CodeCommentStatementCollection 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 CodeCommentStatement 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(CodeCommentStatement) |
Agrega el objeto especificado CodeCommentStatement a la colección. |
| AddRange(CodeCommentStatement[]) |
Copia los elementos de la matriz especificada CodeCommentStatement al final de la colección. |
| AddRange(CodeCommentStatementCollection) |
Copia el contenido de otro CodeCommentStatementCollection 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(CodeCommentStatement) |
Obtiene un valor que indica si la colección contiene el objeto especificado CodeCommentStatement . |
| CopyTo(CodeCommentStatement[], Int32) |
Copia los objetos de colección en la unidimensional Array especificada a partir del í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(CodeCommentStatement) |
Obtiene el índice del objeto especificado CodeCommentStatement en la colección, si existe en la colección. |
| Insert(Int32, CodeCommentStatement) |
Inserta un CodeCommentStatement objeto 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(CodeCommentStatement) |
Quita el objeto especificado CodeCommentStatement 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. |