PrinterSettings.PaperSizeCollection 클래스

정의

PaperSize 개체의 컬렉션을 포함합니다.

public: ref class PrinterSettings::PaperSizeCollection : System::Collections::ICollection
public class PrinterSettings.PaperSizeCollection : System.Collections.ICollection
type PrinterSettings.PaperSizeCollection = class
    interface ICollection
    interface IEnumerable
Public Class PrinterSettings.PaperSizeCollection
Implements ICollection
상속
PrinterSettings.PaperSizeCollection
구현

예제

다음 코드 예제에서는 프린터의 comboPaperSize 지원되는 용지 크기로 콤보 상자를 채웁니다. 또한 사용자 지정 용지 크기가 만들어지고 콤보 상자에 추가됩니다. PaperName 콤보 상자의 속성을 통해 추가되는 항목에 대한 표시 문자열을 DisplayMember 제공하는 속성으로 식별됩니다. 이 예제에서는 명명 printDocPrintDocument 변수가 존재하고 특정 콤보 상자가 있어야 합니다.

// Add list of supported paper sizes found on the printer.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSize->DisplayMember = "PaperName";
PaperSize^ pkSize;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSizes->Count; i++ )
{
   pkSize = printDoc->PrinterSettings->PaperSizes[ i ];
   comboPaperSize->Items->Add( pkSize );
}

// Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
PaperSize^ pkCustomSize1 = gcnew PaperSize( "First custom size",100,200 );
comboPaperSize->Items->Add( pkCustomSize1 );
// Add list of supported paper sizes found on the printer. 
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSize.DisplayMember = "PaperName";

PaperSize pkSize;
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++){
    pkSize = printDoc.PrinterSettings.PaperSizes[i];
    comboPaperSize.Items.Add(pkSize);
}

// Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
PaperSize pkCustomSize1 = new PaperSize("First custom size", 100, 200);

comboPaperSize.Items.Add(pkCustomSize1);
' Add list of supported paper sizes found on the printer. 
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSize.DisplayMember = "PaperName"

Dim pkSize As PaperSize
For i = 0 to printDoc.PrinterSettings.PaperSizes.Count - 1
    pkSize = printDoc.PrinterSettings.PaperSizes.Item(i)
    comboPaperSize.Items.Add(pkSize)
Next

' Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
Dim pkCustomSize1 As New PaperSize("Custom Paper Size", 100, 200)

comboPaperSize.Items.Add(pkCustomSize1)

설명

PrinterSettings.PaperSizeCollection 중 하나를 포함하는 속성을 통해 PaperSize.Kind 용지 크기를 나타내는 인스턴스를 PaperKind 포함합니다PaperSize.

일반적으로 속성을 통해 페이지의 용지 크기를 컬렉션을 통해 PageSettings.PaperSize 사용할 수 있는 유효한 PaperSize 인스턴스로 PaperSizes 설정합니다.

PaperSize 사용자 지정 용지 크기를 지정하는 방법을 알아보려면 생성자를 참조하세요.

생성자

PrinterSettings.PaperSizeCollection(PaperSize[])

PrinterSettings.PaperSizeCollection 클래스의 새 인스턴스를 초기화합니다.

속성

Count

컬렉션에 있는 다른 용지 크기의 수를 가져옵니다.

Item[Int32]

지정된 인덱스에 해당하는 PaperSize을 가져옵니다.

메서드

Add(PaperSize)

PrinterResolution을 컬렉션의 끝에 추가합니다.

CopyTo(PaperSize[], Int32)

지정된 인덱스에서 시작하여 현재 PrinterSettings.PaperSizeCollection의 내용을 지정된 배열에 복사합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

컬렉션을 반복할 수 있는 열거자를 반환합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

이 멤버에 대한 설명은 CopyTo(Array, Int32)를 참조하세요.

ICollection.Count

이 멤버에 대한 설명은 Count를 참조하세요.

ICollection.IsSynchronized

이 멤버에 대한 설명은 IsSynchronized를 참조하세요.

ICollection.SyncRoot

이 멤버에 대한 설명은 SyncRoot를 참조하세요.

IEnumerable.GetEnumerator()

이 멤버에 대한 설명은 GetEnumerator()를 참조하세요.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보