public void startRunning(Form parent = null) { settings = (BarcodeScannerSettings)XMLConfigHandler.ReadConfig(typeof(BarcodeScannerSettings)); if (settings.prefix == 'A') { firstChar = ']'; //AIM code } else { firstChar = settings.prefix; } if (settings.suffix == 'E') { lastChar = '\r'; } else { lastChar = settings.suffix; } if (parent != null && settings.readFrom.Equals("Keyboard")) { // Read input from the keyboard parent.KeyPreview = true; parent.KeyPress += HandleKeyPress; } else { backgroundWorker1.RunWorkerAsync(); } }
public bool SaveSettings() { var settings = new LabelPrinterSettings(); settings.printerName = cmboBxPrinter.Text; settings.labelFolder = txtFolder.Text; return(XMLConfigHandler.SaveConfig(settings)); }
public bool SaveSettings() { var settings = new DBSettings(); settings.DBServer = txtDBHost.Text; settings.DBUser = txtDBUser.Text; settings.DBPassword = CryptoSystem.Encrypt(txtDBPassword.Text); return(XMLConfigHandler.SaveConfig(settings)); }
public static ScaleReader GetScaleReader() { var s = (ScaleSettings)XMLConfigHandler.ReadConfig(typeof(ScaleSettings)); var scaleTypes = GetScaleTypes(); var scaleInfo = scaleTypes.Find(si => si.scaleType.Equals(s.scaleType)); var sr = (ScaleReader)Activator.CreateInstance(scaleInfo.objType); sr.settings = s; return(sr); }
public SAPSettingsCntrl() { InitializeComponent(); var settings = (SAPSettings)XMLConfigHandler.ReadConfig(typeof(SAPSettings)); if (settings != null) { UpdateComponents(settings); } }
public static bool Initialise() { settings = (DBSettings)XMLConfigHandler.ReadConfig(typeof(DBSettings)); if (settings == null) { MessageLogger.Add("Error ready DBSettings.XML", MessageLogger.MsgLevel.error); return(false); } return(true); }
public bool SaveSettings() { var s = new SAPSettings(); s.hostname = txtSAPHost.Text; s.user = txtSAPUser.Text; s.password = CryptoSystem.Encrypt(txtSAPPassword.Text); s.client = txtSAPClient.Text; s.device = txtDevice.Text; return(XMLConfigHandler.SaveConfig(s)); }
public LabelPrinterSettingsCntrl() { InitializeComponent(); GetPrinterNames(); var settings = (LabelPrinterSettings)XMLConfigHandler.ReadConfig(typeof(LabelPrinterSettings)); if (settings != null) { UpdateComponents(settings); } }
public DBSettingsCntrl() { InitializeComponent(); DBSettings s = (DBSettings)XMLConfigHandler.ReadConfig(typeof(DBSettings)); if (s != null) { txtDBHost.Text = s.DBServer; txtDBUser.Text = s.DBUser; txtDBPassword.Text = CryptoSystem.Decrypt(s.DBPassword); } }
public BarcodeScannerSettingsCntrl() { InitializeComponent(); GetStopBitsValues(); GetParityValues(); var settings = (BarcodeScannerSettings)XMLConfigHandler.ReadConfig(typeof(BarcodeScannerSettings)); if (settings != null) { UpdateComponents(settings); } }
public ScaleSettingsCntrl() { InitializeComponent(); scaleTypes = ScaleReader.GetScaleTypes(); GetScaleTypeValues(); GetStopBitsValues(); GetParityValues(); ScaleSettings settings = (ScaleSettings)XMLConfigHandler.ReadConfig(typeof(ScaleSettings)); if (settings != null) { UpdateComponents(settings); } }
public bool SaveSettings() { var settings = new BarcodeScannerSettings(); if (cmboBxPrefix.Text.Length > 0) { settings.prefix = cmboBxPrefix.Text[0]; } if (cmboBxSuffix.Text.Length > 0) { settings.suffix = cmboBxSuffix.Text[0]; } settings.readFrom = cmboBxInput.Text; settings.baudRate = int.Parse(cmboBxBaudRate.Text); settings.dataBits = int.Parse(cmboBxDataBits.Text); settings.parity = (Parity)Enum.Parse(typeof(Parity), cmboBxParity.Text); settings.stopBits = (StopBits)Enum.Parse(typeof(StopBits), cmboBxStopBits.Text); return(XMLConfigHandler.SaveConfig(settings)); }
public bool SaveSettings() { var settings = new ScaleSettings(); settings.scaleType = scaleTypes[cmboBxScaleType.SelectedIndex].scaleType; settings.localTare = chkBxLocalTare.Checked; settings.hostname = txtBxHostHame.Text; try { settings.tcpPort = int.Parse(txtBxPort.Text); } catch (FormatException) { MessageBox.Show("Invalid port for scale"); return(false); } settings.comPort = cmboBxCOMPort.Text; settings.baudRate = int.Parse(cmboBxBaudRate.Text); settings.dataBits = int.Parse(cmboBxDataBits.Text); settings.parity = (Parity)Enum.Parse(typeof(Parity), cmboBxParity.Text); settings.stopBits = (StopBits)Enum.Parse(typeof(StopBits), cmboBxStopBits.Text); return(XMLConfigHandler.SaveConfig(settings)); }
public LabelPrinter() { settings = (LabelPrinterSettings)XMLConfigHandler.ReadConfig(typeof(LabelPrinterSettings)); fileBuffer = new Dictionary <string, FileInfo>(); }