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: 3.0.3271
Syntax
public class SettingsSetter

The SettingsSetter type exposes the following members.

Constructors
 NameDescription
Public methodSettingsSetterInitializes a new instance of the SettingsSetter class
Top
Methods
 NameDescription
Public methodEquals
(Inherited from Object)
Public methodGetHashCode
(Inherited from Object)
Public methodGetType
(Inherited from Object)
Public methodStatic memberProcess Sends the settingsToSet to the destinationDevice and then returns the updated setting values.
Public methodToString
(Inherited from Object)
Top
Remarks
Settings commands are accepted by Link-OS printers, version 1.0 and higher.
Example
C#
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