Adding ReloadRequest event to GeneratePassword

This commit is contained in:
2023-03-28 13:25:26 +02:00
parent a799470f6a
commit 82dbeb5c99

View File

@@ -2,17 +2,20 @@
namespace Password_Manager namespace Password_Manager
{ {
public delegate void MethodRequest();
public partial class GeneratePassword : Form public partial class GeneratePassword : Form
{ {
private string currentPath; private string currentPath;
private string recipient; 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(); InitializeComponent();
passwordName.Text = name; passwordName.Text = name;
this.currentPath = currentPath; this.currentPath = currentPath;
this.recipient = recipient; this.recipient = recipient;
this.ReloadRequest = ReloadRequest;
} }
public void Generate(object sender, EventArgs e) public void Generate(object sender, EventArgs e)
@@ -43,6 +46,8 @@ namespace Password_Manager
MessageBox.Show(error.ToString(), "IO Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(error.ToString(), "IO Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
ReloadRequest();
Close();
} }
private void cancel_Click(object sender, EventArgs e) private void cancel_Click(object sender, EventArgs e)