SettingsSetter Class |
Namespace: Zebra.Sdk.Printer
The SettingsSetter type exposes the following members.
Name | Description | |
---|---|---|
SettingsSetter | Initializes a new instance of the SettingsSetter class |
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Process |
Sends the settingsToSet to the destinationDevice and then returns the updated setting values.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
using System; using System.Collections.Generic; using Zebra.Sdk.Comm; using Zebra.Sdk.Printer; using Zebra.Sdk.Settings; public class SettingsSetterExample { public static void Main(string[] args) { string ipAddress = "192.168.1.100"; Dictionary<string, string> settingsToSendToThePrinter = new Dictionary<string, string> { // Pass in a null as the second parameter to retrieve the setting { "device.friendly_name", null }, // Pass in a value as the second parameter to set the setting { "comm.baud", "14400" } }; // The map containing the results to each settings command Dictionary<string, string> results = null; try { results = SettingsSetter.Process(ipAddress, settingsToSendToThePrinter); } catch (ConnectionException e) { Console.WriteLine(e.ToString()); } catch (SettingsException e) { Console.WriteLine(e.ToString()); } foreach (KeyValuePair<string, string> entry in results) { Console.WriteLine($"The setting {entry.Key} returned {entry.Value}."); } } }