From 0df8dba2cb36576ae5e231faa617161d6b8f83b4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 30 Aug 2019 13:07:26 +0300 Subject: [PATCH] Added notification in window title bar when file saved --- Crypto Notepad/MainForm.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index 4a1b1dd..0d125e9 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -1,4 +1,4 @@ -using IWshRuntimeLibrary; +using IWshRuntimeLibrary; using System; using System.ComponentModel; using System.Diagnostics; @@ -10,6 +10,7 @@ using System.Reflection; using System.Security.Cryptography; using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; using File = System.IO.File; @@ -441,6 +442,17 @@ private void CheckForUpdates(bool autoCheck) } } + private async void SaveStatus() + { + if (!Text.Contains(" [File Saved]")) + { + string common = Text; + Text += " [File Saved]"; + await Task.Delay(3000); + Text = common; + } + } + private void AutoLock(bool minimize) { EnterKeyForm f2 = new EnterKeyForm(); @@ -1003,6 +1015,7 @@ private void SaveToolStripMenuItem_Click(object sender, EventArgs e) } RichTextBox.Modified = false; PublicVar.keyChanged = false; + SaveStatus(); } private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) @@ -1052,6 +1065,7 @@ private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) PublicVar.encryptionKey.Set(TypedPassword.Value); TypedPassword.Value = null; PublicVar.openFileName = Path.GetFileName(SaveFile.FileName); + SaveStatus(); } private void OpenFileLocationToolStripMenuItem_Click(object sender, EventArgs e)