Click or drag to resize

SettingsSetter Class

A utility class used to wrap with a map and send settings commands to a connection.
Inheritance Hierarchy
SystemObject
  Zebra.Sdk.PrinterSettingsSetter

Namespace:  Zebra.Sdk.Printer
Assembly:  SdkApi_Core (in SdkApi_Core.dll) Version: 2.13.898
Syntax
public class SettingsSetter

The SettingsSetter type exposes the following members.

Constructors
  NameDescription
Public methodSettingsSetter
Initializes a new instance of the SettingsSetter class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberProcess
Sends the settingsToSet to the destinationDevice and then returns the updated setting values.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
Settings commands are accepted by Link-OS printers, version 1.0 and higher.
Examples
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}.");
        }
    }
}
See Also