From e76dd18962c47725d582feb4c5efab647b36d666 Mon Sep 17 00:00:00 2001 From: hiriumi Date: Sun, 1 May 2016 19:41:06 -0700 Subject: [PATCH] Refactoring to make the code more CSharpy and resolving more namespace issues. --- mRemoteV1/App/ProgramRoot.cs | 2 +- mRemoteV1/Config/Import/mRemoteNG.cs | 14 +- mRemoteV1/Properties/Settings.Designer.cs | 25 +- mRemoteV1/Properties/Settings.settings | 8 +- mRemoteV1/UI/Forms/frmMain.cs | 18 +- mRemoteV1/app.config | 564 ++++++++++++++++++++++ 6 files changed, 598 insertions(+), 33 deletions(-) diff --git a/mRemoteV1/App/ProgramRoot.cs b/mRemoteV1/App/ProgramRoot.cs index 80221f231..542a595e3 100644 --- a/mRemoteV1/App/ProgramRoot.cs +++ b/mRemoteV1/App/ProgramRoot.cs @@ -11,7 +11,7 @@ namespace mRemoteNG.App [STAThread] public static void Main(string[] args) { - frmMain mainForm = new frmMain(); + var mainForm = new frmMain(); frmMain.Default = mainForm; Application.Run(mainForm); } diff --git a/mRemoteV1/Config/Import/mRemoteNG.cs b/mRemoteV1/Config/Import/mRemoteNG.cs index a3cee46d7..299f07c09 100644 --- a/mRemoteV1/Config/Import/mRemoteNG.cs +++ b/mRemoteV1/Config/Import/mRemoteNG.cs @@ -26,12 +26,14 @@ namespace mRemoteNG.Config.Import string name = Path.GetFileNameWithoutExtension(fileName); TreeNode treeNode = new TreeNode(name); parentTreeNode.Nodes.Add(treeNode); - - ContainerInfo containerInfo = new ContainerInfo(); - containerInfo.TreeNode = treeNode; - containerInfo.Name = name; - - ConnectionInfo connectionInfo = new ConnectionInfo(); + + ContainerInfo containerInfo = new ContainerInfo + { + TreeNode = treeNode, + Name = name + }; + + var connectionInfo = new ConnectionInfo(); connectionInfo.Inherit = new ConnectionInfoInheritance(connectionInfo); connectionInfo.Name = name; connectionInfo.TreeNode = treeNode; diff --git a/mRemoteV1/Properties/Settings.Designer.cs b/mRemoteV1/Properties/Settings.Designer.cs index 06fff1dc9..ae0596289 100644 --- a/mRemoteV1/Properties/Settings.Designer.cs +++ b/mRemoteV1/Properties/Settings.Designer.cs @@ -359,19 +359,6 @@ namespace mRemoteNG.My { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Configuration.SettingsProviderAttribute(typeof(mRemoteNG.Config.Settings.Providers.ChooseProvider))] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ShowCompleteConsPathInTitle { - get { - return ((bool)(this["ShowCompleteConsPathInTitle"])); - } - set { - this["ShowCompleteConsPathInTitle"] = value; - } - } - [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.SettingsProviderAttribute(typeof(mRemoteNG.Config.Settings.Providers.ChooseProvider))] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -2483,5 +2470,17 @@ namespace mRemoteNG.My { this["KeysNextTab"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ShowCompleteConsPathInTitle { + get { + return ((bool)(this["ShowCompleteConsPathInTitle"])); + } + set { + this["ShowCompleteConsPathInTitle"] = value; + } + } } } diff --git a/mRemoteV1/Properties/Settings.settings b/mRemoteV1/Properties/Settings.settings index 87647df89..be07089ff 100644 --- a/mRemoteV1/Properties/Settings.settings +++ b/mRemoteV1/Properties/Settings.settings @@ -1,5 +1,5 @@  - + @@ -80,9 +80,6 @@ False - - False - True @@ -572,5 +569,8 @@ 9/8, 34/8 + + False + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 0478cc102..15d64bb7f 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -48,13 +48,13 @@ namespace mRemoteNG _showFullPathInTitle = Settings.Default.ShowCompleteConsPathInTitle; InitializeComponent(); //Added to support default instance behavour in C#. This should be removed at the earliest opportunity. - if (defaultInstance == null) - defaultInstance = this; + if (_defaultInstance == null) + _defaultInstance = this; } #endregion #region Default Instance - private static frmMain defaultInstance; + private static frmMain _defaultInstance; /// /// Added by the VB.Net to C# Converter to support default instance behavour in C# @@ -63,23 +63,23 @@ namespace mRemoteNG { get { - if (defaultInstance == null) + if (_defaultInstance == null) { - defaultInstance = new frmMain(); - defaultInstance.FormClosed += new FormClosedEventHandler(defaultInstance_FormClosed); + _defaultInstance = new frmMain(); + _defaultInstance.FormClosed += defaultInstance_FormClosed; } - return defaultInstance; + return _defaultInstance; } set { - defaultInstance = value; + _defaultInstance = value; } } static void defaultInstance_FormClosed(object sender, FormClosedEventArgs e) { - defaultInstance = null; + _defaultInstance = null; } #endregion diff --git a/mRemoteV1/app.config b/mRemoteV1/app.config index a6b71351d..b321d286a 100644 --- a/mRemoteV1/app.config +++ b/mRemoteV1/app.config @@ -3,10 +3,12 @@
+
+
@@ -56,6 +58,557 @@ + + + Normal + + + False + + + True + + + + + + True + + + True + + + True + + + True + + + False + + + False + + + + + + True + + + True + + + False + + + False + + + True + + + False + + + False + + + noinfo + + + + + + + + + + + + False + + + False + + + True + + + False + + + False + + + False + + + + + + 80 + + + False + + + + + + + + + + + + + + + + + + + + + RDP + + + Default Settings + + + False + + + FitToWindow + + + Colors16Bit + + + True + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + DoNotPlay + + + 2 + + + False + + + False + + + False + + + 0 + + + False + + + True + + + 0, 0 + + + Bottom + + + True + + + 3, 24 + + + Top + + + False + + + False + + + + + + + + + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + EncrBasic + + + False + + + + + + + + + False + + + False + + + False + + + True + + + False + + + False + + + AuthVNC + + + ColNormal + + + SmartSAspect + + + False + + + CompNone + + + EncHextile + + + + + + + + + 0 + + + ProxyNone + + + + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + False + + + NoAuth + + + False + + + 5500 + + + False + + + + + + IE + + + False + + + + + + False + + + False + + + + + + False + + + + + + False + + + + + + False + + + 7 + + + 1980-01-01 + + + False + + + Never + + + Yes + + + mRemoteNG + + + False + + + False + + + False + + + False + + + False + + + False + + + 5 + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + 4 + + + mRemoteNG + + + 10 + + + {0}.{1:yyyyMMdd-HHmmssffff}.backup + + + False + + + True + + + False + + + False + + + + + + True + + + + + + + + + True + + + https://update.mremoteng.org/ + + + + + + True + + + False + + + False + + + RDP + + + 9/9, 33/8 + + + 9/8, 34/8 + + + False + + Normal @@ -1160,6 +1713,17 @@ + + + de,el,en,en-US,es-AR,es,fr,hu,it,nb-NO,nl,pt,pt-BR,pl,ru,uk,zh-CN,zh-TW + + + release + + + https://update.mremoteng.org/announcement.txt + + de,el,en,en-US,es-AR,es,fr,hu,it,nb-NO,nl,pt,pt-BR,pl,ru,uk,zh-CN,zh-TW