CodeCommentStatementCollection Classe

Definição

Representa uma coleção 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
Herança
CodeCommentStatementCollection
Atributos

Exemplos

O exemplo a seguir demonstra o uso dos métodos de CodeCommentStatementCollection classe. O exemplo cria uma nova instância da classe e usa os métodos para adicionar instruções à coleção, retornar seu índice e adicionar ou remover atributos em um ponto 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)

Comentários

A CodeCommentStatementCollection classe fornece um objeto de coleção simples que pode ser usado para armazenar um conjunto de CodeCommentStatement objetos.

Construtores

Nome Description
CodeCommentStatementCollection()

Inicializa uma nova instância da classe CodeCommentStatementCollection.

CodeCommentStatementCollection(CodeCommentStatement[])

Inicializa uma nova instância da CodeCommentStatementCollection classe que contém a matriz de CodeCommentStatement objetos especificada.

CodeCommentStatementCollection(CodeCommentStatementCollection)

Inicializa uma nova instância da CodeCommentStatementCollection classe que contém os elementos da coleção de origem especificada.

Propriedades

Nome Description
Capacity

Obtém ou define o número de elementos que podem CollectionBase conter.

(Herdado de CollectionBase)
Count

Obtém o número de elementos contidos na CollectionBase instância. Essa propriedade não pode ser substituída.

(Herdado de CollectionBase)
InnerList

Obtém uma ArrayList lista que contém os elementos na CollectionBase instância.

(Herdado de CollectionBase)
Item[Int32]

Obtém ou define o CodeCommentStatement objeto no índice especificado na coleção.

List

Obtém uma IList lista que contém os elementos na CollectionBase instância.

(Herdado de CollectionBase)

Métodos

Nome Description
Add(CodeCommentStatement)

Adiciona o objeto especificado CodeCommentStatement à coleção.

AddRange(CodeCommentStatement[])

Copia os elementos da matriz especificada CodeCommentStatement para o final da coleção.

AddRange(CodeCommentStatementCollection)

Copia o conteúdo de outro CodeCommentStatementCollection objeto para o final da coleção.

Clear()

Remove todos os objetos da CollectionBase instância. Este método não pode ser substituído.

(Herdado de CollectionBase)
Contains(CodeCommentStatement)

Obtém um valor que indica se a coleção contém o objeto especificado CodeCommentStatement .

CopyTo(CodeCommentStatement[], Int32)

Copia os objetos da coleção para o início unidimensional Array especificado no índice especificado.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetEnumerator()

Retorna um enumerador que itera por meio da CollectionBase instância.

(Herdado de CollectionBase)
GetHashCode()

Serve como a função hash predefinida.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
IndexOf(CodeCommentStatement)

Obtém o índice do objeto especificado CodeCommentStatement na coleção, se ele existir na coleção.

Insert(Int32, CodeCommentStatement)

Insere um CodeCommentStatement objeto na coleção no índice especificado.

MemberwiseClone()

Cria uma cópia superficial do Objectatual.

(Herdado de Object)
OnClear()

Executa processos personalizados adicionais ao limpar o conteúdo da CollectionBase instância.

(Herdado de CollectionBase)
OnClearComplete()

Executa processos personalizados adicionais depois de limpar o conteúdo da CollectionBase instância.

(Herdado de CollectionBase)
OnInsert(Int32, Object)

Executa processos personalizados adicionais antes de inserir um novo elemento na CollectionBase instância.

(Herdado de CollectionBase)
OnInsertComplete(Int32, Object)

Executa processos personalizados adicionais depois de inserir um novo elemento na CollectionBase instância.

(Herdado de CollectionBase)
OnRemove(Int32, Object)

Executa processos personalizados adicionais ao remover um elemento da CollectionBase instância.

(Herdado de CollectionBase)
OnRemoveComplete(Int32, Object)

Executa processos personalizados adicionais depois de remover um elemento da CollectionBase instância.

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

Executa processos personalizados adicionais antes de definir um valor na CollectionBase instância.

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

Executa processos personalizados adicionais depois de definir um valor na CollectionBase instância.

(Herdado de CollectionBase)
OnValidate(Object)

Executa processos personalizados adicionais ao validar um valor.

(Herdado de CollectionBase)
Remove(CodeCommentStatement)

Remove o objeto especificado CodeCommentStatement da coleção.

RemoveAt(Int32)

Remove o elemento no índice especificado da CollectionBase instância. Esse método não é substituível.

(Herdado de CollectionBase)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.

(Herdado de Object)

Implantações explícitas de interface

Nome Description
ICollection.CopyTo(Array, Int32)

Copia o todo CollectionBase para um unidimensional Arraycompatível, começando no índice especificado da matriz de destino.

(Herdado de CollectionBase)
ICollection.IsSynchronized

Obtém um valor que indica se o acesso ao CollectionBase é sincronizado (thread safe).

(Herdado de CollectionBase)
ICollection.SyncRoot

Obtém um objeto que pode ser usado para sincronizar o acesso ao CollectionBase.

(Herdado de CollectionBase)
IList.Add(Object)

Adiciona um objeto ao final do CollectionBase.

(Herdado de CollectionBase)
IList.Contains(Object)

Determina se o CollectionBase elemento contém um elemento específico.

(Herdado de CollectionBase)
IList.IndexOf(Object)

Pesquisa o índice especificado Object e retorna o índice baseado em zero da primeira ocorrência em todo CollectionBaseo .

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

Insere um elemento CollectionBase no índice especificado.

(Herdado de CollectionBase)
IList.IsFixedSize

Obtém um valor que indica se o CollectionBase tamanho tem um tamanho fixo.

(Herdado de CollectionBase)
IList.IsReadOnly

Obtém um valor que indica se o CollectionBase é somente leitura.

(Herdado de CollectionBase)
IList.Item[Int32]

Obtém ou define o elemento no índice especificado.

(Herdado de CollectionBase)
IList.Remove(Object)

Remove a primeira ocorrência de um objeto específico do CollectionBase.

(Herdado de CollectionBase)

Métodos de Extensão

Nome Description
AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.

AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.

Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.

Aplica-se a

Confira também