CodeCommentStatementCollection Classe

Definizione

Rappresenta una raccolta di CodeCommentStatement oggetti .

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
Ereditarietà
CodeCommentStatementCollection
Attributi

Esempio

Nell'esempio seguente viene illustrato l'uso dei metodi della CodeCommentStatementCollection classe . Nell'esempio viene creata una nuova istanza della classe e vengono utilizzati i metodi per aggiungere istruzioni alla raccolta, restituirne l'indice e aggiungere o rimuovere attributi in un punto di indice specifico.

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

Commenti

La CodeCommentStatementCollection classe fornisce un semplice oggetto raccolta che può essere utilizzato per archiviare un set di CodeCommentStatement oggetti.

Costruttori

Nome Descrizione
CodeCommentStatementCollection()

Inizializza una nuova istanza della classe CodeCommentStatementCollection.

CodeCommentStatementCollection(CodeCommentStatement[])

Inizializza una nuova istanza della CodeCommentStatementCollection classe contenente la matrice di CodeCommentStatement oggetti specificata.

CodeCommentStatementCollection(CodeCommentStatementCollection)

Inizializza una nuova istanza della CodeCommentStatementCollection classe contenente gli elementi della raccolta di origine specificata.

Proprietà

Nome Descrizione
Capacity

Ottiene o imposta il numero di elementi che l'oggetto CollectionBase può contenere.

(Ereditato da CollectionBase)
Count

Ottiene il numero di elementi contenuti nell'istanza CollectionBase di . Impossibile eseguire l'override di questa proprietà.

(Ereditato da CollectionBase)
InnerList

Ottiene un oggetto ArrayList contenente l'elenco di elementi nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
Item[Int32]

Ottiene o imposta l'oggetto CodeCommentStatement in corrispondenza dell'indice specificato nell'insieme.

List

Ottiene un oggetto IList contenente l'elenco di elementi nell'istanza CollectionBase di .

(Ereditato da CollectionBase)

Metodi

Nome Descrizione
Add(CodeCommentStatement)

Aggiunge l'oggetto specificato CodeCommentStatement all'insieme.

AddRange(CodeCommentStatement[])

Copia gli elementi della matrice di CodeCommentStatement specificata alla fine dell'insieme.

AddRange(CodeCommentStatementCollection)

Copia il contenuto di un altro CodeCommentStatementCollection oggetto alla fine dell'insieme.

Clear()

Rimuove tutti gli oggetti dall'istanza CollectionBase di . Non è possibile eseguire l'override di questo metodo.

(Ereditato da CollectionBase)
Contains(CodeCommentStatement)

Ottiene un valore che indica se l'insieme contiene l'oggetto specificato CodeCommentStatement .

CopyTo(CodeCommentStatement[], Int32)

Copia gli oggetti raccolta nell'oggetto unidimensionale Array specificato a partire dall'indice specificato.

Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetEnumerator()

Restituisce un enumeratore che scorre l'istanza CollectionBase di .

(Ereditato da CollectionBase)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
IndexOf(CodeCommentStatement)

Ottiene l'indice dell'oggetto specificato CodeCommentStatement nell'insieme, se presente nell'insieme.

Insert(Int32, CodeCommentStatement)

Inserisce un CodeCommentStatement oggetto nell'insieme in corrispondenza dell'indice specificato.

MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
OnClear()

Esegue processi personalizzati aggiuntivi quando si cancella il contenuto dell'istanza CollectionBase .

(Ereditato da CollectionBase)
OnClearComplete()

Esegue processi personalizzati aggiuntivi dopo la cancellazione del contenuto dell'istanza CollectionBase .

(Ereditato da CollectionBase)
OnInsert(Int32, Object)

Esegue processi personalizzati aggiuntivi prima di inserire un nuovo elemento nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnInsertComplete(Int32, Object)

Esegue processi personalizzati aggiuntivi dopo l'inserimento di un nuovo elemento nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnRemove(Int32, Object)

Esegue processi personalizzati aggiuntivi durante la rimozione di un elemento dall'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnRemoveComplete(Int32, Object)

Esegue processi personalizzati aggiuntivi dopo la rimozione di un elemento dall'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnSet(Int32, Object, Object)

Esegue processi personalizzati aggiuntivi prima di impostare un valore nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnSetComplete(Int32, Object, Object)

Esegue processi personalizzati aggiuntivi dopo aver impostato un valore nell'istanza CollectionBase di .

(Ereditato da CollectionBase)
OnValidate(Object)

Esegue processi personalizzati aggiuntivi durante la convalida di un valore.

(Ereditato da CollectionBase)
Remove(CodeCommentStatement)

Rimuove l'oggetto specificato CodeCommentStatement dall'insieme.

RemoveAt(Int32)

Rimuove l'elemento in corrispondenza dell'indice specificato dell'istanza CollectionBase . Questo metodo non è sostituibile.

(Ereditato da CollectionBase)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

Nome Descrizione
ICollection.CopyTo(Array, Int32)

Copia l'intero CollectionBase oggetto in un oggetto unidimensionale Arraycompatibile, a partire dall'indice specificato della matrice di destinazione.

(Ereditato da CollectionBase)
ICollection.IsSynchronized

Ottiene un valore che indica se l'accesso CollectionBase a è sincronizzato (thread-safe).

(Ereditato da CollectionBase)
ICollection.SyncRoot

Ottiene un oggetto che può essere utilizzato per sincronizzare l'accesso al CollectionBase.

(Ereditato da CollectionBase)
IList.Add(Object)

Aggiunge un oggetto alla fine dell'oggetto CollectionBase.

(Ereditato da CollectionBase)
IList.Contains(Object)

Determina se contiene CollectionBase un elemento specifico.

(Ereditato da CollectionBase)
IList.IndexOf(Object)

Cerca l'oggetto specificato Object e restituisce l'indice in base zero della prima occorrenza all'interno dell'intero CollectionBaseoggetto .

(Ereditato da CollectionBase)
IList.Insert(Int32, Object)

Inserisce un elemento nell'oggetto CollectionBase in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.IsFixedSize

Ottiene un valore che indica se ha CollectionBase una dimensione fissa.

(Ereditato da CollectionBase)
IList.IsReadOnly

Ottiene un valore che indica se il CollectionBase è di sola lettura.

(Ereditato da CollectionBase)
IList.Item[Int32]

Ottiene o imposta l'elemento in corrispondenza dell'indice specificato.

(Ereditato da CollectionBase)
IList.Remove(Object)

Rimuove la prima occorrenza di un oggetto specifico da CollectionBase.

(Ereditato da CollectionBase)

Metodi di estensione

Nome Descrizione
AsParallel(IEnumerable)

Abilita la parallelizzazione di una query.

AsQueryable(IEnumerable)

Converte un IEnumerable in un IQueryable.

Cast<TResult>(IEnumerable)

Esegue il cast degli elementi di un IEnumerable al tipo specificato.

OfType<TResult>(IEnumerable)

Filtra gli elementi di un IEnumerable in base a un tipo specificato.

Si applica a

Vedi anche