private void SetGenerationOptions(PwProfile opt)
        {
            bool bPrevInit = m_bBlockUIUpdate;

            m_bBlockUIUpdate = true;

            m_rbStandardCharSet.Checked = (opt.GeneratorType == PasswordGeneratorType.CharSet);
            m_rbPattern.Checked         = (opt.GeneratorType == PasswordGeneratorType.Pattern);

            m_numGenChars.Value = opt.Length;

            PwCharSet pcs = new PwCharSet(opt.CharSet.ToString());

            m_cbUpperCase.Checked = pcs.RemoveIfAllExist(PwCharSet.UpperCase);
            m_cbLowerCase.Checked = pcs.RemoveIfAllExist(PwCharSet.LowerCase);
            m_cbDigits.Checked    = pcs.RemoveIfAllExist(PwCharSet.Digits);
            m_cbSpecial.Checked   = pcs.RemoveIfAllExist(pcs.SpecialChars);
            m_cbHighAnsi.Checked  = pcs.RemoveIfAllExist(pcs.HighAnsiChars);
            m_cbMinus.Checked     = pcs.RemoveIfAllExist("-");
            m_cbUnderline.Checked = pcs.RemoveIfAllExist("_");
            m_cbSpace.Checked     = pcs.RemoveIfAllExist(" ");
            m_cbBrackets.Checked  = pcs.RemoveIfAllExist(PwCharSet.Brackets);

            m_tbCustomChars.Text = pcs.ToString();

            m_tbPattern.Text           = opt.Pattern;
            m_cbPatternPermute.Checked = opt.PatternPermutePassword;

            m_cbEntropy.Checked          = opt.CollectUserEntropy;
            m_cbExcludeLookAlike.Checked = opt.ExcludeLookAlike;
            m_cbNoRepeat.Checked         = opt.NoRepeatingCharacters;
            m_tbExcludeChars.Text        = opt.ExcludeCharacters;

            m_bBlockUIUpdate = bPrevInit;
        }
Beispiel #2
0
        private void SetGenerationOptions(PwProfile opt)
        {
            ++m_uBlockUIUpdate;

            m_rbStandardCharSet.Checked = (opt.GeneratorType == PasswordGeneratorType.CharSet);
            m_rbPattern.Checked         = (opt.GeneratorType == PasswordGeneratorType.Pattern);
            m_rbCustom.Checked          = (opt.GeneratorType == PasswordGeneratorType.Custom);

            m_numGenChars.Value = opt.Length;

            PwCharSet pcs = new PwCharSet(opt.CharSet.ToString());

            m_cbUpperCase.Checked = pcs.RemoveIfAllExist(PwCharSet.UpperCase);
            m_cbLowerCase.Checked = pcs.RemoveIfAllExist(PwCharSet.LowerCase);
            m_cbDigits.Checked    = pcs.RemoveIfAllExist(PwCharSet.Digits);
            m_cbSpecial.Checked   = pcs.RemoveIfAllExist(PwCharSet.Special);
            m_cbLatin1S.Checked   = pcs.RemoveIfAllExist(PwCharSet.Latin1S);
            m_cbMinus.Checked     = pcs.RemoveIfAllExist("-");
            m_cbUnderline.Checked = pcs.RemoveIfAllExist("_");
            m_cbSpace.Checked     = pcs.RemoveIfAllExist(" ");
            m_cbBrackets.Checked  = pcs.RemoveIfAllExist(PwCharSet.Brackets);

            m_tbCustomChars.Text = pcs.ToString();

            m_tbPattern.Text           = opt.Pattern;
            m_cbPatternPermute.Checked = opt.PatternPermutePassword;

            SelectCustomGenerator(opt.CustomAlgorithmUuid, opt.CustomAlgorithmOptions);

            m_cbEntropy.Checked = opt.CollectUserEntropy;

            m_cbNoRepeat.Checked         = opt.NoRepeatingCharacters;
            m_cbExcludeLookAlike.Checked = opt.ExcludeLookAlike;
            m_tbExcludeChars.Text        = opt.ExcludeCharacters;

            --m_uBlockUIUpdate;
        }