CodeNamespaceImportCollection Kelas

Definisi

Mewakili kumpulan CodeNamespaceImport objek.

public ref class CodeNamespaceImportCollection : System::Collections::IList
public class CodeNamespaceImportCollection : System.Collections.IList
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeNamespaceImportCollection : System.Collections.IList
type CodeNamespaceImportCollection = class
    interface ICollection
    interface IEnumerable
    interface IList
type CodeNamespaceImportCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeNamespaceImportCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class CodeNamespaceImportCollection
Implements IList
Warisan
CodeNamespaceImportCollection
Atribut
Penerapan

Contoh

Contoh berikut menunjukkan beberapa anggota CodeNamespaceImportCollection kelas. Contoh ini menginisialisasi instans CodeNamespaceImport baru kelas, menambahkan objek ke dalamnya, dan mendapatkan jumlah total objek dalam koleksi.

// Creates an empty CodeNamespaceImportCollection.
CodeNamespaceImportCollection^ collection =
   gcnew CodeNamespaceImportCollection;

// Adds a CodeNamespaceImport to the collection.
collection->Add( gcnew CodeNamespaceImport( "System" ) );

// Adds an array of CodeNamespaceImport objects to the collection.
array<CodeNamespaceImport^>^ Imports = {
   gcnew CodeNamespaceImport( "System" ),
   gcnew CodeNamespaceImport( "System.Drawing" )};
collection->AddRange( Imports );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Creates an empty CodeNamespaceImportCollection.
CodeNamespaceImportCollection collection =
    new CodeNamespaceImportCollection();            			

// Adds a CodeNamespaceImport to the collection.
collection.Add( new CodeNamespaceImport("System") );

// Adds an array of CodeNamespaceImport objects to the collection.
CodeNamespaceImport[] Imports = {
        new CodeNamespaceImport("System"),
        new CodeNamespaceImport("System.Drawing") };
collection.AddRange( Imports );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
' Creates an empty CodeNamespaceImportCollection.
Dim collection As New CodeNamespaceImportCollection()

' Adds a CodeNamespaceImport to the collection.
collection.Add(New CodeNamespaceImport("System"))

' Adds an array of CodeNamespaceImport objects to the collection.
Dim [Imports] As CodeNamespaceImport() = _
    {New CodeNamespaceImport("System"), _
    New CodeNamespaceImport("System.Drawing")}
collection.AddRange([Imports])

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

Keterangan

Kelas ini CodeNamespaceImportCollection menyediakan objek koleksi sederhana yang dapat digunakan untuk menyimpan sekumpulan CodeNamespaceImport objek.

Konstruktor

CodeNamespaceImportCollection()

Menginisialisasi instans baru kelas CodeNamespaceImportCollection.

Properti

Count

Mendapatkan jumlah namespace dalam koleksi.

Item[Int32]

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

Metode

Add(CodeNamespaceImport)

CodeNamespaceImport Menambahkan objek ke koleksi.

AddRange(CodeNamespaceImport[])

Menambahkan sekumpulan CodeNamespaceImport objek ke koleksi.

Clear()

Menghapus kumpulan anggota.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetEnumerator()

Mendapatkan enumerator yang menghitung anggota koleksi.

GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

ICollection.CopyTo(Array, Int32)

Menyalin elemen ICollection ke Array, dimulai dari indeks tertentu Array .

ICollection.Count

Mendapatkan jumlah elemen yang terkandung dalam ICollection.

ICollection.IsSynchronized

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

ICollection.SyncRoot

Mendapatkan objek yang dapat digunakan untuk menyinkronkan akses ke ICollection.

IEnumerable.GetEnumerator()

Mengembalikan enumerator yang dapat melakukan iterasi melalui koleksi.

IList.Add(Object)

Menambahkan objek ke IList.

IList.Clear()

Menghapus semua item dari IList.

IList.Contains(Object)

Menentukan apakah IList berisi nilai tertentu.

IList.IndexOf(Object)

Menentukan indeks item tertentu di IList.

IList.Insert(Int32, Object)

Sisipkan item pada IList posisi yang ditentukan.

IList.IsFixedSize

Mendapatkan nilai yang menunjukkan apakah IList memiliki ukuran tetap.

IList.IsReadOnly

Mendapatkan nilai yang menunjukkan apakah IList bersifat baca-saja.

IList.Item[Int32]

Mendapatkan atau mengatur elemen pada indeks yang ditentukan.

IList.Remove(Object)

Menghapus kemunculan pertama objek tertentu dari IList.

IList.RemoveAt(Int32)

Menghapus elemen pada indeks yang ditentukan dari IList.

Metode Ekstensi

Cast<TResult>(IEnumerable)

Mentransmisikan elemen dari ke IEnumerable jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen berdasarkan IEnumerable jenis yang ditentukan.

AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi menjadi IEnumerableIQueryable.

Berlaku untuk

Lihat juga