PrinterSettings.PaperSourceCollection Kelas

Definisi

Berisi kumpulan PaperSource objek.

public: ref class PrinterSettings::PaperSourceCollection : System::Collections::ICollection
public class PrinterSettings.PaperSourceCollection : System.Collections.ICollection
type PrinterSettings.PaperSourceCollection = class
    interface ICollection
    interface IEnumerable
Public Class PrinterSettings.PaperSourceCollection
Implements ICollection
Warisan
PrinterSettings.PaperSourceCollection
Penerapan

Contoh

Contoh kode berikut mengisi kotak comboPaperSource kombo dengan sumber kertas yang didukung printer. SourceName diidentifikasi sebagai properti yang menyediakan string tampilan untuk item yang ditambahkan melalui DisplayMember properti kotak kombo. Contohnya mengharuskan PrintDocument variabel bernama printDoc ada dan bahwa kotak kombo tertentu ada.

// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSource->DisplayMember = "SourceName";
PaperSource^ pkSource;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSources->Count; i++ )
{
   pkSource = printDoc->PrinterSettings->PaperSources[ i ];
   comboPaperSource->Items->Add( pkSource );
}
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember="SourceName";

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
    pkSource = printDoc.PrinterSettings.PaperSources[i];
    comboPaperSource.Items.Add(pkSource);
}
' Add list of paper sources found on the printer to the combo box.
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember = "SourceName"

Dim pkSource As PaperSource
For i = 0 to printDoc.PrinterSettings.PaperSources.Count - 1
    pkSource = printDoc.PrinterSettings.PaperSources.Item(i)
    comboPaperSource.Items.Add(pkSource)
Next

Keterangan

berisi PrinterSettings.PaperSourceCollectionPaperSource instans yang mewakili baki sumber kertas melalui PaperSource.Kind properti , yang berisi salah PaperSourceKind satu nilai.

Biasanya, Anda mengatur sumber kertas halaman melalui PageSettings.PaperSource properti ke instans valid yang PaperSource tersedia melalui PaperSources koleksi.

Konstruktor

PrinterSettings.PaperSourceCollection(PaperSource[])

Menginisialisasi instans baru kelas PrinterSettings.PaperSourceCollection.

Properti

Count

Mendapatkan jumlah sumber kertas yang berbeda dalam koleksi.

Item[Int32]

Mendapatkan pada PaperSource indeks tertentu.

Metode

Add(PaperSource)

Menambahkan yang ditentukan PaperSource ke akhir PrinterSettings.PaperSourceCollection.

CopyTo(PaperSource[], Int32)

Menyalin konten saat ini PrinterSettings.PaperSourceCollection ke array yang ditentukan, dimulai dari indeks yang ditentukan.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetEnumerator()

Mengembalikan enumerator yang dapat melakukan iterasi melalui koleksi.

GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

ICollection.CopyTo(Array, Int32)

Untuk deskripsi anggota ini, lihat CopyTo(Array, Int32).

ICollection.Count

Untuk deskripsi anggota ini, lihat Count.

ICollection.IsSynchronized

Untuk deskripsi anggota ini, lihat IsSynchronized.

ICollection.SyncRoot

Untuk deskripsi anggota ini, lihat SyncRoot.

IEnumerable.GetEnumerator()

API ini mendukung infrastruktur produk dan tidak dimaksudkan untuk digunakan langsung dari kode Anda.

Untuk deskripsi anggota ini, lihat GetEnumerator().

Metode Ekstensi

Cast<TResult>(IEnumerable)

Mentransmisikan elemen dari IEnumerable ke jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen berdasarkan IEnumerable jenis tertentu.

AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi menjadi IEnumerableIQueryable.

Berlaku untuk

Lihat juga