Sample Code
Windows Driver Samples/ WSDMon Bidi Extension Sample/ C++/ WSDMon-Bidi-Extension.xml/
<?xml version='1.0'?> <bidi:Definition xmlns:bidi='http://schemas.microsoft.com/windows/2005/03/printing/bidi'> <!-- The schema extension below represents a fictitious printer named 'CustomPrinter', and contains further schema extensions for a fictitious lamination unit. --> <Schema xmlns:cp='http://www.microsoft.com/2013/04/customwsdprinter' xmlns:wprt='http://schemas.microsoft.com/windows/2006/08/wdp/print'> <Property name='CustomPrinter'> <!-- The schema extensions below represent a fictitious lamination unit that may be installed on the CustomPrinter. The extensions demonstrate various Bidi constructs and operations. --> <Property name='LaminationUnit'> <!-- Example of an 'Installed' construct: The 'Installed' construct is used to query if a printer feature is installed. In the below example, the 'Installed' construct queries the device to determine if a lamination unit is installed. --> <Installed name='Installed' query='cp:CustomPrinterConfiguration' filter='cp:CustomPrinterConfiguration/cp:Extensions[cp:Name="LaminationUnit"]' drvPrinterEvent='true' /> <!-- Example of a schema element that is read-only i.e. it's value can be retrieved via a Bidi 'Get' action. The 'Value' construct represents a query that retrieves data for the specified schema element. In the below example, the read-only 'pouch level' property is analogous to the ink level, and queries the number of lamination pouches remaining on the device --> <Value name='PouchLevel' type='BIDI_INT' query='cp:CustomPrinterConfiguration' filter='cp:CustomPrinterConfiguration/cp:LaminationUnit/cp:PouchLevel' drvPrinterEvent='true'/> <!-- Example of schema element that is write-only i.e. it's value can be set via a Bidi 'Set' action. The 'accessType' attribute indicates that the schema element's value can be set. In the below example, the \CustomPrinter.Maintenance:Clean schema provides a way to clean the lamination unit. Note: The Bidi 'Set' action is defined in WS Print v1.2, which must be supported by the device before this operation can complete successfully. --> <Property name='Maintenance'> <Value name='Clean' type='BIDI_BOOL' query='cp:CustomPrinterConfiguration' filter='cp:CustomPrinterConfiguration/cp:LaminationUnit/cp:Clean' drvPrinterEvent='true' accessType='Set' wsPrintVersion='1.2' /> </Property> <!-- Example of schema element that is read-write i.e. it's value can be retrieved via a Bidi 'Get' action, or can be set via a Bidi 'Set' action. The 'accessType' attribute indicates that the schema element's value can be either retrieved or set. In the below example, the \CustomPrinter.LaminationUnit.NumberPouchesUsed property defines how many pouches are used per lamination job. Note: The Bidi 'Set' action is defined in WS Print v1.2, which must be supported by the device before this operation can complete successfully. --> <Value name='NumberPouchesUsed' type='BIDI_INT' query='cp:CustomPrinterConfiguration' filter='cp:CustomPrinterConfiguration/cp:LaminationUnit/cp:NumberPouchesUsed' drvPrinterEvent='true' accessType='GetSet' wsPrintVersion='1.2' /> <!-- Example of a 'List' construct: This construct represents a string type that comprises a comma-separated list of values. In the below example, the query would result in a comma-separated list that contains the types of lamination pouches supported. --> <List name='SupportedPouchTypes' query='cp:CustomPrinterConfiguration' filter='cp:CustomPrinterConfiguration/cp:LaminationUnit/cp:SupportedPouchTypes'/> <!-- Example of a 'Const' construct: This construct is used for elements that don't change in value. The construct defines the data type and the value that must be returned. In the below example, the constant value 'Type' is set to 'ThermalLaminator', identifying the type of the lamination unit. It is presumed that this is the only type of unit supported by this driver, hence it is a constant value. --> <Const name='Type' type='BIDI_STRING'>ThermalLaminator</Const> </Property> </Property> </Schema> </bidi:Definition>
Our Services
-
What our customers say about us?
Read our customer testimonials to find out why our clients keep returning for their projects.
View Testimonials