From 7281d0bae4299df7e57f373afd55b57dcea7eebd Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 2 Oct 2019 19:35:34 +0300 Subject: [PATCH] Update method improved --- Crypto Notepad/MainForm.cs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index ed174a9..5dec054 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -1,4 +1,4 @@ -using Crypto_Notepad.Properties; +using Crypto_Notepad.Properties; using System; using System.ComponentModel; using System.Diagnostics; @@ -46,7 +46,7 @@ protected override void WndProc(ref Message m) } - #region Functions + #region Methods private void DecryptAES() { EnterKeyForm enterKeyForm = new EnterKeyForm @@ -379,8 +379,6 @@ private void CheckForUpdates(bool autoCheck) if (serverVersion > appVersion) { - mainMenu.Invoke((Action)delegate - { if (statusPanel.Visible) { StatusPanelMessage("update-needed"); @@ -402,13 +400,10 @@ private void CheckForUpdates(bool autoCheck) } } } - }); } if (serverVersion <= appVersion && autoCheck) { - mainMenu.Invoke((Action)delegate - { using (new CenterWinDialog(this)) { if (statusPanel.Visible) @@ -420,9 +415,7 @@ private void CheckForUpdates(bool autoCheck) MessageBox.Show("Crypto Notepad is up to date.", PublicVar.appName, MessageBoxButtons.OK, MessageBoxIcon.Information); } } - }); } - } catch { @@ -605,6 +598,7 @@ public void MenuIcons() } } } + public void Toolbaricons(bool oldicons) { if (oldicons) @@ -744,8 +738,9 @@ private void MainWindow_Load(object sender, EventArgs e) if (settings.autoCheckUpdate) { - Thread up = new Thread(() => CheckForUpdates(false)); - up.Start(); + //Thread up = new Thread(() => CheckForUpdates(false)); + //up.Start(); + CheckForUpdates(false); } MenuIcons(); @@ -1319,8 +1314,9 @@ private void DocsMainMenu_Click(object sender, EventArgs e) private void UpdatesMainMenu_Click(object sender, EventArgs e) { - Thread up = new Thread(() => CheckForUpdates(true)); - up.Start(); + //Thread up = new Thread(() => CheckForUpdates(true)); + //up.Start(); + CheckForUpdates(true); } private void AboutMainMenu_Click(object sender, EventArgs e)