示例#1
0
        private void FormOptionsTimer_Tick(object sender, EventArgs e)
        {
            FormOptionsTimer.Stop();
            RegexPatternFindTextBox.BackColor = RegexEnabledCheckBox.Checked
                                ? System.Drawing.SystemColors.Window
                                : System.Drawing.SystemColors.Control;
            RegexPatternReplaceTextBox.BackColor = RegexEnabledCheckBox.Checked
                                ? System.Drawing.SystemColors.Window
                                : System.Drawing.SystemColors.Control;
            PassGen.Preset = GetPresetFromForm();
            HelpContent    = null;
            if (!firstLoad || Settings.Default.GeneratePasswordOnStart)
            {
                bool copyOnGenerate = Settings.Default.CopyOnGenerate;
                if (firstLoad && !Settings.Default.CopyPasswordWhenStart)
                {
                    copyOnGenerate = false;
                }
                firstLoad = false;
                GeneratePasswords(copyOnGenerate);
            }
            string[] differenes = SelectedPreset.Compare(PassGen.Preset);
            if (differenes.Length > 0)
            {
            }
            bool isSame = differenes.Length == 0;

            //PresetSaveButton.Image = isSame
            //	? GetImage("disk_gray_16x16")
            //	: GetImage("disk_blue_16x16");
            PresetSaveButton.Enabled = !isSame;
        }
示例#2
0
 private void FormPresetValue_Changed(object sender, EventArgs e)
 {
     if (sender == ScriptEnabledCheckBox)
     {
         if (ScriptEnabledCheckBox.Checked)
         {
             mainForm.ShowScriptsTabPage();
         }
         else
         {
             mainForm.HideScriptsTabPage();
         }
     }
     if (sender == UseNumbersCheckBox && UseNumbersCheckBox.Checked)
     {
         FilterRememberCheckBox.Checked = false;
     }
     if (sender == UseSymbolsCheckBox && UseSymbolsCheckBox.Checked)
     {
         FilterRememberCheckBox.Checked = false;
         FilterPhoneCheckBox.Checked    = false;
     }
     if (sender == UseExtraCheckBox && UseExtraCheckBox.Checked)
     {
         FilterRememberCheckBox.Checked = false;
         FilterPhoneCheckBox.Checked    = false;
     }
     if (sender == FilterRememberCheckBox && FilterRememberCheckBox.Checked)
     {
         UseNumbersCheckBox.Checked = false;
         UseSymbolsCheckBox.Checked = false;
         UseExtraCheckBox.Checked   = false;
     }
     if (sender == FilterPhoneCheckBox && FilterPhoneCheckBox.Checked)
     {
         UseSymbolsCheckBox.Checked = false;
         UseExtraCheckBox.Checked   = false;
     }
     // Do it with timer because after preset select this will fire a lot.
     FormOptionsTimer.Stop();
     FormOptionsTimer.Start();
 }