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); }
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(); }