5.1. StarNetworkManager
Class to set printer’s network settings.
Constructor
Name
Contents
Creates the instance.
Method
Name
Contents
Gets the value specified from the printer.
Set the specified value to the printer.
Supported Method for each models.
Model/Emulation |
mC-Print2 | mC-Print3 | mC-Label3 |
---|---|---|---|
StarPRNT | StarPRNT | StarPRNT | |
LoadAsync |
✔ | ✔ | ✔ |
ApplyAsync |
✔ | ✔ | ✔ |
5.1.1. StarNetworkManager
Creates the instance.
Declaration
public StarNetworkManager(string portName)
Parameter
Parameter
Contents
Type
portName
It is the same as the portName of the ConnectAsync method.
string
Return value
Contents
Type
StarNetworkManager object
Exception
Contents
Type
When a null to portName is passed
5.1.2. LoadAsync
Gets the value specified from the printer.
Declaration
public IAsyncOperation<StarNetworkSetting> LoadAsync()
Parameter
None
Return value
Contents
Type
Network Settings
Exception
Contents
Type
When port open failsWhen an incorrect portName is passedwhen a communication failure occurs
Examples
private async void LoadButton_Click(object sender, RoutedEventArgs e) { StarNetworkManager starNetworkManager = new StarNetworkManager(PortName.Text); StarNetworkSetting starNetworkSetting = new StarNetworkSetting(); try { starNetworkSetting = await starNetworkManager.LoadAsync(); } catch (StarIODeviceSettingException ex) { } }
Refer to StarIODeviceSettingSDK.
5.1.3. ApplyAsync
Set the specified value to the printer.
Important
The printer is reset after this method was executed.
Declaration
public IAsyncAction ApplyAsync(StarNetworkSetting setting)
Parameter
Name
Contents
Type
setting
Network Setting Information
Return value
None
Exception
Contents
Type
When port open failsWhen an incorrect portName is passedwhen a communication failure occurs
Examples
private async void ApplyButton_Click(object sender, RoutedEventArgs e) { StarNetworkManager starNetworkManager = new StarNetworkManager(PortName.Text); StarNetworkSetting starNetworkSetting = new StarNetworkSetting(); //Example) When setting to SteadyLanSetting to "Disable" starNetworkSetting.SteadyLan = SteadyLanSetting.Disable; try { await starNetworkManager.ApplyAsync(starNetworkSetting); } catch (StarIODeviceSettingException ex) { } }
Refer to StarIODeviceSettingSDK.