CodeCatchClauseCollection Klasse

Definition

Stellt eine Auflistung von CodeCatchClause -Objekten dar.

public ref 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
[<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
Vererbung
CodeCatchClauseCollection
Attribute

Beispiele

Im folgenden Beispiel wird die Verwendung der CodeCatchClauseCollection Klassenmethoden veranschaulicht. Das Beispiel erstellt eine neue Instanz der Klasse und verwendet die Methoden, um der Auflistung Anweisungen hinzuzufügen, ihren Index zurückzugeben und Attribute an einem bestimmten Indexpunkt hinzuzufügen oder daraus zu entfernen.

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

Hinweise

Die CodeCatchClauseCollection Klasse stellt ein einfaches Auflistungsobjekt bereit, das zum Speichern einer Gruppe von CodeCatchClause Objekten verwendet werden kann.

Konstruktoren

Name Beschreibung
CodeCatchClauseCollection()

Initialisiert eine neue Instanz der CodeCatchClauseCollection-Klasse.

CodeCatchClauseCollection(CodeCatchClause[])

Initialisiert eine neue Instanz der CodeCatchClauseCollection Klasse, die das angegebene Array von CodeCatchClause Objekten enthält.

CodeCatchClauseCollection(CodeCatchClauseCollection)

Initialisiert eine neue Instanz der CodeCatchClauseCollection Klasse, die die Elemente der angegebenen Quellauflistung enthält.

Eigenschaften

Name Beschreibung
Capacity

Ruft die Anzahl der Elemente ab, die dies enthalten kann, oder legt diese CollectionBase fest.

(Geerbt von CollectionBase)
Count

Ruft die Anzahl der In der CollectionBase Instanz enthaltenen Elemente ab. Diese Eigenschaft kann nicht außer Kraft gesetzt werden.

(Geerbt von CollectionBase)
InnerList

Ruft eine ArrayList liste der Elemente in der CollectionBase Instanz ab.

(Geerbt von CollectionBase)
Item[Int32]

Dient zum Abrufen oder Festlegen des CodeCatchClause Objekts am angegebenen Index in der Auflistung.

List

Ruft eine IList liste der Elemente in der CollectionBase Instanz ab.

(Geerbt von CollectionBase)

Methoden

Name Beschreibung
Add(CodeCatchClause)

Fügt das angegebene CodeCatchClause Objekt der Auflistung hinzu.

AddRange(CodeCatchClause[])

Kopiert die Elemente des angegebenen CodeCatchClause Arrays an das Ende der Auflistung.

AddRange(CodeCatchClauseCollection)

Kopiert den Inhalt eines anderen CodeCatchClauseCollection Objekts an das Ende der Auflistung.

Clear()

Entfernt alle Objekte aus der CollectionBase Instanz. Diese Methode kann nicht überschrieben werden.

(Geerbt von CollectionBase)
Contains(CodeCatchClause)

Ruft einen Wert ab, der angibt, ob die Auflistung das angegebene CodeCatchClause Objekt enthält.

CopyTo(CodeCatchClause[], Int32)

Kopiert die Auflistungsobjekte in eine eindimensionale Array Instanz, die am angegebenen Index beginnt.

Equals(Object)

Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht.

(Geerbt von Object)
GetEnumerator()

Gibt einen Enumerator zurück, der die CollectionBase Instanz durchläuft.

(Geerbt von CollectionBase)
GetHashCode()

Dient als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft die Type der aktuellen Instanz ab.

(Geerbt von Object)
IndexOf(CodeCatchClause)

Ruft den Index des angegebenen CodeCatchClause Objekts in der Auflistung ab, falls es in der Auflistung vorhanden ist.

Insert(Int32, CodeCatchClause)

Fügt das angegebene CodeCatchClause Objekt in die Auflistung am angegebenen Index ein.

MemberwiseClone()

Erstellt eine flache Kopie der aktuellen Object.

(Geerbt von Object)
OnClear()

Führt zusätzliche benutzerdefinierte Prozesse aus, wenn der Inhalt der CollectionBase Instanz gelöscht wird.

(Geerbt von CollectionBase)
OnClearComplete()

Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem der Inhalt der CollectionBase Instanz gelöscht wurde.

(Geerbt von CollectionBase)
OnInsert(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse aus, bevor ein neues Element in die CollectionBase Instanz eingefügt wird.

(Geerbt von CollectionBase)
OnInsertComplete(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem ein neues Element in die CollectionBase Instanz eingefügt wurde.

(Geerbt von CollectionBase)
OnRemove(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse aus, wenn ein Element aus der CollectionBase Instanz entfernt wird.

(Geerbt von CollectionBase)
OnRemoveComplete(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem ein Element aus der CollectionBase Instanz entfernt wurde.

(Geerbt von CollectionBase)
OnSet(Int32, Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse aus, bevor ein Wert in der CollectionBase Instanz festgelegt wird.

(Geerbt von CollectionBase)
OnSetComplete(Int32, Object, Object)

Führt nach dem Festlegen eines Werts in der CollectionBase Instanz weitere benutzerdefinierte Prozesse aus.

(Geerbt von CollectionBase)
OnValidate(Object)

Führt beim Überprüfen eines Werts zusätzliche benutzerdefinierte Prozesse aus.

(Geerbt von CollectionBase)
Remove(CodeCatchClause)

Entfernt das angegebene CodeCatchClause Objekt aus der Auflistung.

RemoveAt(Int32)

Entfernt das Element am angegebenen Index der CollectionBase Instanz. Diese Methode kann nicht außer Kraft gesetzt werden.

(Geerbt von CollectionBase)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Explizite Schnittstellenimplementierungen

Name Beschreibung
ICollection.CopyTo(Array, Int32)

Kopiert das Gesamte CollectionBase in einen kompatiblen eindimensionalen Array, beginnend am angegebenen Index des Zielarrays.

(Geerbt von CollectionBase)
ICollection.IsSynchronized

Ruft einen Wert ab, der angibt, ob der Zugriff auf die CollectionBase synchronisiert wird (Threadsicher).

(Geerbt von CollectionBase)
ICollection.SyncRoot

Ruft ein Objekt ab, das zum Synchronisieren des Zugriffs auf die CollectionBaseverwendet werden kann.

(Geerbt von CollectionBase)
IList.Add(Object)

Fügt ein Objekt am Ende der .CollectionBase

(Geerbt von CollectionBase)
IList.Contains(Object)

Bestimmt, ob das CollectionBase Element ein bestimmtes Element enthält.

(Geerbt von CollectionBase)
IList.IndexOf(Object)

Sucht nach dem angegebenen Object Und gibt den nullbasierten Index des ersten Vorkommens innerhalb des gesamten CollectionBasezurück.

(Geerbt von CollectionBase)
IList.Insert(Int32, Object)

Fügt ein Element in den CollectionBase angegebenen Index ein.

(Geerbt von CollectionBase)
IList.IsFixedSize

Ruft einen Wert ab, der angibt, ob die CollectionBase Größe fest ist.

(Geerbt von CollectionBase)
IList.IsReadOnly

Ruft einen Wert ab, der angibt, ob die CollectionBase schreibgeschützt ist.

(Geerbt von CollectionBase)
IList.Item[Int32]

Ruft das Element am angegebenen Index ab oder legt es fest.

(Geerbt von CollectionBase)
IList.Remove(Object)

Entfernt das erste Vorkommen eines bestimmten Objekts aus dem CollectionBase.

(Geerbt von CollectionBase)

Erweiterungsmethoden

Name Beschreibung
AsParallel(IEnumerable)

Aktiviert die Parallelisierung einer Abfrage.

AsQueryable(IEnumerable)

Wandelt eine IEnumerable in eine IQueryableum.

Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ um.

OfType<TResult>(IEnumerable)

Filtert die Elemente einer IEnumerable basierend auf einem angegebenen Typ.

Gilt für:

Weitere Informationen