CodeTypeReferenceCollection 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 CodeTypeReference objek.
public ref class CodeTypeReferenceCollection : System::Collections::CollectionBase
public class CodeTypeReferenceCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeTypeReferenceCollection : System.Collections.CollectionBase
type CodeTypeReferenceCollection = class
inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeTypeReferenceCollection = class
inherit CollectionBase
Public Class CodeTypeReferenceCollection
Inherits CollectionBase
- Warisan
- Atribut
Contoh
// Creates an empty CodeTypeReferenceCollection.
CodeTypeReferenceCollection collection = new CodeTypeReferenceCollection();
// Adds a CodeTypeReference to the collection.
collection.Add( new CodeTypeReference(typeof(bool)) );
// Adds an array of CodeTypeReference objects to the collection.
CodeTypeReference[] references = { new CodeTypeReference(typeof(bool)), new CodeTypeReference(typeof(bool)) };
collection.AddRange( references );
// Adds a collection of CodeTypeReference objects to the collection.
CodeTypeReferenceCollection referencesCollection = new CodeTypeReferenceCollection();
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
collection.AddRange( referencesCollection );
// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
itemIndex = collection.IndexOf( testReference );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeTypeReference array.
// 'references' is a CodeTypeReference array.
collection.CopyTo( references, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert( 0, new CodeTypeReference(typeof(bool)) );
// Removes the specified CodeTypeReference from the collection.
CodeTypeReference reference = new CodeTypeReference(typeof(bool));
collection.Remove( reference );
// Removes the CodeTypeReference at index 0.
collection.RemoveAt(0);
' Creates an empty CodeTypeReferenceCollection.
Dim collection As New CodeTypeReferenceCollection()
' Adds a CodeTypeReference to the collection.
collection.Add(New CodeTypeReference(GetType(Boolean)))
' Adds an array of CodeTypeReference objects to the collection.
Dim references As CodeTypeReference() = {New CodeTypeReference(GetType(Boolean)), New CodeTypeReference(GetType(Boolean))}
collection.AddRange(references)
' Adds a collection of CodeTypeReference objects to the collection.
Dim referencesCollection As New CodeTypeReferenceCollection()
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
collection.AddRange(referencesCollection)
' Tests for the presence of a CodeTypeReference in the
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
itemIndex = collection.IndexOf(testReference)
End If
' Copies the contents of the collection, beginning at index 0,
' to the specified CodeTypeReference array.
' 'references' is a CodeTypeReference array.
collection.CopyTo(references, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert(0, New CodeTypeReference(GetType(Boolean)))
' Removes the specified CodeTypeReference from the collection.
Dim reference As New CodeTypeReference(GetType(Boolean))
collection.Remove(reference)
' Removes the CodeTypeReference at index 0.
collection.RemoveAt(0)
Keterangan
Kelas ini CodeTypeReferenceCollection menyediakan objek koleksi sederhana yang dapat digunakan untuk menyimpan sekumpulan CodeTypeReference objek.
Konstruktor
| Nama | Deskripsi |
|---|---|
| CodeTypeReferenceCollection() |
Menginisialisasi instans baru dari kelas CodeTypeReferenceCollection. |
| CodeTypeReferenceCollection(CodeTypeReference[]) |
Menginisialisasi instans baru kelas yang CodeTypeReferenceCollection berisi array CodeTypeReference objek yang ditentukan. |
| CodeTypeReferenceCollection(CodeTypeReferenceCollection) |
Menginisialisasi instans baru kelas yang CodeTypeReferenceCollection 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 CodeTypeReference pada indeks yang ditentukan dalam koleksi. |
| List |
Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans. (Diperoleh dari CollectionBase) |
Metode
| Nama | Deskripsi |
|---|---|
| Add(CodeTypeReference) |
Menambahkan yang ditentukan CodeTypeReference ke koleksi. |
| Add(String) |
CodeTypeReference Menambahkan ke koleksi menggunakan nama tipe data yang ditentukan. |
| Add(Type) |
CodeTypeReference Menambahkan ke koleksi menggunakan tipe data yang ditentukan. |
| AddRange(CodeTypeReference[]) |
Menyalin elemen array yang ditentukan CodeTypeReference ke akhir koleksi. |
| AddRange(CodeTypeReferenceCollection) |
Menambahkan konten yang ditentukan CodeTypeReferenceCollection ke akhir koleksi. |
| Clear() |
Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa. (Diperoleh dari CollectionBase) |
| Contains(CodeTypeReference) |
Mendapatkan nilai yang menunjukkan apakah koleksi berisi CodeTypeReference. |
| CopyTo(CodeTypeReference[], Int32) |
Menyalin item dalam koleksi ke satu dimensi Array yang ditentukan 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(CodeTypeReference) |
Mendapatkan indeks dalam kumpulan CodeTypeReference, jika ada dalam koleksi. |
| Insert(Int32, CodeTypeReference) |
CodeTypeReference Menyisipkan 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(CodeTypeReference) |
Menghapus yang ditentukan CodeTypeReference 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. |