PrintProperty PrintProperty PrintProperty PrintProperty Class

定義

表示列印系統硬體或軟體元件的屬性 (和屬性的值)。Represents a property (and the value of the property) of a printing system hardware or software component.

public ref class PrintProperty abstract : IDisposable, System::Runtime::Serialization::IDeserializationCallback
[System.Serializable]
public abstract class PrintProperty : IDisposable, System.Runtime.Serialization.IDeserializationCallback
type PrintProperty = class
    interface IDisposable
    interface IDeserializationCallback
Public MustInherit Class PrintProperty
Implements IDeserializationCallback, IDisposable
繼承
PrintPropertyPrintPropertyPrintPropertyPrintProperty
衍生
屬性
實作

範例

下列範例示範如何使用這個類別來探索在執行階段的屬性和類型的列印系統物件,這些屬性,而不使用反映。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();


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

建構函式

PrintProperty(String) PrintProperty(String) PrintProperty(String) PrintProperty(String)

初始化 PrintProperty 類別的新執行個體。Initializes a new instance of the PrintProperty class.

屬性

IsDisposed IsDisposed IsDisposed IsDisposed

取得或設定值,這個值,指出是否已經處置物件。Gets or sets a value that indicates whether the object has been disposed.

IsInitialized IsInitialized IsInitialized IsInitialized

取得或設定值,這個值,指出物件是否已初始化。Gets or sets a value that indicates whether the object has been initialized.

Name Name Name Name

當在衍生類別中覆寫時,取得該物件所代表之屬性的名稱。When overridden in a derived class, gets the name of the property that the object represents.

Value Value Value Value

當在衍生類別中覆寫時,取得或設定物件所表示之屬性的值。When overridden in a derived class, gets or sets the value of the property that the object represents.

方法

Dispose() Dispose() Dispose() Dispose()

正在使用的資源全部釋出PrintPropertyReleases all resources that are being used by the PrintProperty.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 unmanaged 的資源所使用的PrintProperty並選擇性地釋放 managed 的資源。Releases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resource.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

可讓PrintProperty嘗試釋放資源並執行其他清除作業後的PrintProperty記憶體回收 (gc) 回收。Enables a PrintProperty to attempt to free resources and to perform other cleanup operations before the PrintProperty is reclaimed by garbage collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InternalDispose(Boolean) InternalDispose(Boolean) InternalDispose(Boolean) InternalDispose(Boolean)

釋放 unmanaged 的資源所使用的PrintProperty並選擇性地釋放 managed 的資源。Releases the unmanaged resources that are being used by the PrintProperty and optionally releases the managed resources.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnDeserialization(Object) OnDeserialization(Object) OnDeserialization(Object) OnDeserialization(Object)

當在衍生類別中覆寫時,會實作ISerializable介面,並引發還原序列化事件還原序列化完成時。When overridden in a derived class, implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於