From 2548674b269a8d571a7cc20d76fd0a887c06c597 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 15 Oct 2019 20:19:06 +0300 Subject: [PATCH] The position of some variables has been changed to avoid some bugs --- Crypto Notepad/MainForm.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index bb327bc..5ef0b15 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -273,13 +273,13 @@ private void DeleteUpdateFiles() private void SaveConfirm() { + string messageBoxText; if (richTextBox.Modified) { if (string.IsNullOrEmpty(PublicVar.openFileName)) { PublicVar.openFileName = "Unnamed.cnp"; } - string messageBoxText; if (!PublicVar.keyChanged) { messageBoxText = "Save file: " + "\"" + PublicVar.openFileName + "\"" + " ? "; @@ -453,11 +453,11 @@ private void LockFile() string opnfile = File.ReadAllText(filePath); string de = AES.Decrypt(opnfile, TypedPassword.Value, null, settings.HashAlgorithm, Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize)); fileLockedPanel.Visible = false; - richTextBox.Focus(); richTextBox.Text = de; richTextBox.SelectionStart = caretPos; PublicVar.encryptionKey.Set(TypedPassword.Value); TypedPassword.Value = null; + richTextBox.Focus(); } catch (Exception ex) {