From 82dbeb5c9951eaf39bbeaf961ef56271d6d54480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Tue, 28 Mar 2023 13:25:26 +0200 Subject: [PATCH] Adding ReloadRequest event to GeneratePassword --- Password Manager/GeneratePassword.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)