InitEx() public method

Initialize the dialog. Needs to be called before the dialog is shown.
public InitEx ( ProtectedStringDictionary vStringDict, string strStringName, ProtectedString psStringInitialValue, KeePassLib.PwDatabase pwContext ) : void
vStringDict ProtectedStringDictionary String container. Must not be null.
strStringName string Initial name of the string. May be null.
psStringInitialValue KeePassLib.Security.ProtectedString Initial value. May be null.
pwContext KeePassLib.PwDatabase
return void
        void btn_popout_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            EntryTemplate t = (EntryTemplate)btn.Tag;
            if (form.EntryStrings.Get(t.fieldName) == null)
                form.EntryStrings.Set(t.fieldName, new ProtectedString(t.type.StartsWith("Protected"), ""));

            ProtectedString psValue = form.EntryStrings.Get(t.fieldName);
            Debug.Assert(psValue != null);
            EditStringForm esf = new EditStringForm();
            esf.InitEx(form.EntryStrings, t.fieldName, psValue, m_host.Database);
            if (esf.ShowDialog() == DialogResult.OK)
                form.UpdateEntryStrings(false, true);
        }
Exemplo n.º 2
0
        private void OnBtnStrEdit(object sender, EventArgs e)
        {
            if(m_pwEditMode == PwEditMode.ViewReadOnlyEntry) return;

            ListView.SelectedListViewItemCollection vSel = m_lvStrings.SelectedItems;
            if(vSel.Count <= 0) return;

            UpdateEntryStrings(true, false, false);

            string strName = vSel[0].Text;
            ProtectedString psValue = m_vStrings.Get(strName);
            Debug.Assert(psValue != null);

            EditStringForm esf = new EditStringForm();
            esf.InitEx(m_vStrings, strName, psValue, m_pwDatabase);
            if(UIUtil.ShowDialogAndDestroy(esf) == DialogResult.OK)
                UpdateEntryStrings(false, false, true);
        }
Exemplo n.º 3
0
        private void OnBtnStrEdit(object sender, EventArgs e)
        {
            EditStringForm esf = new EditStringForm();

            ListView.SelectedListViewItemCollection vSel = m_lvStrings.SelectedItems;
            if(vSel.Count <= 0) return;

            string strName = vSel[0].Text;
            ProtectedString psValue = m_vStrings.Get(strName);
            Debug.Assert(psValue != null);

            esf.InitEx(m_vStrings, strName, psValue, m_pwDatabase);
            if(esf.ShowDialog() == DialogResult.OK)
            {
                UpdateStringsList();

                m_bModifiedEntry = true;
            }
        }
Exemplo n.º 4
0
        private void OnBtnStrAdd(object sender, EventArgs e)
        {
            if(m_pwEditMode == PwEditMode.ViewReadOnlyEntry) return;

            UpdateEntryStrings(true, false, false);

            EditStringForm esf = new EditStringForm();
            esf.InitEx(m_vStrings, null, null, m_pwDatabase);

            if(UIUtil.ShowDialogAndDestroy(esf) == DialogResult.OK)
            {
                UpdateEntryStrings(false, false, true);
                ResizeColumnHeaders();
            }
        }
Exemplo n.º 5
0
        private void OnBtnStrAdd(object sender, EventArgs e)
        {
            EditStringForm esf = new EditStringForm();

            esf.InitEx(m_vStrings, null, null, m_pwDatabase);
            if(esf.ShowDialog() == DialogResult.OK)
            {
                UpdateStringsList();
                ResizeColumnHeaders();

                m_bModifiedEntry = true;
            }
        }