diff --git a/Password Manager/GeneratePassword.cs b/Password Manager/GeneratePassword.cs index ec6814c..7cfc58f 100644 --- a/Password Manager/GeneratePassword.cs +++ b/Password Manager/GeneratePassword.cs @@ -2,17 +2,20 @@ namespace Password_Manager { + public delegate void MethodRequest(); public partial class GeneratePassword : Form { private string currentPath; private string recipient; + public MethodRequest ReloadRequest; - public GeneratePassword(string name, string currentPath, string recipient) + public GeneratePassword(string currentPath, string recipient, MethodRequest ReloadRequest, string? name) { InitializeComponent(); passwordName.Text = name; this.currentPath = currentPath; this.recipient = recipient; + this.ReloadRequest = ReloadRequest; } public void Generate(object sender, EventArgs e) @@ -43,6 +46,8 @@ namespace Password_Manager MessageBox.Show(error.ToString(), "IO Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + ReloadRequest(); + Close(); } private void cancel_Click(object sender, EventArgs e)