public FrmGeneralOptions(options oldOptions)
 {
     InitializeComponent();
     cancelled = false;
     MyOptions = oldOptions;
     txtKey.Enabled = chkUseEncryption.Checked;
     cboPort.Items.AddRange(SerialPort.GetPortNames());
 }
Exemple #2
0
        public options(options newOptions)
        {
            useEncryption = newOptions.useEncryption;
            portname = newOptions.portname;
            myKey = newOptions.myKey;
            rulesPath = newOptions.rulesPath;
            Uri path;
            if (Uri.TryCreate(rulesPath, UriKind.RelativeOrAbsolute, out path))
            {
                if (path.Scheme == Uri.UriSchemeHttp || path.Scheme == Uri.UriSchemeHttps)
                    RuleRepository = new serviceRuleRepository(rulesPath);
                else
                    RuleRepository = new ruleRepository(rulesPath);

            }
        }
Exemple #3
0
        private void mnuItemGeneralOpts(object sender, EventArgs e)
        {
            options tmpOptions = new options(_myOptions);
            FrmGeneralOptions options = new FrmGeneralOptions(tmpOptions);
            options.ShowDialog(this);
            if (!options.cancelled)
            {
                _myOptions = tmpOptions; // If OK'ed, apply new settings
            }

            options.Dispose();
            this.Enabled = true;
            this.BringToFront();
        }