CodeCatchClauseCollection Kelas

Definisi

Mewakili kumpulan CodeCatchClause objek.

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
Warisan
CodeCatchClauseCollection
Atribut

Contoh

Contoh berikut menunjukkan penggunaan CodeCatchClauseCollection metode kelas. Contoh membuat instans baru kelas dan menggunakan metode untuk menambahkan pernyataan ke koleksi, mengembalikan indeksnya, dan menambahkan atau menghapus atribut pada titik indeks tertentu.

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

Keterangan

Kelas ini CodeCatchClauseCollection menyediakan objek koleksi sederhana yang dapat digunakan untuk menyimpan sekumpulan CodeCatchClause objek.

Konstruktor

Nama Deskripsi
CodeCatchClauseCollection()

Menginisialisasi instans baru dari kelas CodeCatchClauseCollection.

CodeCatchClauseCollection(CodeCatchClause[])

Menginisialisasi instans baru kelas yang CodeCatchClauseCollection berisi array CodeCatchClause objek yang ditentukan.

CodeCatchClauseCollection(CodeCatchClauseCollection)

Menginisialisasi instans baru kelas yang CodeCatchClauseCollection berisi elemen koleksi sumber yang ditentukan.

Properti

Nama Deskripsi
Capacity

Mendapatkan atau mengatur jumlah elemen yang dapat dimuat CollectionBase.

(Diperoleh dari CollectionBase)
Count

Mendapatkan jumlah elemen yang terkandung dalam CollectionBase instans. Properti ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
InnerList

Mendapatkan yang ArrayList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
Item[Int32]

Mendapatkan atau mengatur CodeCatchClause objek pada indeks yang ditentukan dalam koleksi.

List

Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)

Metode

Nama Deskripsi
Add(CodeCatchClause)

Menambahkan objek yang ditentukan CodeCatchClause ke koleksi.

AddRange(CodeCatchClause[])

Menyalin elemen array yang ditentukan CodeCatchClause ke akhir koleksi.

AddRange(CodeCatchClauseCollection)

Menyalin isi objek lain CodeCatchClauseCollection ke akhir koleksi.

Clear()

Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
Contains(CodeCatchClause)

Mendapatkan nilai yang menunjukkan apakah koleksi berisi objek yang ditentukan CodeCatchClause .

CopyTo(CodeCatchClause[], Int32)

Menyalin objek koleksi ke instans satu dimensi Array yang dimulai pada indeks yang ditentukan.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetEnumerator()

Mengembalikan enumerator yang melakukan iterasi melalui CollectionBase instans.

(Diperoleh dari CollectionBase)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
IndexOf(CodeCatchClause)

Mendapatkan indeks objek yang ditentukan CodeCatchClause dalam koleksi, jika ada dalam koleksi.

Insert(Int32, CodeCatchClause)

Menyisipkan objek yang ditentukan CodeCatchClause ke dalam koleksi pada indeks yang ditentukan.

MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
OnClear()

Melakukan proses kustom tambahan saat menghapus konten instans CollectionBase .

(Diperoleh dari CollectionBase)
OnClearComplete()

Melakukan proses kustom tambahan setelah menghapus konten instans CollectionBase .

(Diperoleh dari CollectionBase)
OnInsert(Int32, Object)

Melakukan proses kustom tambahan sebelum memasukkan elemen baru ke CollectionBase dalam instans.

(Diperoleh dari CollectionBase)
OnInsertComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menyisipkan elemen baru ke CollectionBase dalam instans.

(Diperoleh dari CollectionBase)
OnRemove(Int32, Object)

Melakukan proses kustom tambahan saat menghapus elemen dari CollectionBase instans.

(Diperoleh dari CollectionBase)
OnRemoveComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menghapus elemen dari CollectionBase instans.

(Diperoleh dari CollectionBase)
OnSet(Int32, Object, Object)

Melakukan proses kustom tambahan sebelum mengatur nilai dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
OnSetComplete(Int32, Object, Object)

Melakukan proses kustom tambahan setelah menetapkan nilai dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
OnValidate(Object)

Melakukan proses kustom tambahan saat memvalidasi nilai.

(Diperoleh dari CollectionBase)
Remove(CodeCatchClause)

Menghapus objek yang ditentukan CodeCatchClause dari koleksi.

RemoveAt(Int32)

Menghapus elemen pada indeks instans yang CollectionBase ditentukan. Metode ini tidak dapat diganti.

(Diperoleh dari CollectionBase)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

Nama Deskripsi
ICollection.CopyTo(Array, Int32)

Menyalin seluruh CollectionBase ke satu dimensi Arrayyang kompatibel , dimulai pada indeks array target yang ditentukan.

(Diperoleh dari CollectionBase)
ICollection.IsSynchronized

Mendapatkan nilai yang menunjukkan apakah akses ke CollectionBase disinkronkan (utas aman).

(Diperoleh dari CollectionBase)
ICollection.SyncRoot

Mendapatkan objek yang dapat digunakan untuk menyinkronkan akses ke CollectionBase.

(Diperoleh dari CollectionBase)
IList.Add(Object)

Menambahkan objek ke akhir CollectionBase.

(Diperoleh dari CollectionBase)
IList.Contains(Object)

Menentukan apakah CollectionBase berisi elemen tertentu.

(Diperoleh dari CollectionBase)
IList.IndexOf(Object)

Mencari Object yang ditentukan dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam seluruh CollectionBase.

(Diperoleh dari CollectionBase)
IList.Insert(Int32, Object)

Menyisipkan elemen ke dalam CollectionBase pada indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.IsFixedSize

Mendapatkan nilai yang menunjukkan apakah CollectionBase memiliki ukuran tetap.

(Diperoleh dari CollectionBase)
IList.IsReadOnly

Mendapatkan nilai yang menunjukkan apakah CollectionBase bersifat baca-saja.

(Diperoleh dari CollectionBase)
IList.Item[Int32]

Mendapatkan atau mengatur elemen pada indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.Remove(Object)

Menghapus kemunculan pertama objek tertentu dari CollectionBase.

(Diperoleh dari CollectionBase)

Metode Ekstensi

Nama Deskripsi
AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi IEnumerable menjadi IQueryable.

Cast<TResult>(IEnumerable)

Melemparkan elemen IEnumerable ke jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen IEnumerable berdasarkan jenis tertentu.

Berlaku untuk

Lihat juga