CodeCommentStatementCollection CodeCommentStatementCollection CodeCommentStatementCollection CodeCommentStatementCollection Class

Definizione

Rappresenta una raccolta di oggetti CodeCommentStatement.Represents a collection of CodeCommentStatement objects.

public ref class CodeCommentStatementCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Serializable]
public class CodeCommentStatementCollection : System.Collections.CollectionBase
type CodeCommentStatementCollection = class
    inherit CollectionBase
Public Class CodeCommentStatementCollection
Inherits CollectionBase
Ereditarietà
CodeCommentStatementCollectionCodeCommentStatementCollectionCodeCommentStatementCollectionCodeCommentStatementCollection
Attributi

Esempi

Nell'esempio seguente viene illustrato l'utilizzo del CodeCommentStatementCollection metodi della classe.The following example demonstrates the use of the CodeCommentStatementCollection class methods. L'esempio crea una nuova istanza della classe e Usa i metodi per aggiungere le istruzioni per la raccolta, restituire il relativo indice e aggiungere o rimuovere gli attributi in un determinato indice specifico.The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.

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

Commenti

La classe CodeCommentStatementCollection specifica un oggetto della raccolta che può essere utilizzato per archiviare un set di oggetti CodeCommentStatement.The CodeCommentStatementCollection class provides a simple collection object that can be used to store a set of CodeCommentStatement objects.

Costruttori

CodeCommentStatementCollection() CodeCommentStatementCollection() CodeCommentStatementCollection() CodeCommentStatementCollection()

Inizializza una nuova istanza della classe CodeCommentStatementCollection.Initializes a new instance of the CodeCommentStatementCollection class.

CodeCommentStatementCollection(CodeCommentStatementCollection) CodeCommentStatementCollection(CodeCommentStatementCollection) CodeCommentStatementCollection(CodeCommentStatementCollection) CodeCommentStatementCollection(CodeCommentStatementCollection)

Consente l'inizializzazione di una nuova istanza della classe CodeCommentStatementCollection contenente gli elementi dell'insieme di origine specificato.Initializes a new instance of the CodeCommentStatementCollection class containing the elements of the specified source collection.

CodeCommentStatementCollection(CodeCommentStatement[]) CodeCommentStatementCollection(CodeCommentStatement[]) CodeCommentStatementCollection(CodeCommentStatement[]) CodeCommentStatementCollection(CodeCommentStatement[])

Consente l'inizializzazione di una nuova istanza della classe CodeCommentStatementCollection contenente la matrice specificata di oggetti CodeCommentStatement.Initializes a new instance of the CodeCommentStatementCollection class containing the specified array of CodeCommentStatement objects.

Proprietà

Capacity Capacity Capacity Capacity

Ottiene o imposta il numero di elementi che CollectionBase può contenere.Gets or sets the number of elements that the CollectionBase can contain.

(Inherited from CollectionBase)
Count Count Count Count

Ottiene il numero di elementi contenuti nell'istanza di CollectionBase.Gets the number of elements contained in the CollectionBase instance. Questa proprietà non può essere sottoposta a override.This property cannot be overridden.

(Inherited from CollectionBase)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

Ottiene un valore che indica se l'accesso a CollectionBase è sincronizzato (thread-safe).Gets a value indicating whether access to the CollectionBase is synchronized (thread safe).

(Inherited from CollectionBase)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

Ottiene un oggetto che può essere usato per sincronizzare l'accesso a CollectionBase.Gets an object that can be used to synchronize access to the CollectionBase.

(Inherited from CollectionBase)
IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

Ottiene un valore che indica se CollectionBase ha dimensioni fisse.Gets a value indicating whether the CollectionBase has a fixed size.

(Inherited from CollectionBase)
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

Ottiene un valore che indica se CollectionBase è di sola lettura.Gets a value indicating whether the CollectionBase is read-only.

(Inherited from CollectionBase)
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

