PrinterSettings.PaperSourceCollection Klasa

Definicja

Zawiera kolekcję PaperSource obiektów.

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
Dziedziczenie
PrinterSettings.PaperSourceCollection
Implementuje

Przykłady

Poniższy przykład kodu wypełnia comboPaperSource pole kombi obsługiwanymi źródłami papieru drukarki. Element SourceName jest identyfikowany jako właściwość, która udostępnia ciąg wyświetlania elementu dodawanego za pośrednictwem DisplayMember właściwości pola kombi. Przykład wymaga, aby zmienna PrintDocument o nazwie printDoc istnieje i że istnieje określone pole kombi.

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

Uwagi

PaperSource Zawiera PrinterSettings.PaperSourceCollection wystąpienia reprezentujące zasobniki źródła papieru za pośrednictwem PaperSource.Kind właściwości, która zawiera jedną z PaperSourceKind wartości.

Zazwyczaj można ustawić źródło papieru strony za pośrednictwem PageSettings.PaperSource właściwości na prawidłowe PaperSource wystąpienie dostępne za pośrednictwem PaperSources kolekcji.

Konstruktory

PrinterSettings.PaperSourceCollection(PaperSource[])

Inicjuje nowe wystąpienie klasy PrinterSettings.PaperSourceCollection.

Właściwości

Count

Pobiera liczbę różnych źródeł papieru w kolekcji.

Item[Int32]

Pobiera element PaperSource w określonym indeksie.

Metody

Add(PaperSource)

Dodaje określony PaperSource element na końcu elementu PrinterSettings.PaperSourceCollection.

CopyTo(PaperSource[], Int32)

Kopiuje zawartość bieżącej do PrinterSettings.PaperSourceCollection określonej tablicy, zaczynając od określonego indeksu.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetEnumerator()

Zwraca moduł wyliczający, który może wykonać iterację kolekcji.

GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

ICollection.CopyTo(Array, Int32)

Aby uzyskać opis tego elementu członkowskiego, zobacz CopyTo(Array, Int32).

ICollection.Count

Aby uzyskać opis tego elementu członkowskiego, zobacz Count.

ICollection.IsSynchronized

Aby uzyskać opis tego elementu członkowskiego, zobacz IsSynchronized.

ICollection.SyncRoot

Aby uzyskać opis tego elementu członkowskiego, zobacz SyncRoot.

IEnumerable.GetEnumerator()

Ten interfejs API obsługuje infrastrukturę produktu i nie jest przeznaczony do użycia bezpośrednio z poziomu kodu.

Aby uzyskać opis tego elementu członkowskiego, zobacz GetEnumerator().

Metody rozszerzania

Cast<TResult>(IEnumerable)

Rzutuje elementy elementu IEnumerable do określonego typu.

OfType<TResult>(IEnumerable)

Filtruje elementy elementu IEnumerable na podstawie określonego typu.

AsParallel(IEnumerable)

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)

Konwertuje element IEnumerable na .IQueryable

Dotyczy

Zobacz też