PrintProperty Klasa

Definicja

Reprezentuje właściwość (i wartość właściwości) sprzętu systemu drukowania lub składnika oprogramowania.

public ref class PrintProperty abstract : IDisposable, System::Runtime::Serialization::IDeserializationCallback
[System.Serializable]
public abstract class PrintProperty : IDisposable, System.Runtime.Serialization.IDeserializationCallback
public abstract class PrintProperty : IDisposable, System.Runtime.Serialization.IDeserializationCallback
[<System.Serializable>]
type PrintProperty = class
    interface IDisposable
    interface IDeserializationCallback
type PrintProperty = class
    interface IDisposable
    interface IDeserializationCallback
Public MustInherit Class PrintProperty
Implements IDeserializationCallback, IDisposable
Dziedziczenie
PrintProperty
Pochodne
Atrybuty
Implementuje

Przykłady

W poniższym przykładzie pokazano, jak używać tej klasy do odnajdywania w czasie wykonywania właściwości i typów tych właściwości obiektu systemu wydruku bez użycia odbicia.


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

Konstruktory

PrintProperty(String)

Inicjuje nowe wystąpienie klasy PrintProperty.

Właściwości

IsDisposed

Pobiera lub ustawia wartość wskazującą, czy obiekt został usunięty.

IsInitialized

Pobiera lub ustawia wartość wskazującą, czy obiekt został zainicjowany.

Name

Po przesłonięciu w klasie pochodnej pobiera nazwę właściwości reprezentowanej przez obiekt.

Value

Po zastąpieniu w klasie pochodnej pobiera lub ustawia wartość właściwości reprezentowanej przez obiekt.

Metody

Dispose()

Zwalnia wszystkie zasoby używane przez program PrintProperty.

Dispose(Boolean)

Zwalnia niezarządzane zasoby, które są używane przez PrintProperty program i opcjonalnie zwalnia zarządzane zasoby.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
Finalize()

Umożliwia próbę PrintProperty zwolnienia zasobów i wykonania innych operacji oczyszczania przed odzyskaniem PrintProperty pamięci przez odzyskiwanie pamięci.

GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
InternalDispose(Boolean)

Zwalnia niezarządzane zasoby, które są używane przez PrintProperty program i opcjonalnie zwalnia zarządzane zasoby.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
OnDeserialization(Object)

Po zastąpieniu w klasie pochodnej implementuje ISerializable interfejs i zgłasza zdarzenie deserializacji po zakończeniu deserializacji.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy