DesignerVerbCollection Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mewakili kumpulan DesignerVerb objek.
public ref class DesignerVerbCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
public class DesignerVerbCollection : System.Collections.CollectionBase
public class DesignerVerbCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ComVisible(true)>]
type DesignerVerbCollection = class
inherit CollectionBase
type DesignerVerbCollection = class
inherit CollectionBase
Public Class DesignerVerbCollection
Inherits CollectionBase
- Warisan
- Turunan
- Atribut
Contoh
Contoh kode berikut menunjukkan cara menggunakan DesignerVerbCollection kelas . Contoh membuat instans baru kelas dan menggunakan beberapa metode untuk menambahkan pernyataan ke koleksi, mengembalikan indeksnya, dan menambahkan atau menghapus atribut pada titik indeks tertentu.
// Creates an empty DesignerVerbCollection.
DesignerVerbCollection^ collection = gcnew DesignerVerbCollection;
// Adds a DesignerVerb to the collection.
collection->Add( gcnew DesignerVerb( "Example designer verb",gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
// Adds an array of DesignerVerb objects to the collection.
array<DesignerVerb^>^ verbs = {
gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ),
gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) )};
collection->AddRange( verbs );
// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection^ verbsCollection = gcnew DesignerVerbCollection;
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
collection->AddRange( verbsCollection );
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb^ testVerb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
int itemIndex = -1;
if ( collection->Contains( testVerb ) )
itemIndex = collection->IndexOf( testVerb );
// Copies the contents of the collection, beginning at index 0,
// to the specified DesignerVerb array.
// 'verbs' is a DesignerVerb array.
collection->CopyTo( verbs, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Inserts a DesignerVerb at index 0 of the collection.
collection->Insert( 0, gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
// Removes the specified DesignerVerb from the collection.
DesignerVerb^ verb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
collection->Remove( verb );
// Removes the DesignerVerb at index 0.
collection->RemoveAt( 0 );
// Creates an empty DesignerVerbCollection.
DesignerVerbCollection collection = new DesignerVerbCollection();
// Adds a DesignerVerb to the collection.
collection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
// Adds an array of DesignerVerb objects to the collection.
DesignerVerb[] verbs = { new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)), new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) };
collection.AddRange( verbs );
// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection verbsCollection = new DesignerVerbCollection();
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
collection.AddRange( verbsCollection );
// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
itemIndex = collection.IndexOf( testVerb );
// Copies the contents of the collection, beginning at index 0,
// to the specified DesignerVerb array.
// 'verbs' is a DesignerVerb array.
collection.CopyTo( verbs, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a DesignerVerb at index 0 of the collection.
collection.Insert( 0, new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
// Removes the specified DesignerVerb from the collection.
DesignerVerb verb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
collection.Remove( verb );
// Removes the DesignerVerb at index 0.
collection.RemoveAt(0);
' Creates an empty DesignerVerbCollection.
Dim collection As New DesignerVerbCollection()
' Adds a DesignerVerb to the collection.
collection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
' Adds an array of DesignerVerb objects to the collection.
Dim verbs As DesignerVerb() = {New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)), New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))}
collection.AddRange(verbs)
' Adds a collection of DesignerVerb objects to the collection.
Dim verbsCollection As New DesignerVerbCollection()
verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
collection.AddRange(verbsCollection)
' Tests for the presence of a DesignerVerb in the collection,
' and retrieves its index if it is found.
Dim testVerb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))
Dim itemIndex As Integer = -1
If collection.Contains(testVerb) Then
itemIndex = collection.IndexOf(testVerb)
End If
' Copies the contents of the collection, beginning at index 0,
' to the specified DesignerVerb array.
' 'verbs' is a DesignerVerb array.
collection.CopyTo(verbs, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a DesignerVerb at index 0 of the collection.
collection.Insert(0, New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
' Removes the specified DesignerVerb from the collection.
Dim verb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))
collection.Remove(verb)
' Removes the DesignerVerb at index 0.
collection.RemoveAt(0)
Keterangan
Kelas ini menyediakan koleksi yang dapat berisi DesignerVerb objek.
Konstruktor
| Nama | Deskripsi |
|---|---|
| DesignerVerbCollection() |
Menginisialisasi instans baru dari kelas DesignerVerbCollection. |
| DesignerVerbCollection(DesignerVerb[]) |
Menginisialisasi instans DesignerVerbCollection baru kelas menggunakan array DesignerVerb objek yang ditentukan. |
Properti
| Nama | Deskripsi |
|---|---|
| Capacity |
Mendapatkan atau mengatur jumlah elemen yang dapat dikandung 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 pada DesignerVerb indeks yang ditentukan. |
| List |
Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans. (Diperoleh dari CollectionBase) |
Metode
| Nama | Deskripsi |
|---|---|
| Add(DesignerVerb) |
Menambahkan yang ditentukan DesignerVerb ke koleksi. |
| AddRange(DesignerVerb[]) |
Menambahkan kumpulan kata kerja perancang yang ditentukan ke koleksi. |
| AddRange(DesignerVerbCollection) |
Menambahkan kumpulan kata kerja perancang yang ditentukan ke koleksi. |
| Clear() |
Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa. (Diperoleh dari CollectionBase) |
| Contains(DesignerVerb) |
Mendapatkan nilai yang menunjukkan apakah yang ditentukan DesignerVerb ada dalam koleksi. |
| CopyTo(DesignerVerb[], Int32) |
Menyalin anggota koleksi ke array yang ditentukan DesignerVerb yang dimulai pada indeks tujuan 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(DesignerVerb) |
Mendapatkan indeks dari DesignerVerb. |
| Insert(Int32, DesignerVerb) |
Menyisipkan yang ditentukan DesignerVerb pada indeks yang ditentukan. |
| MemberwiseClone() |
Membuat salinan dangkal dari Objectsaat ini. (Diperoleh dari Object) |
| OnClear() |
Menaikkan |
| OnClearComplete() |
Melakukan proses kustom tambahan setelah menghapus konten instans CollectionBase . (Diperoleh dari CollectionBase) |
| OnInsert(Int32, Object) |
Menaikkan |
| OnInsertComplete(Int32, Object) |
Melakukan proses kustom tambahan setelah menyisipkan elemen baru ke CollectionBase dalam instans. (Diperoleh dari CollectionBase) |
| OnRemove(Int32, Object) |
Menaikkan |
| OnRemoveComplete(Int32, Object) |
Melakukan proses kustom tambahan setelah menghapus elemen dari CollectionBase instans. (Diperoleh dari CollectionBase) |
| OnSet(Int32, Object, Object) |
Menaikkan |
| OnSetComplete(Int32, Object, Object) |
Melakukan proses kustom tambahan setelah menetapkan nilai dalam CollectionBase instans. (Diperoleh dari CollectionBase) |
| OnValidate(Object) |
Menaikkan |
| Remove(DesignerVerb) |
Menghapus yang ditentukan DesignerVerb 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 yang ditentukan Object dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam seluruh CollectionBase. (Diperoleh dari CollectionBase) |
| IList.Insert(Int32, Object) |
Menyisipkan elemen ke CollectionBase dalam 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. |