CodeCatchClauseCollection Classe

Definizione

Rappresenta una raccolta di oggetti CodeCatchClause.

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

Esempio

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

// Creates an empty CodeCatchClauseCollection.
CodeCatchClauseCollection^ collection = gcnew CodeCatchClauseCollection;

// Adds a CodeCatchClause to the collection.
collection->Add( gcnew CodeCatchClause( "e" ) );

// Adds an array of CodeCatchClause objects to the collection.
array<CodeCatchClause^>^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause};
collection->AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection;
clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) );
clausesCollection->Add( gcnew CodeCatchClause( "e" ) );
collection->AddRange( clausesCollection );

// Tests for the presence of a CodeCatchClause in the 
// collection, and retrieves its index if it is found.
CodeCatchClause^ testClause = gcnew CodeCatchClause( "e" );
int itemIndex = -1;
if ( collection->Contains( testClause ) )
   itemIndex = collection->IndexOf( testClause );

// Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
// 'clauses' is a CodeCatchClause array.
collection->CopyTo( clauses, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a CodeCatchClause at index 0 of the collection.
collection->Insert( 0, gcnew CodeCatchClause( "e" ) );

// Removes the specified CodeCatchClause from the collection.
CodeCatchClause^ clause = gcnew CodeCatchClause( "e" );
collection->Remove( clause );

// Removes the CodeCatchClause at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeCatchClauseCollection.
CodeCatchClauseCollection collection = new CodeCatchClauseCollection();

// Adds a CodeCatchClause to the collection.
collection.Add( new CodeCatchClause("e") );

// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );

// Tests for the presence of a CodeCatchClause in the
// collection, and retrieves its index if it is found.
CodeCatchClause testClause = new CodeCatchClause("e");
int itemIndex = -1;
if( collection.Contains( testClause ) )
    itemIndex = collection.IndexOf( testClause );

// Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
// 'clauses' is a CodeCatchClause array.
collection.CopyTo( clauses, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CodeCatchClause at index 0 of the collection.
collection.Insert( 0, new CodeCatchClause("e") );

// Removes the specified CodeCatchClause from the collection.
CodeCatchClause clause = new CodeCatchClause("e");
collection.Remove( clause );

// Removes the CodeCatchClause at index 0.
collection.RemoveAt(0);
' Creates an empty CodeCatchClauseCollection.
Dim collection As New CodeCatchClauseCollection()

' Adds a CodeCatchClause to the collection.
collection.Add(New CodeCatchClause("e"))

' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)

' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)

' Tests for the presence of a CodeCatchClause in the 
' collection, and retrieves its index if it is found.
Dim testClause As New CodeCatchClause("e")
Dim itemIndex As Integer = -1
If collection.Contains(testClause) Then
    itemIndex = collection.IndexOf(testClause)
End If

' Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
' 'clauses' is a CodeCatchClause array.
collection.CopyTo(clauses, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

' Inserts a CodeCatchClause at index 0 of the collection.
collection.Insert(0, New CodeCatchClause("e"))

' Removes the specified CodeCatchClause from the collection.
Dim clause As New CodeCatchClause("e")
collection.Remove(clause)

' Removes the CodeCatchClause at index 0.
collection.RemoveAt(0)

Commenti

La classe CodeCatchClauseCollection specifica un oggetto della raccolta che può essere utilizzato per archiviare un set di oggetti CodeCatchClause.

Costruttori

CodeCatchClauseCollection()

Inizializza una nuova istanza della classe CodeCatchClauseCollection.

CodeCatchClauseCollection(CodeCatchClause[])

Consente l'inizializzazione di una nuova istanza della classe CodeCatchClauseCollection contenente la matrice specificata di oggetti CodeCatchClause.

CodeCatchClauseCollection(CodeCatchClauseCollection)

Consente l'inizializzazione di una nuova istanza della classe CodeCatchClauseCollection contenente gli elementi dell'insieme di origine specificato.

Proprietà

Capacity

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

(Ereditato da CollectionBase)
Count

Ottiene il numero di elementi contenuti nell'istanza di CollectionBase. Questa proprietà non può essere sottoposta a override.

(Ereditato da CollectionBase)
InnerList

Ottiene un ArrayList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.

(Ereditato da CollectionBase)
Item[Int32]

Ottiene o imposta l'oggetto CodeCatchClause nella raccolta, in corrispondenza dell'indice specificato.

List

Ottiene un IList contenente l'elenco degli elementi presenti nell'istanza CollectionBase.

(Ereditato da CollectionBase)

Metodi

Add(CodeCatchClause)

Aggiunge l'oggetto CodeCatchClause specificato alla raccolta.

AddRange(CodeCatchClause[])

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

AddRange(CodeCatchClauseCollection)

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

Clear()

Consente di rimuovere tutti gli oggetti dall'istanza CollectionBase. Questo metodo non può essere sottoposto a override.

(Ereditato da CollectionBase)
Contains(CodeCatchClause)

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

CopyTo(CodeCatchClause[], Int32)

Consente di copiare gli oggetti dell'insieme in un'istanza della Array unidimensionale a partire dall'indice specificato.

Equals(Object)

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

(Ereditato da Object)
GetEnumerator()

Restituisce un enumeratore per lo scorrimento dell'istanza di CollectionBase.

(Ereditato da CollectionBase)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IndexOf(CodeCatchClause)

Ottiene l'indice dell'oggetto CodeCatchClause specificato nell'insieme, se esistente.

Insert(Int32, CodeCatchClause)

Inserisce l'oggetto CodeCatchClause specificato nella raccolta in corrispondenza dell'indice specificato.

MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
OnClear()

Esegue processi personalizzati aggiuntivi quando viene cancellato il contenuto dell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnClearComplete()

Esegue procedure personalizzate aggiuntive prima di cancellare il contenuto dell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnInsert(Int32, Object)

Esegue procedure personalizzate aggiuntive prima di inserire un nuovo elemento nell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnInsertComplete(Int32, Object)

Esegue procedure personalizzate aggiuntive dopo aver inserito un nuovo elemento nell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnRemove(Int32, Object)

Consente di eseguire procedure personalizzate aggiuntive durante l'eliminazione di un elemento dall'istanza CollectionBase.

(Ereditato da CollectionBase)
OnRemoveComplete(Int32, Object)

Esegue procedure personalizzate aggiuntive dopo della rimozione di un elemento dall'istanza di CollectionBase.

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

Esegue procedure personalizzate aggiuntive prima di impostare un valore nell'istanza di CollectionBase.

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

Esegue procedure personalizzate aggiuntive dopo aver impostato un valore nell'istanza di CollectionBase.

(Ereditato da CollectionBase)
OnValidate(Object)

Esegue processi personalizzati aggiuntivi durante la convalida di un valore.

(Ereditato da CollectionBase)
Remove(CodeCatchClause)

Rimuove l'oggetto CodeCatchClause specificato dalla raccolta.

RemoveAt(Int32)

Consente di rimuovere la voce in corrispondenza dell'indice specificato dell'istanza CollectionBase. Questo metodo non può essere sottoposto a override.

(Ereditato da CollectionBase)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

ICollection.CopyTo(Array, Int32)

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

(Ereditato da CollectionBase)
ICollection.IsSynchronized

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

(Ereditato da CollectionBase)
ICollection.SyncRoot

Ottiene un oggetto che può essere usato per sincronizzare l'accesso a CollectionBase.

(Ereditato da CollectionBase)
IList.Add(Object)

Aggiunge un oggetto alla fine di CollectionBase.

(Ereditato da CollectionBase)
IList.Contains(Object)

Consente di stabilire se CollectionBase contiene un elemento specifico.

(Ereditato da CollectionBase)
IList.IndexOf(Object)

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

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

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

(Ereditato da CollectionBase)
IList.IsFixedSize

Ottiene un valore che indica se CollectionBase ha dimensioni fisse.

(Ereditato da CollectionBase)
IList.IsReadOnly

Ottiene un valore che indica se 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

Cast<TResult>(IEnumerable)

Esegue il cast degli elementi di un oggetto IEnumerable nel tipo specificato.

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

Consente la parallelizzazione di una query.

AsQueryable(IEnumerable)

Converte un oggetto IEnumerable in un oggetto IQueryable.

Si applica a

Vedi anche