From e2929f43a31c15b4321ec3273f9ffd5b3b2ee527 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Wed, 12 Oct 2016 08:19:37 -0600 Subject: [PATCH] Code cleanup of GeneralAppInfo (mostly just renames) --- mRemoteV1/App/CompatibilityChecker.cs | 2 +- mRemoteV1/App/Info/GeneralAppInfo.cs | 12 ++++++------ mRemoteV1/App/Update/AppUpdater.cs | 2 +- mRemoteV1/Config/Connections/ConnectionsSaver.cs | 2 +- mRemoteV1/Config/Settings/ExternalAppsLoader.cs | 2 +- mRemoteV1/UI/Window/AboutWindow.cs | 4 ++-- mRemoteV1/UI/Window/ConnectionWindow.cs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mRemoteV1/App/CompatibilityChecker.cs b/mRemoteV1/App/CompatibilityChecker.cs index c175a4fa..6714b273 100644 --- a/mRemoteV1/App/CompatibilityChecker.cs +++ b/mRemoteV1/App/CompatibilityChecker.cs @@ -20,7 +20,7 @@ namespace mRemoteNG.App { if (FipsPolicyEnabledForServer2003() || FipsPolicyEnabledForServer2008AndNewer()) { - MessageBox.Show(frmMain.Default, string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProdName, GeneralAppInfo.ProdName, MessageBoxButtons.OK, MessageBoxIcon.Error)); + MessageBox.Show(frmMain.Default, string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProductName, GeneralAppInfo.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)); Environment.Exit(1); } } diff --git a/mRemoteV1/App/Info/GeneralAppInfo.cs b/mRemoteV1/App/Info/GeneralAppInfo.cs index cb335891..fc0e092a 100644 --- a/mRemoteV1/App/Info/GeneralAppInfo.cs +++ b/mRemoteV1/App/Info/GeneralAppInfo.cs @@ -15,9 +15,9 @@ namespace mRemoteNG.App.Info public static readonly string UrlDonate = "http://donate.mremoteng.org/"; public static readonly string UrlForum = "http://forum.mremoteng.org/"; public static readonly string UrlBugs = "http://bugs.mremoteng.org/"; - public static readonly string version = Application.ProductVersion; - public static readonly string ProdName = Application.ProductName; - public static readonly string copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright; + public static readonly string ApplicationVersion = Application.ProductVersion; + public static readonly string ProductName = Application.ProductName; + public static readonly string Copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright; public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location); public static string ReportingFilePath = ""; public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe"; @@ -36,14 +36,14 @@ namespace mRemoteNG.App.Info details.Add($".NET CLR {Environment.Version}"); var detailsString = string.Join("; ", details.ToArray()); - return $"Mozilla/5.0 ({detailsString}) {ProdName}/{version}"; + return $"Mozilla/5.0 ({detailsString}) {ProductName}/{ApplicationVersion}"; } } - public static Version getVer() + public static Version GetApplicationVersion() { Version v; - System.Version.TryParse(version, out v); + System.Version.TryParse(ApplicationVersion, out v); return v; } } diff --git a/mRemoteV1/App/Update/AppUpdater.cs b/mRemoteV1/App/Update/AppUpdater.cs index dbf98026..89e20874 100644 --- a/mRemoteV1/App/Update/AppUpdater.cs +++ b/mRemoteV1/App/Update/AppUpdater.cs @@ -117,7 +117,7 @@ namespace mRemoteNG.App.Update return false; } - return _currentUpdateInfo.Version > GeneralAppInfo.getVer(); + return _currentUpdateInfo.Version > GeneralAppInfo.GetApplicationVersion(); } public bool IsAnnouncementAvailable() diff --git a/mRemoteV1/Config/Connections/ConnectionsSaver.cs b/mRemoteV1/Config/Connections/ConnectionsSaver.cs index e5071415..f547fd7c 100644 --- a/mRemoteV1/Config/Connections/ConnectionsSaver.cs +++ b/mRemoteV1/Config/Connections/ConnectionsSaver.cs @@ -153,7 +153,7 @@ namespace mRemoteNG.Config.Connections isVerified = true; if (isVerified == false) - Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, string.Format(Language.strErrorBadDatabaseVersion, databaseVersion, GeneralAppInfo.ProdName)); + Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, string.Format(Language.strErrorBadDatabaseVersion, databaseVersion, GeneralAppInfo.ProductName)); } catch (Exception ex) { diff --git a/mRemoteV1/Config/Settings/ExternalAppsLoader.cs b/mRemoteV1/Config/Settings/ExternalAppsLoader.cs index 8dd317df..9c30ddbe 100644 --- a/mRemoteV1/Config/Settings/ExternalAppsLoader.cs +++ b/mRemoteV1/Config/Settings/ExternalAppsLoader.cs @@ -19,7 +19,7 @@ namespace mRemoteNG.Config.Settings public void LoadExternalAppsFromXML() { - string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProdName + "\\" + SettingsFileInfo.ExtAppsFilesName; + string oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProductName + "\\" + SettingsFileInfo.ExtAppsFilesName; string newPath = SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.ExtAppsFilesName; XmlDocument xDom = new XmlDocument(); if (File.Exists(newPath)) diff --git a/mRemoteV1/UI/Window/AboutWindow.cs b/mRemoteV1/UI/Window/AboutWindow.cs index 22d5b9f3..309c9dca 100644 --- a/mRemoteV1/UI/Window/AboutWindow.cs +++ b/mRemoteV1/UI/Window/AboutWindow.cs @@ -287,9 +287,9 @@ namespace mRemoteNG.UI.Window try { - lblCopyright.Text = GeneralAppInfo.copyright; + lblCopyright.Text = GeneralAppInfo.Copyright; - lblVersion.Text = @"Version " + GeneralAppInfo.version; + lblVersion.Text = @"Version " + GeneralAppInfo.ApplicationVersion; if (File.Exists(GeneralAppInfo.HomePath + "\\CHANGELOG.TXT")) { diff --git a/mRemoteV1/UI/Window/ConnectionWindow.cs b/mRemoteV1/UI/Window/ConnectionWindow.cs index 908fab04..4c8c12b3 100644 --- a/mRemoteV1/UI/Window/ConnectionWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionWindow.cs @@ -226,7 +226,7 @@ namespace mRemoteNG.UI.Window ((Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All & TabController.TabPages.Count > 0) || (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.Multiple & TabController.TabPages.Count > 1))) { - var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProdName, string.Format(Language.strConfirmCloseConnectionPanelMainInstruction, Text), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question); + var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionPanelMainInstruction, Text), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question); if (CTaskDialog.VerificationChecked) { Settings.Default.ConfirmCloseConnection--; @@ -285,7 +285,7 @@ namespace mRemoteNG.UI.Window if (selectedTab == null) return; if (Settings.Default.ConfirmCloseConnection == (int)ConfirmCloseEnum.All) { - var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProdName, string.Format(Language.strConfirmCloseConnectionMainInstruction, selectedTab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question); + var result = CTaskDialog.MessageBox(this, GeneralAppInfo.ProductName, string.Format(Language.strConfirmCloseConnectionMainInstruction, selectedTab.Title), "", "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.YesNo, ESysIcons.Question, ESysIcons.Question); if (CTaskDialog.VerificationChecked) { Settings.Default.ConfirmCloseConnection--;