CodeCommentStatementCollection Classe
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Representa uma coleção de objetos CodeCommentStatement .
public ref class CodeCommentStatementCollection : System::Collections::CollectionBase
public 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
type CodeCommentStatementCollection = class
inherit 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
- 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 = gcnew CodeCommentStatementCollection;
// Adds a CodeCommentStatement to the collection.
collection->Add( gcnew CodeCommentStatement( "Test comment" ) );
// Adds an array of CodeCommentStatement objects to the collection.
array<CodeCommentStatement^>^comments = {gcnew CodeCommentStatement( "Test comment" ),gcnew CodeCommentStatement( "Another test comment" )};
collection->AddRange( comments );
// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection^ commentsCollection = gcnew CodeCommentStatementCollection;
commentsCollection->Add( gcnew CodeCommentStatement( "Test comment" ) );
commentsCollection->Add( gcnew 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 = gcnew 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, gcnew CodeCommentStatement( "Test comment" ) );
// Removes the specified CodeCommentStatement from the collection.
CodeCommentStatement^ comment = gcnew CodeCommentStatement( "Test comment" );
collection->Remove( comment );
// Removes the CodeCommentStatement at index 0.
collection->RemoveAt( 0 );
// 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 classe de CodeCommentStatementCollection fornece um objeto simples de coleção que pode ser usado para armazenar um conjunto de objetos de CodeCommentStatement .
Construtores
| CodeCommentStatementCollection() |
Inicializa uma nova instância da classe CodeCommentStatementCollection. |
| CodeCommentStatementCollection(CodeCommentStatement[]) |
Inicializa uma nova instância da classe CodeCommentStatementCollection contendo a matriz de objetos CodeCommentStatement especificada. |
| CodeCommentStatementCollection(CodeCommentStatementCollection) |
Inicializa uma nova instância da classe CodeCommentStatementCollection, que contém os elementos da coleção de origem especificada. |
Propriedades
| Capacity |
Obtém ou define o número de elementos que o CollectionBase pode conter. (Herdado de CollectionBase) |
| Count |
Obtém o número de elementos contidos na instância de CollectionBase. Essa propriedade não pode ser substituída. (Herdado de CollectionBase) |
| InnerList |
Obtém uma ArrayList que contém a lista de elementos na instância de CollectionBase. (Herdado de CollectionBase) |
| Item[Int32] |
Obtém ou define o objeto CodeCommentStatement no índice especificado na coleção. |
| List |
Obtém uma IList que contém a lista de elementos na instância de CollectionBase. (Herdado de CollectionBase) |
Métodos
| Add(CodeCommentStatement) |
Adiciona o objeto CodeCommentStatement especificado à coleção. |
| AddRange(CodeCommentStatement[]) |
Copia os elementos da matriz CodeCommentStatement especificada para o fim da coleção. |
| AddRange(CodeCommentStatementCollection) |
Copia o conteúdo de outro objeto CodeCommentStatementCollection para o final da coleção. |
| Clear() |
Remove todos os objetos da instância CollectionBase. Esse 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 CodeCommentStatement especificado. |
| CopyTo(CodeCommentStatement[], Int32) |
Copia os objetos de coleção para uma Array unidimensional especificada, começando no índice especificado. |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual. (Herdado de Object) |
| GetEnumerator() |
Retorna um enumerador que itera pela instância CollectionBase. (Herdado de CollectionBase) |
| GetHashCode() |
Serve como a função de hash padrão. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual. (Herdado de Object) |
| IndexOf(CodeCommentStatement) |
Obtém o índice do objeto CodeCommentStatement especificado na coleção, se ele existe na coleção. |
| Insert(Int32, CodeCommentStatement) |
Insere um objeto CodeCommentStatement na coleção no índice especificado. |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual. (Herdado de Object) |
| OnClear() |
Executa processos personalizados adicionais ao limpar o conteúdo da instância CollectionBase. (Herdado de CollectionBase) |
| OnClearComplete() |
Executa processos adicionais personalizados após limpar o conteúdo da instância CollectionBase. (Herdado de CollectionBase) |
| OnInsert(Int32, Object) |
Executa os processos personalizados adicionais antes de inserir um novo elemento na instância CollectionBase. (Herdado de CollectionBase) |
| OnInsertComplete(Int32, Object) |
Executa processos personalizados adicionais após inserir um novo elemento na instância de CollectionBase. (Herdado de CollectionBase) |
| OnRemove(Int32, Object) |
Executa processos personalizados adicionais ao remover um elemento da instância CollectionBase. (Herdado de CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Executa processos personalizados adicionais após remover um elemento da instância de CollectionBase. (Herdado de CollectionBase) |
| OnSet(Int32, Object, Object) |
Executa processos personalizados adicionais antes de definir um valor na instância CollectionBase. (Herdado de CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Executa processos personalizados adicionais após configurar um valor na instância de CollectionBase. (Herdado de CollectionBase) |
| OnValidate(Object) |
Executa processos personalizados adicionais ao validar um valor. (Herdado de CollectionBase) |
| Remove(CodeCommentStatement) |
Remove o objeto CodeCommentStatement especificado da coleção. |
| RemoveAt(Int32) |
Remove o elemento no índice especificado da instância CollectionBase. Este 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
| ICollection.CopyTo(Array, Int32) |
Copia todo o CollectionBase em um Array unidimensional compatível, começando no índice especificado da matriz de destino. (Herdado de CollectionBase) |
| ICollection.IsSynchronized |
Obtém um valor que indica se o acesso à 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 contém um elemento específico. (Herdado de CollectionBase) |
| IList.IndexOf(Object) |
Pesquisa o Object especificado e retorna o índice de base zero da primeira ocorrência dentro de todo o CollectionBase. (Herdado de CollectionBase) |
| IList.Insert(Int32, Object) |
Insere um elemento no CollectionBase, no índice especificado. (Herdado de CollectionBase) |
| IList.IsFixedSize |
Obtém um valor que indica se o CollectionBase 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
| 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. |
| AsParallel(IEnumerable) |
Habilita a paralelização de uma consulta. |
| AsQueryable(IEnumerable) |
Converte um IEnumerable em um IQueryable. |