PrintSystemObject.PropertiesCollection 속성

정의

특성 및 값 쌍 컬렉션을 가져옵니다.

public:
 property System::Printing::IndexedProperties::PrintPropertyDictionary ^ PropertiesCollection { System::Printing::IndexedProperties::PrintPropertyDictionary ^ get(); };
public System.Printing.IndexedProperties.PrintPropertyDictionary PropertiesCollection { get; }
member this.PropertiesCollection : System.Printing.IndexedProperties.PrintPropertyDictionary
Public ReadOnly Property PropertiesCollection As PrintPropertyDictionary

속성 값

PrintPropertyDictionary

특성 및 값 쌍이 들어 있는 PrintPropertyDictionary입니다.

예제

다음 예제에서는 리플렉션을 사용하지 않고 런타임에 이 속성을 사용하여 인쇄 시스템 개체의 속성 및 해당 속성의 형식을 검색하는 방법을 보여 있습니다.


// Enumerate the properties, and their types, of a queue without using Reflection
LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue defaultPrintQueue = LocalPrintServer.GetDefaultPrintQueue();

PrintPropertyDictionary printQueueProperties = defaultPrintQueue.PropertiesCollection;

Console.WriteLine("These are the properties, and their types, of {0}, a {1}", defaultPrintQueue.Name, defaultPrintQueue.GetType().ToString() +"\n");

foreach (DictionaryEntry entry in printQueueProperties)
{
    PrintProperty property = (PrintProperty)entry.Value;

    if (property.Value != null)
    {
        Console.WriteLine(property.Name + "\t(Type: {0})", property.Value.GetType().ToString());
    }
}
Console.WriteLine("\n\nPress Return to continue...");
Console.ReadLine();

' Enumerate the properties, and their types, of a queue without using Reflection
Dim localPrintServer As New LocalPrintServer()
Dim defaultPrintQueue As PrintQueue = LocalPrintServer.GetDefaultPrintQueue()

Dim printQueueProperties As PrintPropertyDictionary = defaultPrintQueue.PropertiesCollection

Console.WriteLine("These are the properties, and their types, of {0}, a {1}", defaultPrintQueue.Name, defaultPrintQueue.GetType().ToString() + vbLf)

For Each entry As DictionaryEntry In printQueueProperties
    Dim [property] As PrintProperty = CType(entry.Value, PrintProperty)

    If [property].Value IsNot Nothing Then
        Console.WriteLine([property].Name & vbTab & "(Type: {0})", [property].Value.GetType().ToString())
    End If
Next entry
Console.WriteLine(vbLf & vbLf & "Press Return to continue...")
Console.ReadLine()

적용 대상