JobControlProvider Interface |
Namespace: Zebra.Sdk.Card.Job
The JobControlProvider type exposes the following members.
Name | Description | |
---|---|---|
GetAllJobSettings |
Retrieve all settings and their attributes.
| |
GetAllJobSettingValues |
Retrieves all of the device's setting values.
| |
GetJobSettingRange |
Retrieves the allowable range for a setting.
| |
GetJobSettings |
Retrieve all of the setting identifiers for a device.
| |
GetJobSettingsValues |
Retrieves the device's setting values for a list of setting IDs.
| |
GetJobSettingType |
Returns the data type of the setting.
| |
GetJobSettingValue |
Retrieves the device's setting value for a setting ID.
| |
IsJobSettingReadOnly |
Returns true if the setting is read only.
| |
IsJobSettingValid |
Returns true if value is valid for the given setting.
| |
IsJobSettingWriteOnly |
Returns true if the setting is write only.
| |
SetJobSetting |
Sets the setting to the given value.
| |
SetJobSettings |
Set more than one setting.
|
using System; using System.Collections.Generic; using Zebra.Sdk.Card.Printer; using Zebra.Sdk.Card.Printer.Discovery; using Zebra.Sdk.Comm; using Zebra.Sdk.Printer.Discovery; public class JobControlProviderExample { public static void Main(string[] args) { Connection connection = null; ZebraCardPrinter zebraCardPrinter = null; try { foreach (DiscoveredUsbPrinter usbPrinter in UsbDiscoverer.GetZebraUsbPrinters(new ZebraCardPrinterFilter())) { connection = usbPrinter.GetConnection(); connection.Open(); zebraCardPrinter = ZebraCardPrinterFactory.GetInstance(connection); DisplayJobSettings(zebraCardPrinter); CloseQuietly(connection, zebraCardPrinter); } } catch (Exception e) { Console.WriteLine($"Error retrieving job settings: {e.Message}"); } finally { CloseQuietly(connection, zebraCardPrinter); } } - #region JobSettings /// <exception cref="ArgumentException"></exception> /// <exception cref="ConnectionException"></exception> /// <exception cref="System.IO.IOException"></exception> /// <exception cref="Zebra.Sdk.Settings.SettingsException"></exception> /// <exception cref="Zebra.Sdk.Card.Exceptions.ZebraCardException"></exception> private static void DisplayJobSettings(ZebraCardPrinter zebraCardPrinter) { if (zebraCardPrinter != null) { Console.WriteLine("Available Job Settings for myDevice:"); HashSet<string> availableJobSettings = zebraCardPrinter.GetJobSettings(); foreach (string setting in availableJobSettings) { Console.WriteLine($"{setting}: Range = ({zebraCardPrinter.GetJobSettingRange(setting)})"); } Console.WriteLine("\nCurrent Job Setting Values for myDevice:"); Dictionary<string, string> allJobSettingValues = zebraCardPrinter.GetAllJobSettingValues(); foreach (string settingName in allJobSettingValues.Keys) { Console.WriteLine($"{settingName}:{allJobSettingValues[settingName]}"); } } } #endregion JobSettings - #region CleanUp private static void CloseQuietly(Connection connection, ZebraCardPrinter zebraCardPrinter) { try { if (zebraCardPrinter != null) { zebraCardPrinter.Destroy(); } if (connection != null) { connection.Close(); } } catch { } } #endregion CleanUp }