PrintExtensionContext class

Applies to Windows only

Provides the context for the printer extension object.

Syntax


public static class PrintExtensionContext

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The PrintExtensionContext class has these types of members:

Methods

The PrintExtensionContext class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
FromDeviceId Gets the context for the printer extension object based on the DeviceInformation ID.

 

Remarks

The following JavaScript code snippet retrieves the PrinterExtensionContext using a DeviceInformation ID, and then uses the context to create a helper object:


// This function runs when the user taps the Back button
function getInkStatus(deviceInformationId) {
    var responseString;
    try {
        var context = Windows.Devices.Printers.Extensions.
            PrintExtensionContext.fromDeviceId(deviceInformationId);
        var helper = new Microsoft.Samples.Printing.WwaDca.
            PrintHelperClass(context);
        var responseString = helper.getInkLevel(1);
    } catch (e) {
        responseString = "deviceInformationId: " + deviceInformationId + 
            " Message: " + e.message;
    }
    return responseString
}


For more information about using the PrinterExtensionContext class, see the Windows Store device app for Printers whitepaper.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.Devices.Printers.Extensions
Windows::Devices::Printers::Extensions [C++]

Metadata

Windows.winmd

See also

DeviceInformation class
Windows Store device app for Printers

 

 

Show:
© 2014 Microsoft