Ottiene o imposta l'elemento in corrispondenza dell'indice specificato.Gets or sets the element at the specified index.

(Inherited from CollectionBase)
InnerList InnerList InnerList InnerList

Ottiene un ArrayList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.Gets an ArrayList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Ottiene o imposta l'oggetto CodeCommentStatement nella raccolta, in corrispondenza dell'indice specificato.Gets or sets the CodeCommentStatement object at the specified index in the collection.

List List List List

Ottiene un IList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.Gets an IList containing the list of elements in the CollectionBase instance.

(Inherited from CollectionBase)

Metodi

Add(CodeCommentStatement) Add(CodeCommentStatement) Add(CodeCommentStatement) Add(CodeCommentStatement)

Aggiunge l'oggetto CodeCommentStatement specificato alla raccolta.Adds the specified CodeCommentStatement object to the collection.

AddRange(CodeCommentStatementCollection) AddRange(CodeCommentStatementCollection) AddRange(CodeCommentStatementCollection) AddRange(CodeCommentStatementCollection)

Copia il contenuto di un altro oggetto CodeCommentStatementCollection alla fine dell'insieme.Copies the contents of another CodeCommentStatementCollection object to the end of the collection.

AddRange(CodeCommentStatement[]) AddRange(CodeCommentStatement[]) AddRange(CodeCommentStatement[]) AddRange(CodeCommentStatement[])

Copia gli elementi della matrice di oggetti CodeCommentStatement specificata alla fine dell'insieme.Copies the elements of the specified CodeCommentStatement array to the end of the collection.

Clear() Clear() Clear() Clear()

Consente di rimuovere tutti gli oggetti dall'istanza CollectionBase.Removes all objects from the CollectionBase instance. Questo metodo non può essere sottoposto a override.This method cannot be overridden.

(Inherited from CollectionBase)
Contains(CodeCommentStatement) Contains(CodeCommentStatement) Contains(CodeCommentStatement) Contains(CodeCommentStatement)

Ottiene un valore che indica se l'insieme contiene l'oggetto CodeCommentStatement specificato.Gets a value that indicates whether the collection contains the specified CodeCommentStatement object.

CopyTo(CodeCommentStatement[], Int32) CopyTo(CodeCommentStatement[], Int32) CopyTo(CodeCommentStatement[], Int32) CopyTo(CodeCommentStatement[], Int32)

Consente di copiare gli oggetti dell'insieme nella Array unidimensionale specificata partendo dall'indice specificato.Copies the collection objects to the specified one-dimensional Array beginning at the specified index.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Restituisce un enumeratore per lo scorrimento dell'istanza di CollectionBase.Returns an enumerator that iterates through the CollectionBase instance.

(Inherited from CollectionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Funge da funzione hash predefinita.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Ottiene l'oggetto Type dell'istanza corrente.Gets the Type of the current instance.

(Inherited from Object)
IndexOf(CodeCommentStatement) IndexOf(CodeCommentStatement) IndexOf(CodeCommentStatement) IndexOf(CodeCommentStatement)

Ottiene l'indice dell'oggetto CodeCommentStatement specificato nell'insieme, se esistente.Gets the index of the specified CodeCommentStatement object in the collection, if it exists in the collection.

Insert(Int32, CodeCommentStatement) Insert(Int32, CodeCommentStatement) Insert(Int32, CodeCommentStatement) Insert(Int32, CodeCommentStatement)

Inserisce un oggetto CodeCommentStatement nell'insieme, in corrispondenza dell'indice specificato.Inserts a CodeCommentStatement object into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.Creates a shallow copy of the current Object.

(Inherited from Object)
OnClear() OnClear() OnClear() OnClear()

Consente di eseguire procedure personalizzate aggiuntive durante l'eliminazione del contenuto dell'istanza CollectionBase.Performs additional custom processes when clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnClearComplete() OnClearComplete() OnClearComplete() OnClearComplete()

Consente di eseguire procedure personalizzate aggiuntive prima di cancellare il contenuto dell'istanza CollectionBase.Performs additional custom processes after clearing the contents of the CollectionBase instance.

(Inherited from CollectionBase)
OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object) OnInsert(Int32, Object)

