Export (0) Print
Expand All

PrintProperty Class

When overridden in a derived class, represents a property (and the value of the property) of a printing system hardware or software component.

Namespace: System.Printing.IndexedProperties
Assembly: System.Printing (in system.printing.dll)

[SerializableAttribute] 
public ref class PrintProperty abstract : IDisposable, IDeserializationCallback
/** @attribute SerializableAttribute() */ 
public abstract class PrintProperty implements IDisposable, IDeserializationCallback
SerializableAttribute 
public abstract class PrintProperty implements IDisposable, IDeserializationCallback
Not applicable.

The following example shows how to use this class to discover at run time the properties, and the types of those properties, of a print system object, without using Reflection.


// 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();


System.Object
  System.Printing.IndexedProperties.PrintProperty
     Derived Classes

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft