CodeCatchClauseCollection Třída

Definice

Představuje kolekci CodeCatchClause objektů.

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
Dědičnost
CodeCatchClauseCollection
Atributy

Příklady

Následující příklad ukazuje použití CodeCatchClauseCollection tříd metod. Příklad vytvoří novou instanci třídy a používá metody k přidání příkazů do kolekce, vrácení jejich indexu a přidání nebo odebrání atributů v určitém bodu indexu.

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

Poznámky

Třída CodeCatchClauseCollection poskytuje jednoduchý objekt kolekce, který lze použít k uložení sady CodeCatchClause objektů.

Konstruktory

CodeCatchClauseCollection()

Inicializuje novou instanci CodeCatchClauseCollection třídy.

CodeCatchClauseCollection(CodeCatchClause[])

Inicializuje novou instanci CodeCatchClauseCollection třídy obsahující zadané pole CodeCatchClause objektů.

CodeCatchClauseCollection(CodeCatchClauseCollection)

Inicializuje novou instanci CodeCatchClauseCollection třídy obsahující prvky zadané zdrojové kolekce.

Vlastnosti

Capacity

Získá nebo nastaví počet prvků, které CollectionBase mohou obsahovat.

(Zděděno od CollectionBase)
Count

Získá počet prvků obsažených CollectionBase v instanci. Tuto vlastnost nelze přepsat.

(Zděděno od CollectionBase)
InnerList

Získá obsahující ArrayList seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)
Item[Int32]

Získá nebo nastaví CodeCatchClause objekt v zadaném indexu v kolekci.

List

Získá obsahující IList seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)

Metody

Add(CodeCatchClause)

Přidá zadaný CodeCatchClause objekt do kolekce.

AddRange(CodeCatchClause[])

Zkopíruje prvky zadaného CodeCatchClause pole na konec kolekce.

AddRange(CodeCatchClauseCollection)

Zkopíruje obsah jiného CodeCatchClauseCollection objektu na konec kolekce.

Clear()

Odebere z instance všechny objekty CollectionBase . Tuto metodu nelze přepsat.

(Zděděno od CollectionBase)
Contains(CodeCatchClause)

Získá hodnotu, která označuje, zda kolekce obsahuje zadaný CodeCatchClause objekt.

CopyTo(CodeCatchClause[], Int32)

Zkopíruje objekty kolekce do jednorozměrné Array instance počínaje zadaným indexem.

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

(Zděděno od Object)
GetEnumerator()

Vrátí enumerátor, který iteruje instanci CollectionBase .

(Zděděno od CollectionBase)
GetHashCode()

Slouží jako výchozí hashovací funkce.

(Zděděno od Object)
GetType()

Získá aktuální Type instanci.

(Zděděno od Object)
IndexOf(CodeCatchClause)

Získá index zadaného CodeCatchClause objektu v kolekci, pokud existuje v kolekci.

Insert(Int32, CodeCatchClause)

Vloží zadaný CodeCatchClause objekt do kolekce v zadaném indexu.

MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
OnClear()

Provádí další vlastní procesy při vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnClearComplete()

Provádí další vlastní procesy po vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnInsert(Int32, Object)

Před vložením nového prvku do CollectionBase instance provede další vlastní procesy.

(Zděděno od CollectionBase)
OnInsertComplete(Int32, Object)

Provádí další vlastní procesy po vložení nového prvku do CollectionBase instance.

(Zděděno od CollectionBase)
OnRemove(Int32, Object)

Provádí další vlastní procesy při odebírání elementu CollectionBase z instance.

(Zděděno od CollectionBase)
OnRemoveComplete(Int32, Object)

Provádí další vlastní procesy po odebrání elementu CollectionBase z instance.

(Zděděno od CollectionBase)
OnSet(Int32, Object, Object)

Před nastavením hodnoty v CollectionBase instanci provede další vlastní procesy.

(Zděděno od CollectionBase)
OnSetComplete(Int32, Object, Object)

Po nastavení hodnoty v CollectionBase instanci provede další vlastní procesy.

(Zděděno od CollectionBase)
OnValidate(Object)

Provádí další vlastní procesy při ověřování hodnoty.

(Zděděno od CollectionBase)
Remove(CodeCatchClause)

Odebere zadaný CodeCatchClause objekt z kolekce.

RemoveAt(Int32)

Odebere prvek v zadaném indexu CollectionBase instance. Tuto metodu nelze přepsat.

(Zděděno od CollectionBase)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

ICollection.CopyTo(Array, Int32)

Zkopíruje celý CollectionBase objekt do kompatibilního jednorozměrného Arrayobjektu , počínaje zadaným indexem cílového pole.

(Zděděno od CollectionBase)
ICollection.IsSynchronized

Získá hodnotu označující, zda je přístup k CollectionBase je synchronizován (bez vláken).

(Zděděno od CollectionBase)
ICollection.SyncRoot

Získá objekt, který lze použít k synchronizaci přístupu k CollectionBase.

(Zděděno od CollectionBase)
IList.Add(Object)

Přidá objekt na konec objektu CollectionBase.

(Zděděno od CollectionBase)
IList.Contains(Object)

Určuje, zda obsahuje CollectionBase určitý prvek.

(Zděděno od CollectionBase)
IList.IndexOf(Object)

Vyhledá zadaný Object a vrátí nulový index prvního výskytu v rámci celého CollectionBaseobjektu .

(Zděděno od CollectionBase)
IList.Insert(Int32, Object)

Vloží prvek do zadaného indexu CollectionBase .

(Zděděno od CollectionBase)
IList.IsFixedSize

Získá hodnotu označující, zda CollectionBase má pevnou velikost.

(Zděděno od CollectionBase)
IList.IsReadOnly

Získá hodnotu, která určuje, zda je CollectionBase určena jen pro čtení.

(Zděděno od CollectionBase)
IList.Item[Int32]

Získá nebo nastaví prvek u zadaného indexu.

(Zděděno od CollectionBase)
IList.Remove(Object)

Odebere první výskyt konkrétního objektu z objektu CollectionBase.

(Zděděno od CollectionBase)

Metody rozšíření

Cast<TResult>(IEnumerable)

Přetypuje prvky objektu na IEnumerable zadaný typ.

OfType<TResult>(IEnumerable)

Filtruje prvky objektu IEnumerable na základě zadaného typu.

AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede objekt na IEnumerableIQueryable.

Platí pro

Viz také