PrintProperty Class

PrintProperty 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 MustInherit Class PrintProperty
	Implements IDisposable, IDeserializationCallback

NameDescription
System_CAPS_protmethodPrintProperty(String)

Initializes a new instance of the PrintProperty class.

NameDescription
System_CAPS_protpropertyIsDisposed

Gets or sets a value that indicates whether the object has been disposed.

System_CAPS_protpropertyIsInitialized

Gets or sets a value that indicates whether the object has been initialized.

System_CAPS_pubpropertyName

When overridden in a derived class, gets the name of the property that the object represents.

System_CAPS_pubpropertyValue

When overridden in a derived class, gets or sets the value of the property that the object represents.

NameDescription
System_CAPS_pubmethodDispose()

Releases all resources that are being used by the PrintProperty.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resource.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Enables a PrintProperty to attempt to free resources and to perform other cleanup operations before the PrintProperty is reclaimed by garbage collection.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodInternalDispose(Boolean)

Releases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resources.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodOnDeserialization(Object)

When overridden in a derived class, implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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

.NET Framework
Available since 3.0

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

Return to top
Show:
© 2016 Microsoft