diff --git a/mRemoteV1.v12.suo b/mRemoteV1.v12.suo index 7d3f2dd95..68e0a4540 100644 Binary files a/mRemoteV1.v12.suo and b/mRemoteV1.v12.suo differ diff --git a/mRemoteV1/Connection/Connection.Info.cs b/mRemoteV1/Connection/Connection.Info.cs index 42778bf50..cf8826737 100644 --- a/mRemoteV1/Connection/Connection.Info.cs +++ b/mRemoteV1/Connection/Connection.Info.cs @@ -491,66 +491,14 @@ namespace mRemoteNG.Connection get { return GetInheritedPropertyValue("MacAddress", _macAddress); } set { _macAddress = value; } } - + [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUser1"), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUser1")] public virtual string UserField - { - get { return GetInheritedPropertyValue("UserField", _userField); } - set { _userField = value; } - } - - public Inheritance Inherit { - get { return _Inherit; } - set { _Inherit = value; } - } - - public Protocol.List OpenConnections - { - get { return _OpenConnections; } - set { _OpenConnections = value; } - } - - public bool IsContainer - { - get { return _IsContainer; } - set { _IsContainer = value; } - } - - public bool IsDefault - { - get { return _IsDefault; } - set { _IsDefault = value; } - } - - public Container.Info Parent { get; set; } - - public int PositionID - { - get { return _PositionID; } - set { _PositionID = value; } - } - - public string ConstantID - { - get { return _constantId; } - set { _constantId = value; } - } - - public TreeNode TreeNode { get; set; } - - public bool IsQuickConnect - { - get { return _IsQuickConnect; } - set { _IsQuickConnect = value; } - } - - public bool PleaseConnect - { - get { return _PleaseConnect; } - set { _PleaseConnect = value; } + get { return GetInheritedPropertyValue("UserField", _userField); } + set { _userField = value; } } #endregion #region VNC @@ -670,10 +618,73 @@ namespace mRemoteNG.Connection set { _vncViewOnly = value; } } #endregion + #region Non-browsable public properties + [Browsable(false)] + public Inheritance Inherit + { + get { return _Inherit; } + set { _Inherit = value; } + } + + [Browsable(false)] + public Protocol.List OpenConnections + { + get { return _OpenConnections; } + set { _OpenConnections = value; } + } + + [Browsable(false)] + public bool IsContainer + { + get { return _IsContainer; } + set { _IsContainer = value; } + } + + [Browsable(false)] + public bool IsDefault + { + get { return _IsDefault; } + set { _IsDefault = value; } + } + + [Browsable(false)] + public Container.Info Parent { get; set; } + + [Browsable(false)] + public int PositionID + { + get { return _PositionID; } + set { _PositionID = value; } + } + + [Browsable(false)] + public string ConstantID + { + get { return _constantId; } + set { _constantId = value; } + } + + [Browsable(false)] + public TreeNode TreeNode { get; set; } + + [Browsable(false)] + public bool IsQuickConnect + { + get { return _IsQuickConnect; } + set { _IsQuickConnect = value; } + } + + [Browsable(false)] + public bool PleaseConnect + { + get { return _PleaseConnect; } + set { _PleaseConnect = value; } + } #endregion - + #endregion + #region Constructors - public Info() + public Info() { // initialize default values for all standard instance members SetTreeDisplayDefaults(); @@ -684,6 +695,7 @@ namespace mRemoteNG.Connection SetRedirectDefaults(); SetMiscDefaults(); SetVNCDefaults(); + SetNonBrowsablePropertiesDefaults(); SetDefaults(); } @@ -873,13 +885,6 @@ namespace mRemoteNG.Connection _postExtApp = My.Settings.Default.ConDefaultPostExtApp; _macAddress = My.Settings.Default.ConDefaultMacAddress; _userField = My.Settings.Default.ConDefaultUserField; - _Inherit = new Inheritance(this); - _OpenConnections = new Protocol.List(); - _IsContainer = false; - _IsDefault = false; - _PositionID = 0; - _IsQuickConnect = false; - _PleaseConnect = false; } private void SetVNCDefaults() @@ -896,6 +901,17 @@ namespace mRemoteNG.Connection _vncSmartSizeMode = (Protocol.VNC.SmartSizeMode)System.Enum.Parse(typeof(Protocol.VNC.SmartSizeMode),My.Settings.Default.ConDefaultVNCSmartSizeMode); _vncViewOnly = My.Settings.Default.ConDefaultVNCViewOnly; } + + private void SetNonBrowsablePropertiesDefaults() + { + _Inherit = new Inheritance(this); + _OpenConnections = new Protocol.List(); + _IsContainer = false; + _IsDefault = false; + _PositionID = 0; + _IsQuickConnect = false; + _PleaseConnect = false; + } #endregion } -} +} \ No newline at end of file diff --git a/mRemoteV1/Properties/AssemblyInfo.cs b/mRemoteV1/Properties/AssemblyInfo.cs index b97d40b0c..1b2d0b233 100644 --- a/mRemoteV1/Properties/AssemblyInfo.cs +++ b/mRemoteV1/Properties/AssemblyInfo.cs @@ -1,18 +1,6 @@ -// VBConversions Note: VB project level imports -using System.Collections.Generic; using System; -using AxWFICALib; -using System.Drawing; -using System.Diagnostics; -using System.Data; -using AxMSTSCLib; -using Microsoft.VisualBasic; -using System.Collections; -using System.Windows.Forms; -// End of VB project level imports - -using System.Resources; using System.Reflection; +using System.Resources; using System.Runtime.InteropServices; diff --git a/mRemoteV1/Help/CMDSwitches.htm b/mRemoteV1/Resources/Help/CMDSwitches.htm similarity index 100% rename from mRemoteV1/Help/CMDSwitches.htm rename to mRemoteV1/Resources/Help/CMDSwitches.htm diff --git a/mRemoteV1/Help/Config.htm b/mRemoteV1/Resources/Help/Config.htm similarity index 100% rename from mRemoteV1/Help/Config.htm rename to mRemoteV1/Resources/Help/Config.htm diff --git a/mRemoteV1/Help/Configuration.htm b/mRemoteV1/Resources/Help/Configuration.htm similarity index 100% rename from mRemoteV1/Help/Configuration.htm rename to mRemoteV1/Resources/Help/Configuration.htm diff --git a/mRemoteV1/Help/ConfigurationSQL.htm b/mRemoteV1/Resources/Help/ConfigurationSQL.htm similarity index 100% rename from mRemoteV1/Help/ConfigurationSQL.htm rename to mRemoteV1/Resources/Help/ConfigurationSQL.htm diff --git a/mRemoteV1/Help/Connection.htm b/mRemoteV1/Resources/Help/Connection.htm similarity index 100% rename from mRemoteV1/Help/Connection.htm rename to mRemoteV1/Resources/Help/Connection.htm diff --git a/mRemoteV1/Help/Connections.htm b/mRemoteV1/Resources/Help/Connections.htm similarity index 100% rename from mRemoteV1/Help/Connections.htm rename to mRemoteV1/Resources/Help/Connections.htm diff --git a/mRemoteV1/Help/ErrorsAndInfos.htm b/mRemoteV1/Resources/Help/ErrorsAndInfos.htm similarity index 100% rename from mRemoteV1/Help/ErrorsAndInfos.htm rename to mRemoteV1/Resources/Help/ErrorsAndInfos.htm diff --git a/mRemoteV1/Help/ExternalTools.htm b/mRemoteV1/Resources/Help/ExternalTools.htm similarity index 100% rename from mRemoteV1/Help/ExternalTools.htm rename to mRemoteV1/Resources/Help/ExternalTools.htm diff --git a/mRemoteV1/Help/ImportFromAD.htm b/mRemoteV1/Resources/Help/ImportFromAD.htm similarity index 100% rename from mRemoteV1/Help/ImportFromAD.htm rename to mRemoteV1/Resources/Help/ImportFromAD.htm diff --git a/mRemoteV1/Help/Index.htm b/mRemoteV1/Resources/Help/Index.htm similarity index 100% rename from mRemoteV1/Help/Index.htm rename to mRemoteV1/Resources/Help/Index.htm diff --git a/mRemoteV1/Help/Installation.htm b/mRemoteV1/Resources/Help/Installation.htm similarity index 100% rename from mRemoteV1/Help/Installation.htm rename to mRemoteV1/Resources/Help/Installation.htm diff --git a/mRemoteV1/Help/Introduction.htm b/mRemoteV1/Resources/Help/Introduction.htm similarity index 100% rename from mRemoteV1/Help/Introduction.htm rename to mRemoteV1/Resources/Help/Introduction.htm diff --git a/mRemoteV1/Help/Main.css b/mRemoteV1/Resources/Help/Main.css similarity index 100% rename from mRemoteV1/Help/Main.css rename to mRemoteV1/Resources/Help/Main.css diff --git a/mRemoteV1/Help/MainMenu.htm b/mRemoteV1/Resources/Help/MainMenu.htm similarity index 100% rename from mRemoteV1/Help/MainMenu.htm rename to mRemoteV1/Resources/Help/MainMenu.htm diff --git a/mRemoteV1/Help/Options.htm b/mRemoteV1/Resources/Help/Options.htm similarity index 100% rename from mRemoteV1/Help/Options.htm rename to mRemoteV1/Resources/Help/Options.htm diff --git a/mRemoteV1/Help/PortScan.htm b/mRemoteV1/Resources/Help/PortScan.htm similarity index 100% rename from mRemoteV1/Help/PortScan.htm rename to mRemoteV1/Resources/Help/PortScan.htm diff --git a/mRemoteV1/Help/Prerequisites.htm b/mRemoteV1/Resources/Help/Prerequisites.htm similarity index 100% rename from mRemoteV1/Help/Prerequisites.htm rename to mRemoteV1/Resources/Help/Prerequisites.htm diff --git a/mRemoteV1/Help/QuickConnect.htm b/mRemoteV1/Resources/Help/QuickConnect.htm similarity index 100% rename from mRemoteV1/Help/QuickConnect.htm rename to mRemoteV1/Resources/Help/QuickConnect.htm diff --git a/mRemoteV1/Help/QuickReference.htm b/mRemoteV1/Resources/Help/QuickReference.htm similarity index 100% rename from mRemoteV1/Help/QuickReference.htm rename to mRemoteV1/Resources/Help/QuickReference.htm diff --git a/mRemoteV1/Help/SQLScript.txt b/mRemoteV1/Resources/Help/SQLScript.txt similarity index 100% rename from mRemoteV1/Help/SQLScript.txt rename to mRemoteV1/Resources/Help/SQLScript.txt diff --git a/mRemoteV1/Help/SSHFileTransfer.htm b/mRemoteV1/Resources/Help/SSHFileTransfer.htm similarity index 100% rename from mRemoteV1/Help/SSHFileTransfer.htm rename to mRemoteV1/Resources/Help/SSHFileTransfer.htm diff --git a/mRemoteV1/Help/SaveAsExport.htm b/mRemoteV1/Resources/Help/SaveAsExport.htm similarity index 100% rename from mRemoteV1/Help/SaveAsExport.htm rename to mRemoteV1/Resources/Help/SaveAsExport.htm diff --git a/mRemoteV1/Help/ScreenshotManager.htm b/mRemoteV1/Resources/Help/ScreenshotManager.htm similarity index 100% rename from mRemoteV1/Help/ScreenshotManager.htm rename to mRemoteV1/Resources/Help/ScreenshotManager.htm diff --git a/mRemoteV1/Help/Screenshots/Configuration/01.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/01.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/01.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/01.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/02.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/02.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/02.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/02.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/03.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/03.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/03.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/03.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/04.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/04.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/04.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/04.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/05.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/05.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/05.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/05.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/06.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/06.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/06.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/06.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/07.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/07.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/07.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/07.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/08.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/08.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/08.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/08.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/09.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/09.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/09.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/09.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/10.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/10.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/10.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/10.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/11.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/11.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/11.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/11.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/12.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/12.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/12.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/12.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/13.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/13.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/13.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/13.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/14.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/14.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/14.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/14.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/15.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/15.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/15.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/15.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/16.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/16.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/16.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/16.png diff --git a/mRemoteV1/Help/Screenshots/Configuration/17.png b/mRemoteV1/Resources/Help/Screenshots/Configuration/17.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Configuration/17.png rename to mRemoteV1/Resources/Help/Screenshots/Configuration/17.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/01.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/01.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/01.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/01.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/02.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/02.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/02.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/02.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/03.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/03.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/03.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/03.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/04.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/04.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/04.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/04.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/05.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/05.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/05.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/05.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/06.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/06.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/06.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/06.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/07.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/07.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/07.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/07.png diff --git a/mRemoteV1/Help/Screenshots/External Tools/08.png b/mRemoteV1/Resources/Help/Screenshots/External Tools/08.png similarity index 100% rename from mRemoteV1/Help/Screenshots/External Tools/08.png rename to mRemoteV1/Resources/Help/Screenshots/External Tools/08.png diff --git a/mRemoteV1/Help/Screenshots/Main Menu/File.png b/mRemoteV1/Resources/Help/Screenshots/Main Menu/File.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Main Menu/File.png rename to mRemoteV1/Resources/Help/Screenshots/Main Menu/File.png diff --git a/mRemoteV1/Help/Screenshots/Main Menu/Info.png b/mRemoteV1/Resources/Help/Screenshots/Main Menu/Info.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Main Menu/Info.png rename to mRemoteV1/Resources/Help/Screenshots/Main Menu/Info.png diff --git a/mRemoteV1/Help/Screenshots/Main Menu/QuickConnect.png b/mRemoteV1/Resources/Help/Screenshots/Main Menu/QuickConnect.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Main Menu/QuickConnect.png rename to mRemoteV1/Resources/Help/Screenshots/Main Menu/QuickConnect.png diff --git a/mRemoteV1/Help/Screenshots/Main Menu/Tools.png b/mRemoteV1/Resources/Help/Screenshots/Main Menu/Tools.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Main Menu/Tools.png rename to mRemoteV1/Resources/Help/Screenshots/Main Menu/Tools.png diff --git a/mRemoteV1/Help/Screenshots/Main Menu/View.png b/mRemoteV1/Resources/Help/Screenshots/Main Menu/View.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Main Menu/View.png rename to mRemoteV1/Resources/Help/Screenshots/Main Menu/View.png diff --git a/mRemoteV1/Help/Screenshots/Reference/01.png b/mRemoteV1/Resources/Help/Screenshots/Reference/01.png similarity index 100% rename from mRemoteV1/Help/Screenshots/Reference/01.png rename to mRemoteV1/Resources/Help/Screenshots/Reference/01.png diff --git a/mRemoteV1/Help/Sessions.htm b/mRemoteV1/Resources/Help/Sessions.htm similarity index 100% rename from mRemoteV1/Help/Sessions.htm rename to mRemoteV1/Resources/Help/Sessions.htm diff --git a/mRemoteV1/Help/Update.htm b/mRemoteV1/Resources/Help/Update.htm similarity index 100% rename from mRemoteV1/Help/Update.htm rename to mRemoteV1/Resources/Help/Update.htm diff --git a/mRemoteV1/Notes/Help.txt b/mRemoteV1/Resources/Notes/Help.txt similarity index 100% rename from mRemoteV1/Notes/Help.txt rename to mRemoteV1/Resources/Notes/Help.txt diff --git a/mRemoteV1/Notes/ICA.txt b/mRemoteV1/Resources/Notes/ICA.txt similarity index 100% rename from mRemoteV1/Notes/ICA.txt rename to mRemoteV1/Resources/Notes/ICA.txt diff --git a/mRemoteV1/Notes/Misc.txt b/mRemoteV1/Resources/Notes/Misc.txt similarity index 100% rename from mRemoteV1/Notes/Misc.txt rename to mRemoteV1/Resources/Notes/Misc.txt diff --git a/mRemoteV1/Notes/MultiLang.txt b/mRemoteV1/Resources/Notes/MultiLang.txt similarity index 100% rename from mRemoteV1/Notes/MultiLang.txt rename to mRemoteV1/Resources/Notes/MultiLang.txt diff --git a/mRemoteV1/Notes/MultiUserCons.txt b/mRemoteV1/Resources/Notes/MultiUserCons.txt similarity index 100% rename from mRemoteV1/Notes/MultiUserCons.txt rename to mRemoteV1/Resources/Notes/MultiUserCons.txt diff --git a/mRemoteV1/Notes/PropertyList.csv b/mRemoteV1/Resources/Notes/PropertyList.csv similarity index 100% rename from mRemoteV1/Notes/PropertyList.csv rename to mRemoteV1/Resources/Notes/PropertyList.csv diff --git a/mRemoteV1/Notes/PropertyList.txt b/mRemoteV1/Resources/Notes/PropertyList.txt similarity index 100% rename from mRemoteV1/Notes/PropertyList.txt rename to mRemoteV1/Resources/Notes/PropertyList.txt diff --git a/mRemoteV1/Themes/ThemeInfo.cs b/mRemoteV1/Themes/ThemeInfo.cs index b1c082a89..196642535 100644 --- a/mRemoteV1/Themes/ThemeInfo.cs +++ b/mRemoteV1/Themes/ThemeInfo.cs @@ -1,26 +1,65 @@ -using System; -using System.Drawing; -using System.ComponentModel; using mRemoteNG.My; using mRemoteNG.Tools; +using System; +using System.ComponentModel; +using System.Drawing; namespace mRemoteNG.Themes { public class ThemeInfo : ICloneable, INotifyPropertyChanged - { + { + #region Private Variables + private string _name; + private Color _windowBackgroundColor; + private Color _menuBackgroundColor; + private Color _menuTextColor; + private Color _toolbarBackgroundColor; + private Color _toolbarTextColor; + private Color _connectionsPanelBackgroundColor; + private Color _connectionsPanelTextColor; + private Color _connectionsPanelTreeLineColor; + private Color _searchBoxBackgroundColor; + private Color _searchBoxTextPromptColor; + private Color _searchBoxTextColor; + private Color _configPanelBackgroundColor; + private Color _configPanelTextColor; + private Color _configPanelCategoryTextColor; + private Color _configPanelHelpBackgroundColor; + private Color _configPanelHelpTextColor; + private Color _configPanelGridLineColor; + #endregion + + #region Constructors + public ThemeInfo(string themeName = null) + { + _name = Language.strUnnamedTheme; + _windowBackgroundColor = SystemColors.AppWorkspace; + _menuBackgroundColor = SystemColors.Control; + _menuTextColor = SystemColors.ControlText; + _toolbarBackgroundColor = SystemColors.Control; + _toolbarTextColor = SystemColors.ControlText; + _connectionsPanelBackgroundColor = SystemColors.Window; + _connectionsPanelTextColor = SystemColors.WindowText; + _connectionsPanelTreeLineColor = Color.Black; + _searchBoxBackgroundColor = SystemColors.Window; + _searchBoxTextPromptColor = SystemColors.GrayText; + _searchBoxTextColor = SystemColors.WindowText; + _configPanelBackgroundColor = SystemColors.Window; + _configPanelTextColor = SystemColors.WindowText; + _configPanelCategoryTextColor = SystemColors.ControlText; + _configPanelHelpBackgroundColor = SystemColors.Control; + _configPanelHelpTextColor = SystemColors.ControlText; + _configPanelGridLineColor = SystemColors.InactiveBorder; + + if (themeName != null) + { + Name = themeName; + } + } + #endregion + #region Public Methods - public ThemeInfo(string themeName = null) - { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. - _name = Language.strUnnamedTheme; - - if (themeName != null) - { - Name = themeName; - } - } - public object Clone() { return MemberwiseClone(); @@ -54,6 +93,16 @@ namespace mRemoteNG.Themes return true; } + + public override int GetHashCode() + { + int hash = 29; + foreach (System.Reflection.PropertyInfo propertyInfo in this.GetType().GetProperties()) + { + hash = hash * 17 + System.Convert.ToInt32(propertyInfo.GetValue(this, null)).GetHashCode(); + } + return hash; + } #endregion #region Events @@ -67,14 +116,10 @@ namespace mRemoteNG.Themes #endregion #region Properties - private string _name; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [Browsable(false)] public string Name { - get - { - return _name; - } + get { return _name; } set { if (_name == value) @@ -87,16 +132,12 @@ namespace mRemoteNG.Themes } #region General - private Color _windowBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [LocalizedAttributes.LocalizedCategory("strThemeCategoryGeneral", 1), LocalizedAttributes.LocalizedDisplayName("strThemeNameWindowBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionWindowBackgroundColor")] public Color WindowBackgroundColor { - get - { - return (_windowBackgroundColor); - } + get { return (_windowBackgroundColor); } set { if (_windowBackgroundColor == value) @@ -107,17 +148,13 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("WindowBackgroundColor"); } } - - private Color _menuBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryGeneral", 1), Browsable(false), LocalizedAttributes.LocalizedDisplayName("strThemeNameMenuBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionMenuBackgroundColor")] public Color MenuBackgroundColor { - get - { - return _menuBackgroundColor; - } + get { return _menuBackgroundColor; } set { if (_menuBackgroundColor == value) @@ -128,17 +165,13 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("MenuBackgroundColor"); } } - - private Color _menuTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryGeneral", 1), Browsable(false), LocalizedAttributes.LocalizedDisplayName("strThemeNameMenuTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionMenuTextColor")] public Color MenuTextColor { - get - { - return _menuTextColor; - } + get { return _menuTextColor; } set { if (_menuTextColor == value) @@ -149,18 +182,14 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("MenuTextColor"); } } - - private Color _toolbarBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryGeneral", 1), Browsable(false), LocalizedAttributes.LocalizedDisplayName("strThemeNameToolbarBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionToolbarBackgroundColor")] public Color ToolbarBackgroundColor { - get - { - return _toolbarBackgroundColor; - } + get { return _toolbarBackgroundColor; } set { if (_toolbarBackgroundColor == value || value.A < 255) @@ -171,17 +200,13 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ToolbarBackgroundColor"); } } - - private Color _toolbarTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryGeneral", 1), Browsable(false), LocalizedAttributes.LocalizedDisplayName("strThemeNameToolbarTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionToolbarTextColor")] public Color ToolbarTextColor { - get - { - return _toolbarTextColor; - } + get { return _toolbarTextColor; } set { if (_toolbarTextColor == value) @@ -195,16 +220,12 @@ namespace mRemoteNG.Themes #endregion #region Connections Panel - private Color _connectionsPanelBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel", 2), LocalizedAttributes.LocalizedDisplayName("strThemeNameConnectionsPanelBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConnectionsPanelBackgroundColor")] public Color ConnectionsPanelBackgroundColor { - get - { - return _connectionsPanelBackgroundColor; - } + get { return _connectionsPanelBackgroundColor; } set { if (_connectionsPanelBackgroundColor == value || value.A < 255) @@ -215,17 +236,13 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConnectionsPanelBackgroundColor"); } } - - private Color _connectionsPanelTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel", 2), LocalizedAttributes.LocalizedDisplayName("strThemeNameConnectionsPanelTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConnectionsPanelTextColor")] public Color ConnectionsPanelTextColor { - get - { - return _connectionsPanelTextColor; - } + get { return _connectionsPanelTextColor; } set { if (_connectionsPanelTextColor == value) @@ -236,8 +253,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConnectionsPanelTextColor"); } } - - private Color _connectionsPanelTreeLineColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel", 2), LocalizedAttributes.LocalizedDisplayName("strThemeNameConnectionsPanelTreeLineColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConnectionsPanelTreeLineColor")] @@ -257,8 +273,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConnectionsPanelTreeLineColor"); } } - - private Color _searchBoxBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel", 2), LocalizedAttributes.LocalizedDisplayName("strThemeNameSearchBoxBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionSearchBoxBackgroundColor")] @@ -278,8 +293,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("SearchBoxBackgroundColor"); } } - - private Color _searchBoxTextPromptColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel",2), LocalizedAttributes.LocalizedDisplayName("strThemeNameSearchBoxTextPromptColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionSearchBoxTextPromptColor")] @@ -299,8 +313,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("SearchBoxTextPromptColor"); } } - - private Color _searchBoxTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConnectionsPanel", 2), LocalizedAttributes.LocalizedDisplayName("strThemeNameSearchBoxTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionSearchBoxTextColor")] @@ -323,7 +336,6 @@ namespace mRemoteNG.Themes #endregion #region Config Panel - private Color _configPanelBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelBackgroundColor")] @@ -343,8 +355,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConfigPanelBackgroundColor"); } } - - private Color _configPanelTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelTextColor")] @@ -364,8 +375,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConfigPanelTextColor"); } } - - private Color _configPanelCategoryTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelCategoryTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelCategoryTextColor")] @@ -385,8 +395,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConfigPanelCategoryTextColor"); } } - - private Color _configPanelHelpBackgroundColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelHelpBackgroundColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelHelpBackgroundColor")] @@ -406,8 +415,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConfigPanelHelpBackgroundColor"); } } - - private Color _configPanelHelpTextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelHelpTextColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelHelpTextColor")] @@ -427,8 +435,7 @@ namespace mRemoteNG.Themes NotifyPropertyChanged("ConfigPanelHelpTextColor"); } } - - private Color _configPanelGridLineColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + [LocalizedAttributes.LocalizedCategory("strThemeCategoryConfigPanel", 3), LocalizedAttributes.LocalizedDisplayName("strThemeNameConfigPanelGridLineColor"), LocalizedAttributes.LocalizedDescription("strThemeDescriptionConfigPanelGridLineColor")] diff --git a/mRemoteV1/Themes/ThemeManager.cs b/mRemoteV1/Themes/ThemeManager.cs index b7ee19548..6f17878a6 100644 --- a/mRemoteV1/Themes/ThemeManager.cs +++ b/mRemoteV1/Themes/ThemeManager.cs @@ -7,12 +7,17 @@ using System.IO; namespace mRemoteNG.Themes { public class ThemeManager - { + { + #region Private Variables + private static readonly ThemeInfo _defaultTheme = new ThemeInfo(Language.strDefaultTheme); + private static ThemeInfo _activeTheme; + private static bool _activeThemeHandlerSet = false; + #endregion + #region Public Methods - public static ThemeInfo LoadTheme(string themeName, bool setActive = true) + public static ThemeInfo LoadTheme(string themeName, bool setActive = true) { ThemeInfo loadedTheme = DefaultTheme; - if (!string.IsNullOrEmpty(themeName)) { foreach (ThemeInfo theme in LoadThemes()) @@ -72,14 +77,8 @@ namespace mRemoteNG.Themes public static event ThemeChangedEventHandler ThemeChanged { - add - { - ThemeChangedEvent = (ThemeChangedEventHandler) System.Delegate.Combine(ThemeChangedEvent, value); - } - remove - { - ThemeChangedEvent = (ThemeChangedEventHandler) System.Delegate.Remove(ThemeChangedEvent, value); - } + add { ThemeChangedEvent = (ThemeChangedEventHandler) System.Delegate.Combine(ThemeChangedEvent, value); } + remove { ThemeChangedEvent = (ThemeChangedEventHandler) System.Delegate.Remove(ThemeChangedEvent, value); } } protected static void NotifyThemeChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) @@ -94,19 +93,11 @@ namespace mRemoteNG.Themes #endregion #region Properties - // ReSharper disable InconsistentNaming - private static readonly ThemeInfo _defaultTheme = new ThemeInfo(Language.strDefaultTheme); - // ReSharper restore InconsistentNaming public static ThemeInfo DefaultTheme { - get - { - return _defaultTheme; - } + get { return _defaultTheme; } } - - private static ThemeInfo _activeTheme; - private static bool _activeThemeHandlerSet = false; + public static ThemeInfo ActiveTheme { get @@ -148,4 +139,4 @@ namespace mRemoteNG.Themes } #endregion } -} +} \ No newline at end of file diff --git a/mRemoteV1/Tools/Authenticode.cs b/mRemoteV1/Tools/Authenticode.cs index 6ff1325c3..c68fc61e9 100644 --- a/mRemoteV1/Tools/Authenticode.cs +++ b/mRemoteV1/Tools/Authenticode.cs @@ -241,10 +241,9 @@ namespace mRemoteNG.Tools { public WINTRUST_DATA() { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_DATA)); } - public UInt32 cbStruct; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + public UInt32 cbStruct; public IntPtr pPolicyCallbackData; public IntPtr pSIPClientData; public UInt32 dwUIChoice; @@ -263,10 +262,9 @@ namespace mRemoteNG.Tools { public WINTRUST_FILE_INFO() { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_FILE_INFO)); } - public UInt32 cbStruct; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + public UInt32 cbStruct; [MarshalAs(UnmanagedType.LPTStr)]public string pcwszFilePath; public IntPtr hFile; public IntPtr pgKnownSubject; diff --git a/mRemoteV1/Tree/Root/PuttySessions.Info.cs b/mRemoteV1/Tree/Root/PuttySessions.Info.cs index 020b2dc6e..5b5169d6f 100644 --- a/mRemoteV1/Tree/Root/PuttySessions.Info.cs +++ b/mRemoteV1/Tree/Root/PuttySessions.Info.cs @@ -1,27 +1,30 @@ -using System.Windows.Forms; using mRemoteNG.My; using mRemoteNG.Tools; +using System.Windows.Forms; namespace mRemoteNG.Root.PuttySessions { public class Info : Root.Info - { - public Info() : base(RootType.PuttySessions) + { + #region Private Variables + private string _name; + private string _panel; + #endregion + + #region Constructors + public Info() : base(RootType.PuttySessions) { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. _name = Language.strPuttySavedSessionsRootName; _panel = My.Language.strGeneral; } - - private string _name; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. + #endregion + + #region Public Properties [LocalizedAttributes.LocalizedDefaultValue("strPuttySavedSessionsRootName")] public override string Name { - get - { - return _name; - } + get { return _name; } set { if (_name == value) @@ -37,16 +40,12 @@ namespace mRemoteNG.Root.PuttySessions } } - private string _panel; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 1), LocalizedAttributes.LocalizedDisplayName("strPropertyNamePanel"), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPanel")] public string Panel { - get - { - return _panel; - } + get { return _panel; } set { if (_panel == value) @@ -56,6 +55,7 @@ namespace mRemoteNG.Root.PuttySessions _panel = value; My.Settings.Default.PuttySavedSessionsPanel = value; } - } - } + } + #endregion + } } \ No newline at end of file diff --git a/mRemoteV1/Tree/Root/Root.Info.cs b/mRemoteV1/Tree/Root/Root.Info.cs index faf948544..eeda064ac 100644 --- a/mRemoteV1/Tree/Root/Root.Info.cs +++ b/mRemoteV1/Tree/Root/Root.Info.cs @@ -1,25 +1,26 @@ -using System.Windows.Forms; using mRemoteNG.Tools; using System.ComponentModel; +using System.Windows.Forms; namespace mRemoteNG.Root { [DefaultProperty("Name")] public class Info - { + { + #region Private Properties + private string _name; + #endregion + #region Constructors - public Info(RootType rootType) + public Info(RootType rootType) { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. _name = My.Language.strConnections; - Type = rootType; } #endregion #region Public Properties - private string _name; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 1), Browsable(true), LocalizedAttributes.LocalizedDefaultValue("strConnections"), @@ -27,10 +28,7 @@ namespace mRemoteNG.Root LocalizedAttributes.LocalizedDescription("strPropertyDescriptionName")] public virtual string Name { - get - { - return _name; - } + get { return _name; } set { if (_name == value) @@ -71,4 +69,4 @@ namespace mRemoteNG.Root } #endregion } -} +} \ No newline at end of file diff --git a/mRemoteV1/Tree/Tree.Node.cs b/mRemoteV1/Tree/Tree.Node.cs index 698017269..9e0ee989c 100644 --- a/mRemoteV1/Tree/Tree.Node.cs +++ b/mRemoteV1/Tree/Tree.Node.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using System; using Microsoft.VisualBasic; -using System.Windows.Forms; using mRemoteNG.App; +using System; +using System.Collections.Generic; +using System.Windows.Forms; namespace mRemoteNG.Tree @@ -21,6 +21,11 @@ namespace mRemoteNG.Tree } #endregion + #region Private Variables + private static TreeNode SetNodeToolTip_old_node = null; + private static TreeNode treeNodeToBeSelected; + #endregion + #region Public Properties private static TreeView _TreeView; public static TreeView TreeView @@ -41,21 +46,6 @@ namespace mRemoteNG.Tree #endregion #region Public Methods - private static TreeNode treeNodeToBeSelected; - private delegate void SelectNodeCB(); - private static void SelectNode() - { - if (_TreeView.InvokeRequired == true) - { - SelectNodeCB d = new SelectNodeCB(SelectNode); - _TreeView.Invoke(d); - } - else - { - _TreeView.SelectedNode = treeNodeToBeSelected; - } - } - public static string GetConstantID(TreeNode node) { if (GetNodeType(node) == Type.Connection) @@ -69,7 +59,7 @@ namespace mRemoteNG.Tree return null; } - + public static TreeNode GetNodeFromPositionID(int id) { foreach (Connection.Info conI in Runtime.ConnectionList) @@ -89,7 +79,7 @@ namespace mRemoteNG.Tree return null; } - + public static TreeNode GetNodeFromConstantID(string id) { foreach (Connection.Info conI in Runtime.ConnectionList) @@ -109,7 +99,7 @@ namespace mRemoteNG.Tree return null; } - + public static Tree.Node.Type GetNodeType(TreeNode treeNode) { try @@ -152,7 +142,7 @@ namespace mRemoteNG.Tree return Type.None; } - + public static Tree.Node.Type GetNodeTypeFromString(string str) { try @@ -174,7 +164,7 @@ namespace mRemoteNG.Tree return Type.None; } - + public static TreeNode Find(TreeNode treeNode, string searchFor) { TreeNode tmpNode = default(TreeNode); @@ -204,7 +194,7 @@ namespace mRemoteNG.Tree return null; } - + public static TreeNode Find(TreeNode treeNode, Connection.Info conInfo) { TreeNode tmpNode = default(TreeNode); @@ -234,7 +224,7 @@ namespace mRemoteNG.Tree return null; } - + public static bool IsEmpty(TreeNode treeNode) { try @@ -251,9 +241,7 @@ namespace mRemoteNG.Tree return true; } - - - + public static TreeNode AddNode(Type nodeType, string name = null) { try @@ -300,7 +288,7 @@ namespace mRemoteNG.Tree return null; } - + public static void CloneNode(TreeNode oldTreeNode, TreeNode parentNode = null) { try @@ -377,31 +365,12 @@ namespace mRemoteNG.Tree Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, string.Format(My.Language.strErrorCloneNodeFailed, ex.Message)); } } - + public static void SetNodeImage(TreeNode treeNode, Images.Enums.TreeImage Img) { SetNodeImageIndex(treeNode, (int)Img); } - - private delegate void SetNodeImageIndexDelegate(TreeNode treeNode, int imageIndex); - private static void SetNodeImageIndex(TreeNode treeNode, int imageIndex) - { - if (treeNode == null || treeNode.TreeView == null) - { - return ; - } - if (treeNode.TreeView.InvokeRequired) - { - treeNode.TreeView.Invoke(new SetNodeImageIndexDelegate(SetNodeImageIndex), new object[] {treeNode, imageIndex}); - return ; - } - - treeNode.ImageIndex = imageIndex; - treeNode.SelectedImageIndex = imageIndex; - } - - // VBConversions Note: Former VB static variables moved to class level because they aren't supported in C#. - static TreeNode SetNodeToolTip_old_node = default(TreeNode); + public static void SetNodeToolTip(MouseEventArgs e, ToolTip tTip) { try @@ -409,9 +378,8 @@ namespace mRemoteNG.Tree if (My.Settings.Default.ShowDescriptionTooltipsInTree) { //Find the node under the mouse. - // static TreeNode old_node = default(TreeNode); VBConversions Note: Static variable moved to class level and renamed SetNodeToolTip_old_node. Local static variables are not supported in C#. TreeNode new_node = _TreeView.GetNodeAt(e.X, e.Y); - if (new_node == SetNodeToolTip_old_node) + if (new_node.Equals(SetNodeToolTip_old_node)) { return; } @@ -437,8 +405,7 @@ namespace mRemoteNG.Tree Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SetNodeToolTip failed" + Constants.vbNewLine + ex.Message, true); } } - - + public static void DeleteSelectedNode() { try @@ -490,7 +457,7 @@ namespace mRemoteNG.Tree Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Deleting selected node failed" + Constants.vbNewLine + ex.Message, true); } } - + public static void StartRenameSelectedNode() { if (SelectedNode != null) @@ -498,7 +465,7 @@ namespace mRemoteNG.Tree SelectedNode.BeginEdit(); } } - + public static void FinishRenameSelectedNode(string newName) { if (newName == null) @@ -520,7 +487,7 @@ namespace mRemoteNG.Tree } } } - + public static void MoveNodeUp() { try @@ -546,7 +513,7 @@ namespace mRemoteNG.Tree Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "MoveNodeUp failed" + Constants.vbNewLine + ex.Message, true); } } - + public static void MoveNodeDown() { try @@ -572,14 +539,14 @@ namespace mRemoteNG.Tree Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "MoveNodeDown failed" + Constants.vbNewLine + ex.Message, true); } } - + public static void ExpandAllNodes() { TreeView.BeginUpdate(); TreeView.ExpandAll(); TreeView.EndUpdate(); } - + public static void CollapseAllNodes() { TreeView.BeginUpdate(); @@ -589,7 +556,7 @@ namespace mRemoteNG.Tree } TreeView.EndUpdate(); } - + public static void Sort(TreeNode treeNode, System.Windows.Forms.SortOrder sorting) { if (TreeView == null) @@ -623,44 +590,7 @@ namespace mRemoteNG.Tree TreeView.EndUpdate(); } - - // Adapted from http://www.codeproject.com/Tips/252234/ASP-NET-TreeView-Sort - private static void Sort(TreeNode treeNode, Tools.Controls.TreeNodeSorter nodeSorter) - { - foreach (TreeNode childNode in treeNode.Nodes) - { - Sort(childNode, nodeSorter); - } - - try - { - List sortedNodes = new List(); - TreeNode currentNode = null; - while (treeNode.Nodes.Count > 0) - { - foreach (TreeNode childNode in treeNode.Nodes) - { - if (currentNode == null || nodeSorter.Compare(childNode, currentNode) < 0) - { - currentNode = childNode; - } - } - treeNode.Nodes.Remove(currentNode); - sortedNodes.Add(currentNode); - currentNode = null; - } - - foreach (TreeNode childNode in sortedNodes) - { - treeNode.Nodes.Add(childNode); - } - } - catch (Exception ex) - { - Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Sort nodes failed" + Constants.vbNewLine + ex.Message, true); - } - } - + private delegate void ResetTreeDelegate(); public static void ResetTree() { @@ -678,5 +608,75 @@ namespace mRemoteNG.Tree } } #endregion + + #region Private Methods + private delegate void SelectNodeCB(); + private static void SelectNode() + { + if (_TreeView.InvokeRequired == true) + { + SelectNodeCB d = new SelectNodeCB(SelectNode); + _TreeView.Invoke(d); + } + else + { + _TreeView.SelectedNode = treeNodeToBeSelected; + } + } + + private delegate void SetNodeImageIndexDelegate(TreeNode treeNode, int imageIndex); + private static void SetNodeImageIndex(TreeNode treeNode, int imageIndex) + { + if (treeNode == null || treeNode.TreeView == null) + { + return; + } + if (treeNode.TreeView.InvokeRequired) + { + treeNode.TreeView.Invoke(new SetNodeImageIndexDelegate(SetNodeImageIndex), new object[] { treeNode, imageIndex }); + return; + } + + treeNode.ImageIndex = imageIndex; + treeNode.SelectedImageIndex = imageIndex; + } + + // Adapted from http://www.codeproject.com/Tips/252234/ASP-NET-TreeView-Sort + private static void Sort(TreeNode treeNode, Tools.Controls.TreeNodeSorter nodeSorter) + { + foreach (TreeNode childNode in treeNode.Nodes) + { + Sort(childNode, nodeSorter); + } + + try + { + List sortedNodes = new List(); + TreeNode currentNode = null; + while (treeNode.Nodes.Count > 0) + { + foreach (TreeNode childNode in treeNode.Nodes) + { + if (currentNode == null || nodeSorter.Compare(childNode, currentNode) < 0) + { + currentNode = childNode; + } + } + treeNode.Nodes.Remove(currentNode); + sortedNodes.Add(currentNode); + currentNode = null; + } + + foreach (TreeNode childNode in sortedNodes) + { + treeNode.Nodes.Add(childNode); + } + } + catch (Exception ex) + { + Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Sort nodes failed" + Constants.vbNewLine + ex.Message, true); + } + } + #endregion } } \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/ListView.cs b/mRemoteV1/UI/Controls/ListView.cs index 6b32ba9cd..9b38685b5 100644 --- a/mRemoteV1/UI/Controls/ListView.cs +++ b/mRemoteV1/UI/Controls/ListView.cs @@ -6,66 +6,49 @@ using System.ComponentModel; namespace mRemoteNG.Controls { public class ListView : System.Windows.Forms.ListView - { + { + #region Private Variables + private bool _ShowFocusCues; + private Alignment _LabelAlignment; + #endregion + #region Public Properties - [Category("Appearance"), DefaultValue(typeof(Color), "HighlightText")] - public Color HighlightForeColor {get; set;} + [Category("Appearance"), DefaultValue(typeof(Color), "HighlightText")] + public Color HighlightForeColor { get; set; } [Category("Appearance"), DefaultValue(typeof(Color), "Highlight")] - public Color HighlightBackColor {get; set;} + public Color HighlightBackColor { get; set; } [Category("Appearance"), DefaultValue(typeof(Color), "HotTrack")] - public Color HighlightBorderColor {get; set;} + public Color HighlightBorderColor { get; set; } [Category("Appearance"), DefaultValue(typeof(Color), "ControlText")] - public Color InactiveHighlightForeColor {get; set;} + public Color InactiveHighlightForeColor { get; set; } [Category("Appearance"), DefaultValue(typeof(Color), "Control")] - public Color InactiveHighlightBackColor {get; set;} + public Color InactiveHighlightBackColor { get; set; } [Category("Appearance"), DefaultValue(typeof(Color), "ControlDark")] - public Color InactiveHighlightBorderColor {get; set;} - - [Category("Appearance"), DefaultValue(true)] - private bool _ShowFocusCues = true; - public new bool ShowFocusCues - { - get - { - return _ShowFocusCues; - } - set - { - _ShowFocusCues = value; - } - } - - [Category("Appearance")] - private Alignment _LabelAlignment = new Alignment(VerticalAlignment.Top, HorizontalAlignment.Left); - public Alignment LabelAlignment - { - get - { - return _LabelAlignment; - } - set - { - _LabelAlignment = value; - } - } + public Color InactiveHighlightBorderColor { get; set; } + + [Category("Appearance"), DefaultValue(true)] + public new bool ShowFocusCues { get; set; } + + [Category("Appearance")] + public Alignment LabelAlignment { get; set; } #endregion #region Constructors public ListView() { - // VBConversions Note: Non-static class variable initialization is below. Class variables cannot be initially assigned non-static values in C#. + ShowFocusCues = true; + LabelAlignment = new Alignment(VerticalAlignment.Top, HorizontalAlignment.Left); HighlightForeColor = SystemColors.HighlightText; HighlightBackColor = SystemColors.Highlight; HighlightBorderColor = SystemColors.HotTrack; InactiveHighlightForeColor = SystemColors.ControlText; InactiveHighlightBackColor = SystemColors.Control; InactiveHighlightBorderColor = SystemColors.ControlDark; - OwnerDraw = true; } #endregion @@ -172,7 +155,6 @@ namespace mRemoteNG.Controls private StringFormat GetStringFormat() { StringFormat format = StringFormat.GenericDefault; - switch (LabelAlignment.Vertical) { case VerticalAlignment.Top: @@ -213,7 +195,7 @@ namespace mRemoteNG.Controls { format.FormatFlags = (System.Drawing.StringFormatFlags) (format.FormatFlags | StringFormatFlags.NoWrap); } - + return format; } #endregion @@ -221,53 +203,52 @@ namespace mRemoteNG.Controls [TypeConverter(typeof(ExpandableObjectConverter))] public class Alignment - { - public Alignment() + { + #region Private Properties + [DefaultValue(VerticalAlignment.Top)] + private VerticalAlignment _Vertical = VerticalAlignment.Top; + [DefaultValue(HorizontalAlignment.Left)] + private HorizontalAlignment _Horizontal = HorizontalAlignment.Left; + + #endregion + + #region Constructors + public Alignment() { } - - public Alignment(VerticalAlignment verticalAlignment, HorizontalAlignment horizontalAlignment) + #endregion + + #region Public Properties + public Alignment(VerticalAlignment verticalAlignment, HorizontalAlignment horizontalAlignment) { Vertical = verticalAlignment; Horizontal = horizontalAlignment; } - - [DefaultValue(VerticalAlignment.Top)] - private VerticalAlignment _Vertical = VerticalAlignment.Top; + public VerticalAlignment Vertical { - get - { - return _Vertical; - } - set - { - _Vertical = value; - } + get { return _Vertical; } + set { _Vertical = value; } } - - [DefaultValue(HorizontalAlignment.Left)] - private HorizontalAlignment _Horizontal = HorizontalAlignment.Left; + public HorizontalAlignment Horizontal { - get - { - return _Horizontal; - } - set - { - _Horizontal = value; - } + get { return _Horizontal; } + set { _Horizontal = value; } } - - public override string ToString() + #endregion + + #region Public Methods + public override string ToString() { return string.Format("{0}, {1}", Vertical, Horizontal); - } - } - - public enum VerticalAlignment + } + #endregion + } + + #region Enums + public enum VerticalAlignment { Top, Middle, @@ -280,4 +261,5 @@ namespace mRemoteNG.Controls Center, Right } -} + #endregion +} \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsForm.Designer.cs b/mRemoteV1/UI/Forms/OptionsForm.Designer.cs index 3fe842d20..feb6a3456 100644 --- a/mRemoteV1/UI/Forms/OptionsForm.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsForm.Designer.cs @@ -2,12 +2,12 @@ namespace mRemoteNG.Forms { - [global::Microsoft.VisualBasic.CompilerServices.DesignerGenerated()]public - partial class OptionsForm : System.Windows.Forms.Form + public partial class OptionsForm : System.Windows.Forms.Form { //Form overrides dispose to clean up the component list. - [System.Diagnostics.DebuggerNonUserCode()]protected override void Dispose(bool disposing) + [System.Diagnostics.DebuggerNonUserCode()] + protected override void Dispose(bool disposing) { try { @@ -28,7 +28,8 @@ namespace mRemoteNG.Forms //NOTE: The following procedure is required by the Windows Form Designer //It can be modified using the Windows Form Designer. //Do not modify it using the code editor. - [System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent() + [System.Diagnostics.DebuggerStepThrough()] + private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); mRemoteNG.Controls.Alignment Alignment2 = new mRemoteNG.Controls.Alignment(); @@ -102,4 +103,4 @@ namespace mRemoteNG.Forms internal System.Windows.Forms.Button OkButton; internal System.Windows.Forms.Button CancelButtonControl; } -} +} \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsForm.cs b/mRemoteV1/UI/Forms/OptionsForm.cs index a1ce8bc07..32825861a 100644 --- a/mRemoteV1/UI/Forms/OptionsForm.cs +++ b/mRemoteV1/UI/Forms/OptionsForm.cs @@ -1,24 +1,34 @@ -using System.Collections.Generic; -using System; -using System.Windows.Forms; -using mRemoteNG.Forms.OptionsPages; using mRemoteNG.App; +using mRemoteNG.Forms.OptionsPages; using mRemoteNG.My; +using System; +using System.Collections.Generic; +using System.Windows.Forms; namespace mRemoteNG.Forms { public partial class OptionsForm { + #region Private Fields + private Dictionary _pages; + private ImageList _pageIconImageList; + private OptionsPage _startPage; + private OptionsPage _selectedPage; + #endregion + #region Constructors public OptionsForm() { // This call is required by the designer. InitializeComponent(); // Add any initialization after the InitializeComponent() call. - - Runtime.FontOverride(this); - + + _pages = new Dictionary(); + _pageIconImageList = new ImageList(); + _selectedPage = null; + + Runtime.FontOverride(this); _pages.Add(new Forms.OptionsPages.StartupExitPage(), new PageInfo()); _pages.Add(new AppearancePage(), new PageInfo()); _pages.Add(new TabsPanelsPage(), new PageInfo()); @@ -28,9 +38,7 @@ namespace mRemoteNG.Forms _pages.Add(new ThemePage(), new PageInfo()); _pages.Add(new KeyboardPage(), new PageInfo()); _pages.Add(new AdvancedPage(), new PageInfo()); - _startPage = GetPageFromType(typeof(Forms.OptionsPages.StartupExitPage)); - _pageIconImageList.ColorDepth = ColorDepth.Depth32Bit; PageListView.LargeImageList = _pageIconImageList; } @@ -43,15 +51,7 @@ namespace mRemoteNG.Forms return ShowDialog(ownerWindow); } #endregion - - #region Private Fields - private Dictionary _pages = new Dictionary(); - private ImageList _pageIconImageList = new ImageList(); - - private OptionsPage _startPage; - private OptionsPage _selectedPage = null; - #endregion - + #region Private Methods #region Event Handlers public void OptionsForm_Load(System.Object sender, EventArgs e) @@ -63,10 +63,8 @@ namespace mRemoteNG.Forms _pageIconImageList.Images.Add(pageInfo.IconKey, page.PageIcon); pageInfo.ListViewItem = PageListView.Items.Add(page.PageName, pageInfo.IconKey); } - ApplyLanguage(); LoadSettings(); - ShowPage(_startPage); } @@ -255,4 +253,4 @@ namespace mRemoteNG.Forms } #endregion } -} +} \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs index e3745d6a9..f59361da9 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs @@ -2,12 +2,11 @@ namespace mRemoteNG.Forms.OptionsPages { - [global::Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] public partial class AdvancedPage : OptionsPage { - //UserControl overrides dispose to clean up the component list. - [System.Diagnostics.DebuggerNonUserCode()]protected override void Dispose(bool disposing) + [System.Diagnostics.DebuggerNonUserCode()] + protected override void Dispose(bool disposing) { try { @@ -28,7 +27,8 @@ namespace mRemoteNG.Forms.OptionsPages //NOTE: The following procedure is required by the Windows Form Designer //It can be modified using the Windows Form Designer. //Do not modify it using the code editor. - [System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent() + [System.Diagnostics.DebuggerStepThrough()] + private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedPage)); this.chkWriteLogFile = new System.Windows.Forms.CheckBox(); diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs index f9f81efdc..662fb1e00 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.cs @@ -1,10 +1,10 @@ -using System; -using System.Windows.Forms; -using System.IO; -using mRemoteNG.My; using mRemoteNG.Connection.Protocol; +using mRemoteNG.My; using mRemoteNG.Tools; using PSTaskDialog; +using System; +using System.IO; +using System.Windows.Forms; namespace mRemoteNG.Forms.OptionsPages diff --git a/mRemoteV1/bin/Debug Portable/Interop.EOLWTSCOM.dll b/mRemoteV1/bin/Debug Portable/Interop.EOLWTSCOM.dll deleted file mode 100644 index f0381891e..000000000 Binary files a/mRemoteV1/bin/Debug Portable/Interop.EOLWTSCOM.dll and /dev/null differ diff --git a/mRemoteV1/bin/Debug Portable/Interop.MSTSCLib.dll b/mRemoteV1/bin/Debug Portable/Interop.MSTSCLib.dll deleted file mode 100644 index 94129d6a3..000000000 Binary files a/mRemoteV1/bin/Debug Portable/Interop.MSTSCLib.dll and /dev/null differ diff --git a/mRemoteV1/bin/Debug Portable/Interop.SHDocVw.dll b/mRemoteV1/bin/Debug Portable/Interop.SHDocVw.dll deleted file mode 100644 index 096cbb045..000000000 Binary files a/mRemoteV1/bin/Debug Portable/Interop.SHDocVw.dll and /dev/null differ diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 590ece0ff..2bee4063a 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -632,169 +632,169 @@ - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest @@ -808,10 +808,10 @@ - - - - + + + + @@ -838,8 +838,8 @@ - - + + @@ -905,7 +905,7 @@ - + @@ -918,7 +918,7 @@ - + PreserveNewest diff --git a/mRemoteV1/obj/Debug Portable/Interop.EOLWTSCOM.dll b/mRemoteV1/obj/Debug Portable/Interop.EOLWTSCOM.dll deleted file mode 100644 index f0381891e..000000000 Binary files a/mRemoteV1/obj/Debug Portable/Interop.EOLWTSCOM.dll and /dev/null differ diff --git a/mRemoteV1/obj/Debug Portable/Interop.MSTSCLib.dll b/mRemoteV1/obj/Debug Portable/Interop.MSTSCLib.dll deleted file mode 100644 index 94129d6a3..000000000 Binary files a/mRemoteV1/obj/Debug Portable/Interop.MSTSCLib.dll and /dev/null differ diff --git a/mRemoteV1/obj/Debug Portable/Interop.SHDocVw.dll b/mRemoteV1/obj/Debug Portable/Interop.SHDocVw.dll deleted file mode 100644 index 096cbb045..000000000 Binary files a/mRemoteV1/obj/Debug Portable/Interop.SHDocVw.dll and /dev/null differ