Consente di eseguire procedure personalizzate aggiuntive prima di inserire un nuovo elemento nell'istanza CollectionBase.Performs additional custom processes before inserting a new element into the CollectionBase instance.

(Inherited from CollectionBase)
OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object) OnInsertComplete(Int32, Object)

Consente di eseguire procedure personalizzate aggiuntive dopo aver inserito un nuovo elemento nell'istanza CollectionBase.Performs additional custom processes after inserting a new element into the CollectionBase instance.

(Inherited from CollectionBase)
OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object) OnRemove(Int32, Object)

Consente di eseguire procedure personalizzate aggiuntive durante l'eliminazione di un elemento dall'istanza CollectionBase.Performs additional custom processes when removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object) OnRemoveComplete(Int32, Object)

Consente di eseguire procedure personalizzate aggiuntive dopo della rimozione di un elemento dall'istanza CollectionBase.Performs additional custom processes after removing an element from the CollectionBase instance.

(Inherited from CollectionBase)
OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object) OnSet(Int32, Object, Object)

Consente di eseguire procedure personalizzate aggiuntive prima di impostare un valore nell'istanza CollectionBase.Performs additional custom processes before setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object) OnSetComplete(Int32, Object, Object)

Consente di eseguire procedure personalizzate aggiuntive dopo aver impostato un valore nell'istanza CollectionBase.Performs additional custom processes after setting a value in the CollectionBase instance.

(Inherited from CollectionBase)
OnValidate(Object) OnValidate(Object) OnValidate(Object) OnValidate(Object)

Esegue processi personalizzati aggiuntivi durante la convalida di un valore.Performs additional custom processes when validating a value.

(Inherited from CollectionBase)
Remove(CodeCommentStatement) Remove(CodeCommentStatement) Remove(CodeCommentStatement) Remove(CodeCommentStatement)

Rimuove l'oggetto CodeCommentStatement specificato dalla raccolta.Removes the specified CodeCommentStatement object from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Consente di rimuovere la voce in corrispondenza dell'indice specificato dell'istanza CollectionBase.Removes the element at the specified index of the CollectionBase instance. Questo metodo non può essere sottoposto a override.This method is not overridable.

(Inherited from CollectionBase)
ToString() ToString() ToString() ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.Returns a string that represents the current object.

(Inherited from Object)

Implementazioni dell'interfaccia esplicita

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

Copia l'intero oggetto CollectionBase in un oggetto Array compatibile unidimensionale, a partire dall'indice specificato della matrice di destinazione.Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Inherited from CollectionBase)
IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

Aggiunge un oggetto alla fine di CollectionBase.Adds an object to the end of the CollectionBase.

(Inherited from CollectionBase)
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

Consente di stabilire se CollectionBase contiene un elemento specifico.Determines whether the CollectionBase contains a specific element.

(Inherited from CollectionBase)
IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

Cerca l'oggetto Object specificato e restituisce l'indice in base zero della prima occorrenza all'interno dell'intero CollectionBase.Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase.

(Inherited from CollectionBase)
IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

Inserisce un elemento in CollectionBase in corrispondenza dell'indice specificato.Inserts an element into the CollectionBase at the specified index.

(Inherited from CollectionBase)
IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

Rimuove la prima occorrenza di un oggetto specifico da CollectionBase.Removes the first occurrence of a specific object from the CollectionBase.

(Inherited from CollectionBase)

Metodi di estensione

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Esegue il cast degli elementi di un oggetto IEnumerable nel tipo specificato.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filtra gli elementi di un oggetto IEnumerable in base a un tipo specificato.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Consente la parallelizzazione di una query.Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converte un oggetto IEnumerable in un oggetto IQueryable.Converts an IEnumerable to an IQueryable.

Si applica a

Vedi anche