Export (0) Print
Expand All

PrintProperty Class

Represents a property (and the value of the property) of a printing system hardware or software component.

System.Object
  System.Printing.IndexedProperties.PrintProperty
    More...

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

'Declaration
<SerializableAttribute> _
Public MustInherit Class PrintProperty _
	Implements IDisposable, IDeserializationCallback

The PrintProperty type exposes the following members.

  NameDescription
Protected methodPrintPropertyInitializes a new instance of the PrintProperty class.
Top

  NameDescription
Protected propertyIsDisposedGets or sets a value that indicates whether the object has been disposed.
Protected propertyIsInitializedGets or sets a value that indicates whether the object has been initialized.
Public propertyNameWhen overridden in a derived class, gets the name of the property that the object represents.
Public propertyValueWhen overridden in a derived class, gets or sets the value of the property that the object represents.
Top

  NameDescription
Public methodDisposeReleases all resources that are being used by the PrintProperty.
Protected methodDispose(Boolean)Releases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resource.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeEnables a PrintProperty to attempt to free resources and to perform other cleanup operations before the PrintProperty is reclaimed by garbage collection. (Overrides Object.Finalize.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodInternalDisposeReleases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resources.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnDeserializationWhen overridden in a derived class, implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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

Show:
© 2015 Microsoft