示例#1
0
        public static CreatePropmt Edit(PasswordElement psw, Action <CreatePropmt> callback)
        {
            var pro = new CreatePropmt();

            pro.NameBox.Text     = psw.NameTag.Text;
            pro.PasswordBox.Text = psw.Password;
            pro.IconBox.Image    = psw.HasIcon ? psw.icon.Image : Properties.Resources.defaulticon;
            pro.Add.Text         = "Edit password";
            pro.Add.Click       += (s, m) => callback(pro);
            return(pro);
        }
示例#2
0
        private void Create(object sender, EventArgs e)
        {
            var prompt = new CreatePropmt();
            var window = prompt.GetForm("Add new Password Element");

            prompt.Add.Click += (s, evt) => {
                if (!prompt.IsValid())
                {
                    return;
                }
                InsertElement(prompt.Create(MasterPassword));
                window.Close();
            };
            window.ShowDialog();
        }