Пример #1
0
        private void textBoxHotKeySequence_Click(object sender, EventArgs e)
        {
            AutoTypeConfig autoTypeConfig = new AutoTypeConfig();

            if (textBoxHotKeySequence.Text != KeeOtp2Ext.BuiltInTotpPlaceHolder)
            {
                autoTypeConfig.DefaultSequence = textBoxHotKeySequence.Text;
            }
            EditAutoTypeItemForm eatf = new EditAutoTypeItemForm();

            eatf.InitEx(autoTypeConfig, -1, true, KeeOtp2Ext.BuiltInTotpPlaceHolder, null);
            eatf.ShowDialog();

            if (eatf.DialogResult == DialogResult.OK && autoTypeConfig.DefaultSequence != string.Empty)
            {
                textBoxHotKeySequence.Text = autoTypeConfig.DefaultSequence;
            }
            else
            {
                textBoxHotKeySequence.Text = KeeOtp2Ext.BuiltInTotpPlaceHolder;
            }
        }
Пример #2
0
        private void bSequenceEdit_Click(object sender, EventArgs e)
        {
            EditAutoTypeItemForm dlg = new EditAutoTypeItemForm();
            AutoTypeConfig       atc = new AutoTypeConfig();

            if (string.IsNullOrEmpty(rtbSequence.Text))
            {
                atc.DefaultSequence = PasswordChangeAssistantExt.GetPCASequence(PasswordChangeAssistantExt.SelectedEntry, PluginTranslate.DefaultSequence01);
            }
            else
            {
                atc.DefaultSequence = rtbSequence.Text;
            }
            dlg.InitEx(atc, -1, true, rtbSequence.Text, m_pcadata.Strings);
            dlg.Text = KPRes.ConfigureKeystrokeSeq;
            Control cCustomSequence = Tools.GetControl("m_rbKeySeq", dlg);
            Control cFirst          = Tools.GetControl("m_lblTargetWindow", dlg);

            if ((cCustomSequence != null) && (cFirst != null))
            {
                int y = cCustomSequence.Top - cFirst.Top;
                HideControl("m_lblTargetWindow", dlg);
                HideControl("m_rbSeqDefault", dlg);
                HideControl("m_cmbWindow", dlg);
                HideControl("m_lblOpenHint", dlg);
                HideControl("m_lnkWildcardRegexHint", dlg);
                HideControl("m_rbSeqCustom", dlg);
                MoveControlUp("m_rbKeySeq", y, dlg);
                MoveControlUp("m_lblKeySeqInsertInfo", y, dlg);
                MoveControlUp("m_rtbPlaceholders", y, dlg);
                Tools.GetControl("m_rtbPlaceholders", dlg).Height += y;
            }
            if (UIUtil.ShowDialogAndDestroy(dlg) == DialogResult.OK)
            {
                rtbSequence.Text = atc.DefaultSequence;
            }
        }