From fa7fbc2a2bac902fda10c6814059a70eae5fc735 Mon Sep 17 00:00:00 2001 From: Sigmanor Date: Sun, 24 Jan 2016 22:42:40 +0200 Subject: [PATCH] Deleted unnecessary var --- Crypto Notepad/Form1.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Crypto Notepad/Form1.cs b/Crypto Notepad/Form1.cs index 10845e0..613278b 100644 --- a/Crypto Notepad/Form1.cs +++ b/Crypto Notepad/Form1.cs @@ -24,10 +24,9 @@ public partial class MainWindow : Form public static string key = ""; public static bool keyChanged = false; public static bool settingsChanged = false; - public static bool textSave = false; public static string[] args = Environment.GetCommandLineArgs(); Properties.Settings ps = Properties.Settings.Default; - int caretPos = 0; + int caretPos = 0; public MainWindow() { @@ -94,7 +93,6 @@ void DecryptAES() toolStripStatusLabel1.ToolTipText = (OpenFile.FileName); filename = OpenFile.FileName; - textSave = false; string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture); customRTB.Select(Convert.ToInt32(cc2), 0); } @@ -156,7 +154,6 @@ private void openAsotiations() toolStripStatusLabel1.ToolTipText = (args[1]); filename = args[1]; - textSave = false; string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture); customRTB.Select(Convert.ToInt32(cc), 0); } @@ -238,7 +235,6 @@ private async void saveAsToolStripMenuItem_Click(object sender, EventArgs e) toolStripStatusLabel1.Text = "Saved in: " + filename; string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture); customRTB.Select(Convert.ToInt32(cc), 0); - textSave = false; await Task.Delay(4000); toolStripStatusLabel1.Text = "Ready"; @@ -256,7 +252,6 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) ps.Save(); - if (textSave == true) { string f = "Unnamed.cnp"; if (customRTB.Text != "") @@ -433,7 +428,6 @@ private async void saveToolStripMenuItem1_Click_1(object sender, EventArgs e) customRTB.Text = noenc; string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture); customRTB.Select(Convert.ToInt32(cc), 0); - textSave = false; toolStripStatusLabel1.Text = "Saved in: " + filename; await Task.Delay(4000); toolStripStatusLabel1.Text = "Ready"; @@ -673,7 +667,6 @@ private void customRTB_SelectionChanged_1(object sender, EventArgs e) private void customRTB_TextChanged(object sender, EventArgs e) { - textSave = true; LineAndColumn(); } @@ -979,10 +972,8 @@ void AutoLock(bool minimize) toolStripStatusLabel1.ToolTipText = (OpenFile.FileName); filename = OpenFile.FileName; - textSave = false; string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture); customRTB.SelectionStart = caretPos; - textSave = true; this.Show(); } catch (CryptographicException)