Esempio n. 1
0
 private void btnAddPrinter_Click(object sender, EventArgs e)
 {
     var frm = new FrmWizard(true);
     frm.CurrentSettings = _settings;
     frm.NewSettings = Settings.LoadFromFile(Global.SettingsFileName);
     if (frm.ShowDialog(this) == DialogResult.OK)
     {
         foreach (var printer in frm.NewSettings.Printers)
         {
             if (_settings.Printers.Count(p => p.Caption == printer.Caption) == 0)
             {
                 _settings.Printers.Add(printer);
             }
         }
         _settings.SaveToFile(Global.SettingsFileName);
         LoadPrintersFromSettings();
         var frmService = new FrmRestartService();
         frmService.ShowDialog(this);
     }
 }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            _settings.Customer.Name = txtName.Text;
            _settings.Customer.Email = txtEmail.Text;
            _settings.Customer.PaypalEmail = txtPaypalEmail.Text;
            _settings.Customer.RefCode = txtReferenceCode.Text;
            _settings.Customer.RefByCode = txtReferralCode.Text;

            _settings.SaveToFile(Global.SettingsFileName);
            MessageBox.Show("Changes was saved to the settings file, Monitoring service will be restarted.");
            var frm = new FrmRestartService();
            frm.ShowDialog(this);
        }