diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index c7375563a..d19bed2c2 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -13,6 +13,8 @@ Features/Enhancements: Fixes: ------ +#1245: Options form takes nearly 3 seconds to appear when Theming is active +#1240: Theming problem with NGNumericUpDown #1238: Connection panel not translated until opened for the first time #1186: Fixed several dialog boxes to use localized button text #1170: Prevent Options window from showing up in taskbar diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs index d9be59ece..ded4a9d23 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs @@ -18,6 +18,7 @@ using System.Globalization; using System.Security; using System.Windows.Forms; using System.Xml; +using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml; namespace mRemoteNG.Config.Serializers.Xml { @@ -67,8 +68,8 @@ namespace mRemoteNG.Config.Serializers.Xml if (_confVersion >= 2.6) { - var fullFileEncryptionValue = rootXmlElement?.Attributes["FullFileEncryption"].Value ?? ""; - if (bool.Parse(fullFileEncryptionValue)) + var fullFileEncryptionValue = rootXmlElement.GetAttributeAsBool("FullFileEncryption"); + if (fullFileEncryptionValue) { var decryptedContent = _decryptor.Decrypt(rootXmlElement.InnerText); rootXmlElement.InnerXml = decryptedContent; @@ -139,14 +140,9 @@ namespace mRemoteNG.Config.Serializers.Xml { if (_confVersion >= 2.6) { - BlockCipherEngines engine; - Enum.TryParse(connectionsRootElement?.Attributes["EncryptionEngine"].Value, true, out engine); - - BlockCipherModes mode; - Enum.TryParse(connectionsRootElement?.Attributes["BlockCipherMode"].Value, true, out mode); - - int keyDerivationIterations; - int.TryParse(connectionsRootElement?.Attributes["KdfIterations"].Value, out keyDerivationIterations); + var engine = connectionsRootElement.GetAttributeAsEnum("EncryptionEngine"); + var mode = connectionsRootElement.GetAttributeAsEnum("BlockCipherMode"); + var keyDerivationIterations = connectionsRootElement.GetAttributeAsInt("KdfIterations"); _decryptor = new XmlConnectionsDecryptor(engine, mode, rootNodeInfo) { @@ -167,8 +163,7 @@ namespace mRemoteNG.Config.Serializers.Xml if (!parentXmlNode.HasChildNodes) return; foreach (XmlNode xmlNode in parentXmlNode.ChildNodes) { - var treeNodeTypeString = xmlNode.Attributes?["Type"].Value ?? "connection"; - var nodeType = (TreeNodeType)Enum.Parse(typeof(TreeNodeType), treeNodeTypeString, true); + var nodeType = xmlNode.GetAttributeAsEnum("Type", TreeNodeType.Connection); // ReSharper disable once SwitchStatementMissingSomeCases switch (nodeType) @@ -184,8 +179,7 @@ namespace mRemoteNG.Config.Serializers.Xml containerInfo.CopyFrom(GetConnectionInfoFromXml(xmlNode)); if (_confVersion >= 0.8) { - var expandedValue = xmlNode.Attributes?["Expanded"].Value ?? ""; - containerInfo.IsExpanded = bool.Parse(expandedValue); + containerInfo.IsExpanded = xmlNode.GetAttributeAsBool("Expanded"); } parentContainer.AddChild(containerInfo); @@ -203,9 +197,10 @@ namespace mRemoteNG.Config.Serializers.Xml private ConnectionInfo GetConnectionInfoFromXml(XmlNode xmlnode) { - if (xmlnode.Attributes == null) return null; + if (xmlnode?.Attributes == null) + return null; - var connectionId = xmlnode.Attributes["Id"]?.Value; + var connectionId = xmlnode.GetAttributeAsString("Id"); if (string.IsNullOrWhiteSpace(connectionId)) connectionId = Guid.NewGuid().ToString(); var connectionInfo = new ConnectionInfo(connectionId); @@ -214,16 +209,16 @@ namespace mRemoteNG.Config.Serializers.Xml { if (_confVersion >= 0.2) { - connectionInfo.Name = xmlnode.Attributes["Name"].Value; - connectionInfo.Description = xmlnode.Attributes["Descr"].Value; - connectionInfo.Hostname = xmlnode.Attributes["Hostname"].Value; - connectionInfo.DisplayWallpaper = bool.Parse(xmlnode.Attributes["DisplayWallpaper"].Value); - connectionInfo.DisplayThemes = bool.Parse(xmlnode.Attributes["DisplayThemes"].Value); - connectionInfo.CacheBitmaps = bool.Parse(xmlnode.Attributes["CacheBitmaps"].Value); + connectionInfo.Name = xmlnode.GetAttributeAsString("Name"); + connectionInfo.Description = xmlnode.GetAttributeAsString("Descr"); + connectionInfo.Hostname = xmlnode.GetAttributeAsString("Hostname"); + connectionInfo.DisplayWallpaper = xmlnode.GetAttributeAsBool("DisplayWallpaper"); + connectionInfo.DisplayThemes = xmlnode.GetAttributeAsBool("DisplayThemes"); + connectionInfo.CacheBitmaps = xmlnode.GetAttributeAsBool("CacheBitmaps"); if (_confVersion < 1.1) //1.0 - 0.1 { - connectionInfo.Resolution = Convert.ToBoolean(xmlnode.Attributes["Fullscreen"].Value) + connectionInfo.Resolution = xmlnode.GetAttributeAsBool("Fullscreen") ? RdpProtocol.RDPResolutions.Fullscreen : RdpProtocol.RDPResolutions.FitToWindow; } @@ -231,9 +226,9 @@ namespace mRemoteNG.Config.Serializers.Xml if (_confVersion <= 2.6) // 0.2 - 2.6 { #pragma warning disable 618 - connectionInfo.Username = xmlnode.Attributes["Username"].Value; - connectionInfo.Password = _decryptor.Decrypt(xmlnode.Attributes["Password"].Value); - connectionInfo.Domain = xmlnode.Attributes["Domain"].Value; + connectionInfo.Username = xmlnode.GetAttributeAsString("Username"); + connectionInfo.Password = _decryptor.Decrypt(xmlnode.GetAttributeAsString("Password")); + connectionInfo.Domain = xmlnode.GetAttributeAsString("Domain"); #pragma warning restore 618 } } @@ -242,10 +237,10 @@ namespace mRemoteNG.Config.Serializers.Xml { if (_confVersion < 0.7) { - if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value)) + if (xmlnode.GetAttributeAsBool("UseVNC")) { connectionInfo.Protocol = ProtocolType.VNC; - connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["VNCPort"].Value); + connectionInfo.Port = xmlnode.GetAttributeAsInt("VNCPort"); } else { @@ -263,18 +258,18 @@ namespace mRemoteNG.Config.Serializers.Xml { if (_confVersion < 0.7) { - connectionInfo.Port = Convert.ToInt32(Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value) - ? xmlnode.Attributes["VNCPort"].Value - : xmlnode.Attributes["RDPPort"].Value); + connectionInfo.Port = xmlnode.GetAttributeAsBool("UseVNC") + ? xmlnode.GetAttributeAsInt("VNCPort") + : xmlnode.GetAttributeAsInt("RDPPort"); } - connectionInfo.UseConsoleSession = bool.Parse(xmlnode.Attributes["ConnectToConsole"].Value); + connectionInfo.UseConsoleSession = xmlnode.GetAttributeAsBool("ConnectToConsole"); } else { if (_confVersion < 0.7) { - if (Convert.ToBoolean(xmlnode.Attributes["UseVNC"].Value)) + if (xmlnode.GetAttributeAsBool("UseVNC")) connectionInfo.Port = (int)ProtocolVNC.Defaults.Port; else connectionInfo.Port = (int)RdpProtocol.Defaults.Port; @@ -284,10 +279,10 @@ namespace mRemoteNG.Config.Serializers.Xml if (_confVersion >= 0.5) { - connectionInfo.RedirectDiskDrives = bool.Parse(xmlnode.Attributes["RedirectDiskDrives"].Value); - connectionInfo.RedirectPrinters = bool.Parse(xmlnode.Attributes["RedirectPrinters"].Value); - connectionInfo.RedirectPorts = bool.Parse(xmlnode.Attributes["RedirectPorts"].Value); - connectionInfo.RedirectSmartCards = bool.Parse(xmlnode.Attributes["RedirectSmartCards"].Value); + connectionInfo.RedirectDiskDrives = xmlnode.GetAttributeAsBool("RedirectDiskDrives"); + connectionInfo.RedirectPrinters = xmlnode.GetAttributeAsBool("RedirectPrinters"); + connectionInfo.RedirectPorts = xmlnode.GetAttributeAsBool("RedirectPorts"); + connectionInfo.RedirectSmartCards = xmlnode.GetAttributeAsBool("RedirectSmartCards"); } else { @@ -299,31 +294,29 @@ namespace mRemoteNG.Config.Serializers.Xml if (_confVersion >= 0.7) { - ProtocolType protocolType; - Enum.TryParse(xmlnode.Attributes["Protocol"].Value, true, out protocolType); - connectionInfo.Protocol = protocolType; - connectionInfo.Port = Convert.ToInt32(xmlnode.Attributes["Port"].Value); + connectionInfo.Protocol = xmlnode.GetAttributeAsEnum("Protocol"); + connectionInfo.Port = xmlnode.GetAttributeAsInt("Port"); } if (_confVersion >= 1.0) { - connectionInfo.RedirectKeys = bool.Parse(xmlnode.Attributes["RedirectKeys"].Value); + connectionInfo.RedirectKeys = xmlnode.GetAttributeAsBool("RedirectKeys"); } if (_confVersion >= 1.2) { - connectionInfo.PuttySession = xmlnode.Attributes["PuttySession"].Value; + connectionInfo.PuttySession = xmlnode.GetAttributeAsString("PuttySession"); } if (_confVersion >= 1.3) { - connectionInfo.Colors = (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors), xmlnode.Attributes["Colors"].Value, true); - connectionInfo.Resolution = (RdpProtocol.RDPResolutions)Enum.Parse(typeof(RdpProtocol.RDPResolutions), xmlnode.Attributes["Resolution"].Value, true); - connectionInfo.RedirectSound = (RdpProtocol.RDPSounds)Enum.Parse(typeof(RdpProtocol.RDPSounds), xmlnode.Attributes["RedirectSound"].Value, true); + connectionInfo.Colors = xmlnode.GetAttributeAsEnum("Colors"); + connectionInfo.Resolution = xmlnode.GetAttributeAsEnum("Resolution"); + connectionInfo.RedirectSound = xmlnode.GetAttributeAsEnum("RedirectSound"); } else { - switch (Convert.ToInt32(xmlnode.Attributes["Colors"].Value)) + switch (xmlnode.GetAttributeAsInt("Colors")) { case 0: connectionInfo.Colors = RdpProtocol.RDPColors.Colors256; @@ -344,177 +337,177 @@ namespace mRemoteNG.Config.Serializers.Xml break; } - connectionInfo.RedirectSound = (RdpProtocol.RDPSounds)Convert.ToInt32(xmlnode.Attributes["RedirectSound"].Value); + connectionInfo.RedirectSound = xmlnode.GetAttributeAsEnum("RedirectSound"); } if (_confVersion >= 1.3) { - connectionInfo.Inheritance.CacheBitmaps = bool.Parse(xmlnode.Attributes["InheritCacheBitmaps"].Value); - connectionInfo.Inheritance.Colors = bool.Parse(xmlnode.Attributes["InheritColors"].Value); - connectionInfo.Inheritance.Description = bool.Parse(xmlnode.Attributes["InheritDescription"].Value); - connectionInfo.Inheritance.DisplayThemes = bool.Parse(xmlnode.Attributes["InheritDisplayThemes"].Value); - connectionInfo.Inheritance.DisplayWallpaper = bool.Parse(xmlnode.Attributes["InheritDisplayWallpaper"].Value); - connectionInfo.Inheritance.Icon = bool.Parse(xmlnode.Attributes["InheritIcon"].Value); - connectionInfo.Inheritance.Panel = bool.Parse(xmlnode.Attributes["InheritPanel"].Value); - connectionInfo.Inheritance.Port = bool.Parse(xmlnode.Attributes["InheritPort"].Value); - connectionInfo.Inheritance.Protocol = bool.Parse(xmlnode.Attributes["InheritProtocol"].Value); - connectionInfo.Inheritance.PuttySession = bool.Parse(xmlnode.Attributes["InheritPuttySession"].Value); - connectionInfo.Inheritance.RedirectDiskDrives = bool.Parse(xmlnode.Attributes["InheritRedirectDiskDrives"].Value); - connectionInfo.Inheritance.RedirectKeys = bool.Parse(xmlnode.Attributes["InheritRedirectKeys"].Value); - connectionInfo.Inheritance.RedirectPorts = bool.Parse(xmlnode.Attributes["InheritRedirectPorts"].Value); - connectionInfo.Inheritance.RedirectPrinters = bool.Parse(xmlnode.Attributes["InheritRedirectPrinters"].Value); - connectionInfo.Inheritance.RedirectSmartCards = bool.Parse(xmlnode.Attributes["InheritRedirectSmartCards"].Value); - connectionInfo.Inheritance.RedirectSound = bool.Parse(xmlnode.Attributes["InheritRedirectSound"].Value); - connectionInfo.Inheritance.Resolution = bool.Parse(xmlnode.Attributes["InheritResolution"].Value); - connectionInfo.Inheritance.UseConsoleSession = bool.Parse(xmlnode.Attributes["InheritUseConsoleSession"].Value); + connectionInfo.Inheritance.CacheBitmaps = xmlnode.GetAttributeAsBool("InheritCacheBitmaps"); + connectionInfo.Inheritance.Colors = xmlnode.GetAttributeAsBool("InheritColors"); + connectionInfo.Inheritance.Description = xmlnode.GetAttributeAsBool("InheritDescription"); + connectionInfo.Inheritance.DisplayThemes = xmlnode.GetAttributeAsBool("InheritDisplayThemes"); + connectionInfo.Inheritance.DisplayWallpaper = xmlnode.GetAttributeAsBool("InheritDisplayWallpaper"); + connectionInfo.Inheritance.Icon = xmlnode.GetAttributeAsBool("InheritIcon"); + connectionInfo.Inheritance.Panel = xmlnode.GetAttributeAsBool("InheritPanel"); + connectionInfo.Inheritance.Port = xmlnode.GetAttributeAsBool("InheritPort"); + connectionInfo.Inheritance.Protocol = xmlnode.GetAttributeAsBool("InheritProtocol"); + connectionInfo.Inheritance.PuttySession = xmlnode.GetAttributeAsBool("InheritPuttySession"); + connectionInfo.Inheritance.RedirectDiskDrives = xmlnode.GetAttributeAsBool("InheritRedirectDiskDrives"); + connectionInfo.Inheritance.RedirectKeys = xmlnode.GetAttributeAsBool("InheritRedirectKeys"); + connectionInfo.Inheritance.RedirectPorts = xmlnode.GetAttributeAsBool("InheritRedirectPorts"); + connectionInfo.Inheritance.RedirectPrinters = xmlnode.GetAttributeAsBool("InheritRedirectPrinters"); + connectionInfo.Inheritance.RedirectSmartCards = xmlnode.GetAttributeAsBool("InheritRedirectSmartCards"); + connectionInfo.Inheritance.RedirectSound = xmlnode.GetAttributeAsBool("InheritRedirectSound"); + connectionInfo.Inheritance.Resolution = xmlnode.GetAttributeAsBool("InheritResolution"); + connectionInfo.Inheritance.UseConsoleSession = xmlnode.GetAttributeAsBool("InheritUseConsoleSession"); if (!Runtime.UseCredentialManager || _confVersion <= 2.6) // 1.3 - 2.6 { - connectionInfo.Inheritance.Domain = bool.Parse(xmlnode.Attributes["InheritDomain"].Value); - connectionInfo.Inheritance.Password = bool.Parse(xmlnode.Attributes["InheritPassword"].Value); - connectionInfo.Inheritance.Username = bool.Parse(xmlnode.Attributes["InheritUsername"].Value); + connectionInfo.Inheritance.Domain = xmlnode.GetAttributeAsBool("InheritDomain"); + connectionInfo.Inheritance.Password = xmlnode.GetAttributeAsBool("InheritPassword"); + connectionInfo.Inheritance.Username = xmlnode.GetAttributeAsBool("InheritUsername"); } - connectionInfo.Icon = xmlnode.Attributes["Icon"].Value; - connectionInfo.Panel = xmlnode.Attributes["Panel"].Value; + connectionInfo.Icon = xmlnode.GetAttributeAsString("Icon"); + connectionInfo.Panel = xmlnode.GetAttributeAsString("Panel"); } else { - if (Convert.ToBoolean(xmlnode.Attributes["Inherit"].Value)) + if (xmlnode.GetAttributeAsBool("Inherit")) connectionInfo.Inheritance.TurnOnInheritanceCompletely(); - connectionInfo.Icon = Convert.ToString(xmlnode.Attributes["Icon"].Value.Replace(".ico", "")); + connectionInfo.Icon = xmlnode.GetAttributeAsString("Icon").Replace(".ico", ""); connectionInfo.Panel = Language.strGeneral; } if (_confVersion >= 1.5) { - connectionInfo.PleaseConnect = bool.Parse(xmlnode.Attributes["Connected"].Value); + connectionInfo.PleaseConnect = xmlnode.GetAttributeAsBool("Connected"); } if (_confVersion >= 1.6) { - connectionInfo.ICAEncryptionStrength = (IcaProtocol.EncryptionStrength)Enum.Parse(typeof(IcaProtocol.EncryptionStrength), xmlnode.Attributes["ICAEncryptionStrength"].Value, true); - connectionInfo.Inheritance.ICAEncryptionStrength = bool.Parse(xmlnode.Attributes["InheritICAEncryptionStrength"].Value); - connectionInfo.PreExtApp = xmlnode.Attributes["PreExtApp"].Value; - connectionInfo.PostExtApp = xmlnode.Attributes["PostExtApp"].Value; - connectionInfo.Inheritance.PreExtApp = bool.Parse(xmlnode.Attributes["InheritPreExtApp"].Value); - connectionInfo.Inheritance.PostExtApp = bool.Parse(xmlnode.Attributes["InheritPostExtApp"].Value); + connectionInfo.ICAEncryptionStrength = xmlnode.GetAttributeAsEnum("ICAEncryptionStrength"); + connectionInfo.Inheritance.ICAEncryptionStrength = xmlnode.GetAttributeAsBool("InheritICAEncryptionStrength"); + connectionInfo.PreExtApp = xmlnode.GetAttributeAsString("PreExtApp"); + connectionInfo.PostExtApp = xmlnode.GetAttributeAsString("PostExtApp"); + connectionInfo.Inheritance.PreExtApp = xmlnode.GetAttributeAsBool("InheritPreExtApp"); + connectionInfo.Inheritance.PostExtApp = xmlnode.GetAttributeAsBool("InheritPostExtApp"); } if (_confVersion >= 1.7) { - connectionInfo.VNCCompression = (ProtocolVNC.Compression)Enum.Parse(typeof(ProtocolVNC.Compression), xmlnode.Attributes["VNCCompression"].Value, true); - connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Enum.Parse(typeof(ProtocolVNC.Encoding), xmlnode.Attributes["VNCEncoding"].Value, true); - connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Enum.Parse(typeof(ProtocolVNC.AuthMode), xmlnode.Attributes["VNCAuthMode"].Value, true); - connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Enum.Parse(typeof(ProtocolVNC.ProxyType), xmlnode.Attributes["VNCProxyType"].Value, true); - connectionInfo.VNCProxyIP = xmlnode.Attributes["VNCProxyIP"].Value; - connectionInfo.VNCProxyPort = Convert.ToInt32(xmlnode.Attributes["VNCProxyPort"].Value); - connectionInfo.VNCProxyUsername = xmlnode.Attributes["VNCProxyUsername"].Value; - connectionInfo.VNCProxyPassword = _decryptor.Decrypt(xmlnode.Attributes["VNCProxyPassword"].Value); - connectionInfo.VNCColors = (ProtocolVNC.Colors)Enum.Parse(typeof(ProtocolVNC.Colors), xmlnode.Attributes["VNCColors"].Value, true); - connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Enum.Parse(typeof(ProtocolVNC.SmartSizeMode), xmlnode.Attributes["VNCSmartSizeMode"].Value, true); - connectionInfo.VNCViewOnly = bool.Parse(xmlnode.Attributes["VNCViewOnly"].Value); - connectionInfo.Inheritance.VNCCompression = bool.Parse(xmlnode.Attributes["InheritVNCCompression"].Value); - connectionInfo.Inheritance.VNCEncoding = bool.Parse(xmlnode.Attributes["InheritVNCEncoding"].Value); - connectionInfo.Inheritance.VNCAuthMode = bool.Parse(xmlnode.Attributes["InheritVNCAuthMode"].Value); - connectionInfo.Inheritance.VNCProxyType = bool.Parse(xmlnode.Attributes["InheritVNCProxyType"].Value); - connectionInfo.Inheritance.VNCProxyIP = bool.Parse(xmlnode.Attributes["InheritVNCProxyIP"].Value); - connectionInfo.Inheritance.VNCProxyPort = bool.Parse(xmlnode.Attributes["InheritVNCProxyPort"].Value); - connectionInfo.Inheritance.VNCProxyUsername = bool.Parse(xmlnode.Attributes["InheritVNCProxyUsername"].Value); - connectionInfo.Inheritance.VNCProxyPassword = bool.Parse(xmlnode.Attributes["InheritVNCProxyPassword"].Value); - connectionInfo.Inheritance.VNCColors = bool.Parse(xmlnode.Attributes["InheritVNCColors"].Value); - connectionInfo.Inheritance.VNCSmartSizeMode = bool.Parse(xmlnode.Attributes["InheritVNCSmartSizeMode"].Value); - connectionInfo.Inheritance.VNCViewOnly = bool.Parse(xmlnode.Attributes["InheritVNCViewOnly"].Value); + connectionInfo.VNCCompression = xmlnode.GetAttributeAsEnum("VNCCompression"); + connectionInfo.VNCEncoding = xmlnode.GetAttributeAsEnum("VNCEncoding"); + connectionInfo.VNCAuthMode = xmlnode.GetAttributeAsEnum("VNCAuthMode"); + connectionInfo.VNCProxyType = xmlnode.GetAttributeAsEnum("VNCProxyType"); + connectionInfo.VNCProxyIP = xmlnode.GetAttributeAsString("VNCProxyIP"); + connectionInfo.VNCProxyPort = xmlnode.GetAttributeAsInt("VNCProxyPort"); + connectionInfo.VNCProxyUsername = xmlnode.GetAttributeAsString("VNCProxyUsername"); + connectionInfo.VNCProxyPassword = _decryptor.Decrypt(xmlnode.GetAttributeAsString("VNCProxyPassword")); + connectionInfo.VNCColors = xmlnode.GetAttributeAsEnum("VNCColors"); + connectionInfo.VNCSmartSizeMode = xmlnode.GetAttributeAsEnum("VNCSmartSizeMode"); + connectionInfo.VNCViewOnly = xmlnode.GetAttributeAsBool("VNCViewOnly"); + connectionInfo.Inheritance.VNCCompression = xmlnode.GetAttributeAsBool("InheritVNCCompression"); + connectionInfo.Inheritance.VNCEncoding = xmlnode.GetAttributeAsBool("InheritVNCEncoding"); + connectionInfo.Inheritance.VNCAuthMode = xmlnode.GetAttributeAsBool("InheritVNCAuthMode"); + connectionInfo.Inheritance.VNCProxyType = xmlnode.GetAttributeAsBool("InheritVNCProxyType"); + connectionInfo.Inheritance.VNCProxyIP = xmlnode.GetAttributeAsBool("InheritVNCProxyIP"); + connectionInfo.Inheritance.VNCProxyPort = xmlnode.GetAttributeAsBool("InheritVNCProxyPort"); + connectionInfo.Inheritance.VNCProxyUsername = xmlnode.GetAttributeAsBool("InheritVNCProxyUsername"); + connectionInfo.Inheritance.VNCProxyPassword = xmlnode.GetAttributeAsBool("InheritVNCProxyPassword"); + connectionInfo.Inheritance.VNCColors = xmlnode.GetAttributeAsBool("InheritVNCColors"); + connectionInfo.Inheritance.VNCSmartSizeMode = xmlnode.GetAttributeAsBool("InheritVNCSmartSizeMode"); + connectionInfo.Inheritance.VNCViewOnly = xmlnode.GetAttributeAsBool("InheritVNCViewOnly"); } if (_confVersion >= 1.8) { - connectionInfo.RDPAuthenticationLevel = (RdpProtocol.AuthenticationLevel)Enum.Parse(typeof(RdpProtocol.AuthenticationLevel), xmlnode.Attributes["RDPAuthenticationLevel"].Value, true); - connectionInfo.Inheritance.RDPAuthenticationLevel = bool.Parse(xmlnode.Attributes["InheritRDPAuthenticationLevel"].Value); + connectionInfo.RDPAuthenticationLevel = xmlnode.GetAttributeAsEnum("RDPAuthenticationLevel"); + connectionInfo.Inheritance.RDPAuthenticationLevel = xmlnode.GetAttributeAsBool("InheritRDPAuthenticationLevel"); } if (_confVersion >= 1.9) { - connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Enum.Parse(typeof(HTTPBase.RenderingEngine), xmlnode.Attributes["RenderingEngine"].Value, true); - connectionInfo.MacAddress = xmlnode.Attributes["MacAddress"].Value; - connectionInfo.Inheritance.RenderingEngine = bool.Parse(xmlnode.Attributes["InheritRenderingEngine"].Value); - connectionInfo.Inheritance.MacAddress = bool.Parse(xmlnode.Attributes["InheritMacAddress"].Value); + connectionInfo.RenderingEngine = xmlnode.GetAttributeAsEnum("RenderingEngine"); + connectionInfo.MacAddress = xmlnode.GetAttributeAsString("MacAddress"); + connectionInfo.Inheritance.RenderingEngine = xmlnode.GetAttributeAsBool("InheritRenderingEngine"); + connectionInfo.Inheritance.MacAddress = xmlnode.GetAttributeAsBool("InheritMacAddress"); } if (_confVersion >= 2.0) { - connectionInfo.UserField = xmlnode.Attributes["UserField"].Value; - connectionInfo.Inheritance.UserField = bool.Parse(xmlnode.Attributes["InheritUserField"].Value); + connectionInfo.UserField = xmlnode.GetAttributeAsString("UserField"); + connectionInfo.Inheritance.UserField = xmlnode.GetAttributeAsBool("InheritUserField"); } if (_confVersion >= 2.1) { - connectionInfo.ExtApp = xmlnode.Attributes["ExtApp"].Value; - connectionInfo.Inheritance.ExtApp = bool.Parse(xmlnode.Attributes["InheritExtApp"].Value); + connectionInfo.ExtApp = xmlnode.GetAttributeAsString("ExtApp"); + connectionInfo.Inheritance.ExtApp = xmlnode.GetAttributeAsBool("InheritExtApp"); } if (_confVersion >= 2.2) { // Get settings - connectionInfo.RDGatewayUsageMethod = (RdpProtocol.RDGatewayUsageMethod)Enum.Parse(typeof(RdpProtocol.RDGatewayUsageMethod), xmlnode.Attributes["RDGatewayUsageMethod"].Value, true); - connectionInfo.RDGatewayHostname = xmlnode.Attributes["RDGatewayHostname"].Value; - connectionInfo.RDGatewayUseConnectionCredentials = (RdpProtocol.RDGatewayUseConnectionCredentials)Enum.Parse(typeof(RdpProtocol.RDGatewayUseConnectionCredentials), xmlnode.Attributes["RDGatewayUseConnectionCredentials"].Value, true); - connectionInfo.RDGatewayUsername = xmlnode.Attributes["RDGatewayUsername"].Value; - connectionInfo.RDGatewayPassword = _decryptor.Decrypt(Convert.ToString(xmlnode.Attributes["RDGatewayPassword"].Value)); - connectionInfo.RDGatewayDomain = xmlnode.Attributes["RDGatewayDomain"].Value; + connectionInfo.RDGatewayUsageMethod = xmlnode.GetAttributeAsEnum("RDGatewayUsageMethod"); + connectionInfo.RDGatewayHostname = xmlnode.GetAttributeAsString("RDGatewayHostname"); + connectionInfo.RDGatewayUseConnectionCredentials = xmlnode.GetAttributeAsEnum("RDGatewayUseConnectionCredentials"); + connectionInfo.RDGatewayUsername = xmlnode.GetAttributeAsString("RDGatewayUsername"); + connectionInfo.RDGatewayPassword = _decryptor.Decrypt(xmlnode.GetAttributeAsString("RDGatewayPassword")); + connectionInfo.RDGatewayDomain = xmlnode.GetAttributeAsString("RDGatewayDomain"); // Get inheritance settings - connectionInfo.Inheritance.RDGatewayUsageMethod = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsageMethod"].Value); - connectionInfo.Inheritance.RDGatewayHostname = bool.Parse(xmlnode.Attributes["InheritRDGatewayHostname"].Value); - connectionInfo.Inheritance.RDGatewayUseConnectionCredentials = bool.Parse(xmlnode.Attributes["InheritRDGatewayUseConnectionCredentials"].Value); - connectionInfo.Inheritance.RDGatewayUsername = bool.Parse(xmlnode.Attributes["InheritRDGatewayUsername"].Value); - connectionInfo.Inheritance.RDGatewayPassword = bool.Parse(xmlnode.Attributes["InheritRDGatewayPassword"].Value); - connectionInfo.Inheritance.RDGatewayDomain = bool.Parse(xmlnode.Attributes["InheritRDGatewayDomain"].Value); + connectionInfo.Inheritance.RDGatewayUsageMethod = xmlnode.GetAttributeAsBool("InheritRDGatewayUsageMethod"); + connectionInfo.Inheritance.RDGatewayHostname = xmlnode.GetAttributeAsBool("InheritRDGatewayHostname"); + connectionInfo.Inheritance.RDGatewayUseConnectionCredentials = xmlnode.GetAttributeAsBool("InheritRDGatewayUseConnectionCredentials"); + connectionInfo.Inheritance.RDGatewayUsername = xmlnode.GetAttributeAsBool("InheritRDGatewayUsername"); + connectionInfo.Inheritance.RDGatewayPassword = xmlnode.GetAttributeAsBool("InheritRDGatewayPassword"); + connectionInfo.Inheritance.RDGatewayDomain = xmlnode.GetAttributeAsBool("InheritRDGatewayDomain"); } if (_confVersion >= 2.3) { // Get settings - connectionInfo.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["EnableFontSmoothing"].Value); - connectionInfo.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["EnableDesktopComposition"].Value); + connectionInfo.EnableFontSmoothing = xmlnode.GetAttributeAsBool("EnableFontSmoothing"); + connectionInfo.EnableDesktopComposition = xmlnode.GetAttributeAsBool("EnableDesktopComposition"); // Get inheritance settings - connectionInfo.Inheritance.EnableFontSmoothing = bool.Parse(xmlnode.Attributes["InheritEnableFontSmoothing"].Value); - connectionInfo.Inheritance.EnableDesktopComposition = bool.Parse(xmlnode.Attributes["InheritEnableDesktopComposition"].Value); + connectionInfo.Inheritance.EnableFontSmoothing = xmlnode.GetAttributeAsBool("InheritEnableFontSmoothing"); + connectionInfo.Inheritance.EnableDesktopComposition = xmlnode.GetAttributeAsBool("InheritEnableDesktopComposition"); } if (_confVersion >= 2.4) { - connectionInfo.UseCredSsp = bool.Parse(xmlnode.Attributes["UseCredSsp"].Value); - connectionInfo.Inheritance.UseCredSsp = bool.Parse(xmlnode.Attributes["InheritUseCredSsp"].Value); + connectionInfo.UseCredSsp = xmlnode.GetAttributeAsBool("UseCredSsp"); + connectionInfo.Inheritance.UseCredSsp = xmlnode.GetAttributeAsBool("InheritUseCredSsp"); } if (_confVersion >= 2.5) { - connectionInfo.LoadBalanceInfo = xmlnode.Attributes["LoadBalanceInfo"].Value; - connectionInfo.AutomaticResize = bool.Parse(xmlnode.Attributes["AutomaticResize"].Value); - connectionInfo.Inheritance.LoadBalanceInfo = bool.Parse(xmlnode.Attributes["InheritLoadBalanceInfo"].Value); - connectionInfo.Inheritance.AutomaticResize = bool.Parse(xmlnode.Attributes["InheritAutomaticResize"].Value); + connectionInfo.LoadBalanceInfo = xmlnode.GetAttributeAsString("LoadBalanceInfo"); + connectionInfo.AutomaticResize = xmlnode.GetAttributeAsBool("AutomaticResize"); + connectionInfo.Inheritance.LoadBalanceInfo = xmlnode.GetAttributeAsBool("InheritLoadBalanceInfo"); + connectionInfo.Inheritance.AutomaticResize = xmlnode.GetAttributeAsBool("InheritAutomaticResize"); } if (_confVersion >= 2.6) { - connectionInfo.SoundQuality = (RdpProtocol.RDPSoundQuality)Enum.Parse(typeof(RdpProtocol.RDPSoundQuality), xmlnode.Attributes["SoundQuality"].Value, true); - connectionInfo.Inheritance.SoundQuality = bool.Parse(xmlnode.Attributes["InheritSoundQuality"].Value); - connectionInfo.RDPMinutesToIdleTimeout = Convert.ToInt32(xmlnode.Attributes["RDPMinutesToIdleTimeout"]?.Value ?? "0"); - connectionInfo.Inheritance.RDPMinutesToIdleTimeout = bool.Parse(xmlnode.Attributes["InheritRDPMinutesToIdleTimeout"]?.Value ?? "False"); - connectionInfo.RDPAlertIdleTimeout = bool.Parse(xmlnode.Attributes["RDPAlertIdleTimeout"]?.Value ?? "False"); - connectionInfo.Inheritance.RDPAlertIdleTimeout = bool.Parse(xmlnode.Attributes["InheritRDPAlertIdleTimeout"]?.Value ?? "False"); + connectionInfo.SoundQuality = xmlnode.GetAttributeAsEnum("SoundQuality"); + connectionInfo.Inheritance.SoundQuality = xmlnode.GetAttributeAsBool("InheritSoundQuality"); + connectionInfo.RDPMinutesToIdleTimeout = xmlnode.GetAttributeAsInt("RDPMinutesToIdleTimeout"); + connectionInfo.Inheritance.RDPMinutesToIdleTimeout = xmlnode.GetAttributeAsBool("InheritRDPMinutesToIdleTimeout"); + connectionInfo.RDPAlertIdleTimeout = xmlnode.GetAttributeAsBool("RDPAlertIdleTimeout"); + connectionInfo.Inheritance.RDPAlertIdleTimeout = xmlnode.GetAttributeAsBool("InheritRDPAlertIdleTimeout"); } if(_confVersion >= 2.7) { - connectionInfo.RedirectClipboard = bool.Parse(xmlnode.Attributes["RedirectClipboard"].Value); - connectionInfo.Inheritance.RedirectClipboard = bool.Parse(xmlnode.Attributes["InheritRedirectClipboard"].Value); + connectionInfo.RedirectClipboard = xmlnode.GetAttributeAsBool("RedirectClipboard"); + connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard"); connectionInfo.CredentialRecordId = Guid.TryParse(xmlnode.Attributes["CredentialId"]?.Value, out var credId) ? credId : Optional.Empty; - connectionInfo.Inheritance.CredentialId = bool.TryParse(xmlnode.Attributes["InheritCredentialId"]?.Value, out var inheritCreds) && inheritCreds; + connectionInfo.Inheritance.CredentialId = xmlnode.GetAttributeAsBool("InheritCredentialId"); } } catch (Exception ex) diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs new file mode 100644 index 000000000..71ecbff73 --- /dev/null +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs @@ -0,0 +1,48 @@ +using System; +using System.Xml; + +namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml +{ + public static class XmlExtensions + { + public static string GetAttributeAsString(this XmlNode xmlNode, string attribute, string defaultValue = "") + { + var value = xmlNode?.Attributes?[attribute]?.Value; + return value ?? defaultValue; + } + + public static bool GetAttributeAsBool(this XmlNode xmlNode, string attribute, bool defaultValue = false) + { + var value = xmlNode?.Attributes?[attribute]?.Value; + if (string.IsNullOrWhiteSpace(value)) + return defaultValue; + + return bool.TryParse(value, out var valueAsBool) + ? valueAsBool + : defaultValue; + } + + public static int GetAttributeAsInt(this XmlNode xmlNode, string attribute, int defaultValue = 0) + { + var value = xmlNode?.Attributes?[attribute]?.Value; + if (string.IsNullOrWhiteSpace(value)) + return defaultValue; + + return int.TryParse(value, out var valueAsBool) + ? valueAsBool + : defaultValue; + } + + public static T GetAttributeAsEnum(this XmlNode xmlNode, string attribute, T defaultValue = default(T)) + where T : struct + { + var value = xmlNode?.Attributes?[attribute]?.Value; + if (string.IsNullOrWhiteSpace(value)) + return defaultValue; + + return Enum.TryParse(value, true, out var valueAsEnum) + ? valueAsEnum + : defaultValue; + } + } +} diff --git a/mRemoteV1/References/ADTree.dll b/mRemoteV1/References/ADTree.dll index 98e435b33..c6551e06e 100644 Binary files a/mRemoteV1/References/ADTree.dll and b/mRemoteV1/References/ADTree.dll differ diff --git a/mRemoteV1/References/VncSharp.dll b/mRemoteV1/References/VncSharp.dll index 9ccd4e121..f9bd733ce 100644 Binary files a/mRemoteV1/References/VncSharp.dll and b/mRemoteV1/References/VncSharp.dll differ diff --git a/mRemoteV1/Schemas/mremoteng_confcons_v2_8.xsd b/mRemoteV1/Schemas/mremoteng_confcons_v2_8.xsd deleted file mode 100644 index 1c08ef985..000000000 --- a/mRemoteV1/Schemas/mremoteng_confcons_v2_8.xsd +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mRemoteV1/Themes/ThemeManager.cs b/mRemoteV1/Themes/ThemeManager.cs index 8b0c38351..0bddccfe6 100644 --- a/mRemoteV1/Themes/ThemeManager.cs +++ b/mRemoteV1/Themes/ThemeManager.cs @@ -12,8 +12,8 @@ using WeifenLuo.WinFormsUI.Docking; namespace mRemoteNG.Themes { /// - /// Main class of the theming component. Centralices creation, loading and deletion of themes - /// Implmeented as a singleton + /// Main class of the theming component. Centralizes creation, loading and deletion of themes + /// Implemented as a singleton /// public class ThemeManager { @@ -232,6 +232,9 @@ namespace mRemoteNG.Themes NotifyThemeChanged(this, new PropertyChangedEventArgs("theme")); } } + + public int ThemesCount => themes.Count; + #endregion } } \ No newline at end of file diff --git a/mRemoteV1/Tools/MultiSSHController.cs b/mRemoteV1/Tools/MultiSSHController.cs index 25d2b08c8..ffc14cdbc 100644 --- a/mRemoteV1/Tools/MultiSSHController.cs +++ b/mRemoteV1/Tools/MultiSSHController.cs @@ -10,12 +10,12 @@ namespace mRemoteNG.Tools { public class MultiSSHController { - private ArrayList processHandlers = new ArrayList(); - private ArrayList quickConnectConnections = new ArrayList(); - private ArrayList previousCommands = new ArrayList(); - private int previousCommandIndex = 0; + private readonly ArrayList processHandlers = new ArrayList(); + private readonly ArrayList quickConnectConnections = new ArrayList(); + private readonly ArrayList previousCommands = new ArrayList(); + private int previousCommandIndex; - public int CommandHistoryLength { get; set; } = 100; + private int CommandHistoryLength { get; set; } = 100; public MultiSSHController(TextBox txtBox) { @@ -41,7 +41,7 @@ namespace mRemoteNG.Tools private ArrayList ProcessOpenConnections(ConnectionInfo connection) { - ArrayList handlers = new ArrayList(); + var handlers = new ArrayList(); foreach (ProtocolBase _base in connection.OpenConnections) { @@ -77,7 +77,7 @@ namespace mRemoteNG.Tools var connectionTreeConnections = Runtime.ConnectionsService.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); - foreach (ConnectionInfo connection in connectionTreeConnections) + foreach (var connection in connectionTreeConnections) { processHandlers.AddRange(ProcessOpenConnections(connection)); } @@ -85,8 +85,7 @@ namespace mRemoteNG.Tools private void processKeyPress(object sender, KeyEventArgs e) { - TextBox txtMultiSSH = sender as TextBox; - if (txtMultiSSH == null) return; + if (!(sender is TextBox txtMultiSSH)) return; if (processHandlers.Count == 0) { @@ -111,42 +110,37 @@ namespace mRemoteNG.Tools txtMultiSSH.Select(txtMultiSSH.TextLength, 0); } - if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) + if (e.Control && e.KeyCode != Keys.V && e.Alt == false) { SendAllKeystrokes(NativeMethods.WM_KEYDOWN, e.KeyValue); } - if (e.KeyCode == Keys.Enter) + if (e.KeyCode != Keys.Enter) return; + var strLine = txtMultiSSH.Text; + foreach (var chr1 in strLine) { - string strLine = txtMultiSSH.Text; - foreach (char chr1 in strLine) - { - SendAllKeystrokes(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); - } - SendAllKeystrokes(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 + SendAllKeystrokes(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); } + SendAllKeystrokes(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 } private void processKeyRelease(object sender, KeyEventArgs e) { - TextBox txtMultiSSH = sender as TextBox; - if (txtMultiSSH == null) return; + if (!(sender is TextBox txtMultiSSH)) return; - if (e.KeyCode == Keys.Enter) + if (e.KeyCode != Keys.Enter) return; + if (txtMultiSSH.Text.Trim() != "") { - if (txtMultiSSH.Text.Trim() != "") - { - previousCommands.Add(txtMultiSSH.Text.Trim()); - } - if (previousCommands.Count >= CommandHistoryLength) - { - previousCommands.RemoveAt(0); - } - - previousCommandIndex = previousCommands.Count - 1; - txtMultiSSH.Clear(); - } + previousCommands.Add(txtMultiSSH.Text.Trim()); } + if (previousCommands.Count >= CommandHistoryLength) + { + previousCommands.RemoveAt(0); + } + + previousCommandIndex = previousCommands.Count - 1; + txtMultiSSH.Clear(); + } #endregion } } diff --git a/mRemoteV1/Tools/ReconnectGroup.Designer.cs b/mRemoteV1/Tools/ReconnectGroup.Designer.cs index 6e6e17994..3902cd378 100644 --- a/mRemoteV1/Tools/ReconnectGroup.Designer.cs +++ b/mRemoteV1/Tools/ReconnectGroup.Designer.cs @@ -18,110 +18,111 @@ namespace mRemoteNG.Tools } } - //Required by the Windows Form Designer - private System.ComponentModel.Container components = null; - //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() { - this.components = new System.ComponentModel.Container(); - this.grpAutomaticReconnect = new System.Windows.Forms.GroupBox(); - this.lblAnimation = new UI.Controls.Base.NGLabel(); - this.btnClose = new UI.Controls.Base.NGButton(); - this.btnClose.Click += new System.EventHandler(this.btnClose_Click); - this.lblServerStatus = new UI.Controls.Base.NGLabel(); - this.chkReconnectWhenReady = new UI.Controls.Base.NGCheckBox(); - this.chkReconnectWhenReady.CheckedChanged += new System.EventHandler(this.chkReconnectWhenReady_CheckedChanged); - this.pbServerStatus = new System.Windows.Forms.PictureBox(); - this.tmrAnimation = new System.Windows.Forms.Timer(this.components); - this.tmrAnimation.Tick += new System.EventHandler(this.tmrAnimation_Tick); - this.grpAutomaticReconnect.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize) this.pbServerStatus).BeginInit(); - this.SuspendLayout(); - // - //grpAutomaticReconnect - // - this.grpAutomaticReconnect.BackColor = System.Drawing.Color.White; - this.grpAutomaticReconnect.Controls.Add(this.lblAnimation); - this.grpAutomaticReconnect.Controls.Add(this.btnClose); - this.grpAutomaticReconnect.Controls.Add(this.lblServerStatus); - this.grpAutomaticReconnect.Controls.Add(this.chkReconnectWhenReady); - this.grpAutomaticReconnect.Controls.Add(this.pbServerStatus); - this.grpAutomaticReconnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.grpAutomaticReconnect.Location = new System.Drawing.Point(3, 0); - this.grpAutomaticReconnect.Name = "grpAutomaticReconnect"; - this.grpAutomaticReconnect.Size = new System.Drawing.Size(171, 98); - this.grpAutomaticReconnect.TabIndex = 8; - this.grpAutomaticReconnect.TabStop = false; - this.grpAutomaticReconnect.Text = Language.strGroupboxAutomaticReconnect; - // - //lblAnimation - // - this.lblAnimation.Location = new System.Drawing.Point(124, 22); - this.lblAnimation.Name = "lblAnimation"; - this.lblAnimation.Size = new System.Drawing.Size(32, 17); - this.lblAnimation.TabIndex = 8; - // - //btnClose - // - this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnClose.Location = new System.Drawing.Point(6, 67); - this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(159, 23); - this.btnClose.TabIndex = 7; - this.btnClose.Text = Language.strButtonClose; - this.btnClose.UseVisualStyleBackColor = true; - // - //lblServerStatus - // - this.lblServerStatus.AutoSize = true; - this.lblServerStatus.Location = new System.Drawing.Point(15, 24); - this.lblServerStatus.Name = "lblServerStatus"; - this.lblServerStatus.Size = new System.Drawing.Size(74, 13); - this.lblServerStatus.TabIndex = 3; - this.lblServerStatus.Text = "Server Status:"; - // - //chkReconnectWhenReady - // - this.chkReconnectWhenReady.AutoSize = true; - this.chkReconnectWhenReady.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.chkReconnectWhenReady.Location = new System.Drawing.Point(18, 44); - this.chkReconnectWhenReady.Name = "chkReconnectWhenReady"; - this.chkReconnectWhenReady.Size = new System.Drawing.Size(129, 17); - this.chkReconnectWhenReady.TabIndex = 6; - this.chkReconnectWhenReady.Text = Language.strCheckboxReconnectWhenReady; - this.chkReconnectWhenReady.UseVisualStyleBackColor = true; - // - //pbServerStatus - // - this.pbServerStatus.Image = Resources.HostStatus_Check; - this.pbServerStatus.Location = new System.Drawing.Point(99, 23); - this.pbServerStatus.Name = "pbServerStatus"; - this.pbServerStatus.Size = new System.Drawing.Size(16, 16); - this.pbServerStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pbServerStatus.TabIndex = 5; - this.pbServerStatus.TabStop = false; - // - //tmrAnimation - // - this.tmrAnimation.Enabled = true; - this.tmrAnimation.Interval = 200; - // - //ReconnectGroup - // - this.AutoScaleDimensions = new System.Drawing.SizeF((float) (6.0F), (float) (13.0F)); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.grpAutomaticReconnect); - this.Name = "ReconnectGroup"; - this.Size = new System.Drawing.Size(228, 138); - this.grpAutomaticReconnect.ResumeLayout(false); - this.grpAutomaticReconnect.PerformLayout(); - ((System.ComponentModel.ISupportInitialize) this.pbServerStatus).EndInit(); - this.ResumeLayout(false); + this.components = new System.ComponentModel.Container(); + this.grpAutomaticReconnect = new System.Windows.Forms.GroupBox(); + this.lblAnimation = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.btnClose = new mRemoteNG.UI.Controls.Base.NGButton(); + this.lblServerStatus = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.chkReconnectWhenReady = new mRemoteNG.UI.Controls.Base.NGCheckBox(); + this.pbServerStatus = new System.Windows.Forms.PictureBox(); + this.tmrAnimation = new System.Windows.Forms.Timer(this.components); + this.grpAutomaticReconnect.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbServerStatus)).BeginInit(); + this.SuspendLayout(); + // + // grpAutomaticReconnect + // + this.grpAutomaticReconnect.BackColor = System.Drawing.Color.White; + this.grpAutomaticReconnect.Controls.Add(this.lblAnimation); + this.grpAutomaticReconnect.Controls.Add(this.btnClose); + this.grpAutomaticReconnect.Controls.Add(this.lblServerStatus); + this.grpAutomaticReconnect.Controls.Add(this.chkReconnectWhenReady); + this.grpAutomaticReconnect.Controls.Add(this.pbServerStatus); + this.grpAutomaticReconnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.grpAutomaticReconnect.Location = new System.Drawing.Point(3, 0); + this.grpAutomaticReconnect.Name = "grpAutomaticReconnect"; + this.grpAutomaticReconnect.Size = new System.Drawing.Size(171, 98); + this.grpAutomaticReconnect.TabIndex = 8; + this.grpAutomaticReconnect.TabStop = false; + this.grpAutomaticReconnect.Text = "Automatic Reconnect"; + // + // lblAnimation + // + this.lblAnimation.Location = new System.Drawing.Point(124, 22); + this.lblAnimation.Name = "lblAnimation"; + this.lblAnimation.Size = new System.Drawing.Size(32, 17); + this.lblAnimation.TabIndex = 8; + // + // btnClose + // + this.btnClose._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; + this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnClose.Location = new System.Drawing.Point(6, 67); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(159, 23); + this.btnClose.TabIndex = 7; + this.btnClose.Text = global::mRemoteNG.Language.strButtonClose; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // lblServerStatus + // + this.lblServerStatus.AutoSize = true; + this.lblServerStatus.Location = new System.Drawing.Point(15, 24); + this.lblServerStatus.Name = "lblServerStatus"; + this.lblServerStatus.Size = new System.Drawing.Size(76, 13); + this.lblServerStatus.TabIndex = 3; + this.lblServerStatus.Text = "Server Status:"; + // + // chkReconnectWhenReady + // + this.chkReconnectWhenReady._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; + this.chkReconnectWhenReady.AutoSize = true; + this.chkReconnectWhenReady.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.chkReconnectWhenReady.Location = new System.Drawing.Point(18, 44); + this.chkReconnectWhenReady.Name = "chkReconnectWhenReady"; + this.chkReconnectWhenReady.Size = new System.Drawing.Size(140, 17); + this.chkReconnectWhenReady.TabIndex = 6; + this.chkReconnectWhenReady.Text = global::mRemoteNG.Language.strCheckboxReconnectWhenReady; + this.chkReconnectWhenReady.UseVisualStyleBackColor = true; + this.chkReconnectWhenReady.CheckedChanged += new System.EventHandler(this.chkReconnectWhenReady_CheckedChanged); + // + // pbServerStatus + // + this.pbServerStatus.Image = global::mRemoteNG.Resources.HostStatus_Check; + this.pbServerStatus.Location = new System.Drawing.Point(99, 23); + this.pbServerStatus.Name = "pbServerStatus"; + this.pbServerStatus.Size = new System.Drawing.Size(16, 16); + this.pbServerStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pbServerStatus.TabIndex = 5; + this.pbServerStatus.TabStop = false; + // + // tmrAnimation + // + this.tmrAnimation.Enabled = true; + this.tmrAnimation.Interval = 200; + this.tmrAnimation.Tick += new System.EventHandler(this.tmrAnimation_Tick); + // + // ReconnectGroup + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.Controls.Add(this.grpAutomaticReconnect); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "ReconnectGroup"; + this.Size = new System.Drawing.Size(228, 138); + this.grpAutomaticReconnect.ResumeLayout(false); + this.grpAutomaticReconnect.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbServerStatus)).EndInit(); + this.ResumeLayout(false); + } internal System.Windows.Forms.GroupBox grpAutomaticReconnect; internal UI.Controls.Base.NGButton btnClose; @@ -130,5 +131,6 @@ namespace mRemoteNG.Tools internal System.Windows.Forms.PictureBox pbServerStatus; internal System.Windows.Forms.Timer tmrAnimation; internal UI.Controls.Base.NGLabel lblAnimation; - } + private System.ComponentModel.IContainer components; + } } \ No newline at end of file diff --git a/mRemoteV1/Tools/ReconnectGroup.cs b/mRemoteV1/Tools/ReconnectGroup.cs index bfc6510d5..d78361e24 100644 --- a/mRemoteV1/Tools/ReconnectGroup.cs +++ b/mRemoteV1/Tools/ReconnectGroup.cs @@ -12,11 +12,8 @@ namespace mRemoteNG.Tools private bool _ServerReady; public bool ServerReady { - get - { - return _ServerReady; - } - set + get => _ServerReady; + set { SetStatusImage(value ? Resources.HostStatus_On : Resources.HostStatus_Off); @@ -46,11 +43,8 @@ namespace mRemoteNG.Tools private bool _ReconnectWhenReady; public bool ReconnectWhenReady { - get - { - return _ReconnectWhenReady; - } - set + get => _ReconnectWhenReady; + set { _ReconnectWhenReady = value; SetCheckbox(value); @@ -76,15 +70,9 @@ namespace mRemoteNG.Tools public event CloseClickedEventHandler CloseClicked { - add - { - CloseClickedEvent = (CloseClickedEventHandler) Delegate.Combine(CloseClickedEvent, value); - } - remove - { - CloseClickedEvent = (CloseClickedEventHandler) Delegate.Remove(CloseClickedEvent, value); - } - } + add => CloseClickedEvent = (CloseClickedEventHandler) Delegate.Combine(CloseClickedEvent, value); + remove => CloseClickedEvent = (CloseClickedEventHandler) Delegate.Remove(CloseClickedEvent, value); + } private void btnClose_Click(object sender, EventArgs e) diff --git a/mRemoteV1/Tools/ReconnectGroup.resx b/mRemoteV1/Tools/ReconnectGroup.resx index 5a7628ea6..34ccac31d 100644 --- a/mRemoteV1/Tools/ReconnectGroup.resx +++ b/mRemoteV1/Tools/ReconnectGroup.resx @@ -112,15 +112,15 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 18, 18 - + 60 \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGButton.cs b/mRemoteV1/UI/Controls/Base/NGButton.cs index 5403d93d5..c4f266a38 100644 --- a/mRemoteV1/UI/Controls/Base/NGButton.cs +++ b/mRemoteV1/UI/Controls/Base/NGButton.cs @@ -128,5 +128,16 @@ namespace mRemoteNG.UI.Controls.Base } TextRenderer.DrawText(e.Graphics, Text, Font, ClientRectangle, fore, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGButton + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGButton.resx b/mRemoteV1/UI/Controls/Base/NGButton.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGButton.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGCheckBox.cs b/mRemoteV1/UI/Controls/Base/NGCheckBox.cs index 1902e3823..3b1c81dee 100644 --- a/mRemoteV1/UI/Controls/Base/NGCheckBox.cs +++ b/mRemoteV1/UI/Controls/Base/NGCheckBox.cs @@ -5,6 +5,12 @@ using System.Windows.Forms; namespace mRemoteNG.UI.Controls.Base { //Extended CheckBox class, the NGCheckBox onPaint completely repaint the control + + // + // If this causes design issues in the future, may want to think about migrating to + // CheckBoxRenderer: + // https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.checkboxrenderer?view=netframework-4.6 + // public class NGCheckBox : CheckBox { private ThemeManager _themeManager; @@ -14,6 +20,7 @@ namespace mRemoteNG.UI.Controls.Base public NGCheckBox() { + InitializeComponent(); ThemeManager.getInstance().ThemeChanged += OnCreateControl; var display = new DisplayProperties(); _checkboxSize = new Size(display.ScaleWidth(11), display.ScaleHeight(11)); @@ -114,12 +121,24 @@ namespace mRemoteNG.UI.Controls.Base if (Checked) { - e.Graphics.DrawString("\u2714", new Font(Font.FontFamily, 7f), new SolidBrush(glyph), -1, 1); + // | \uE001 |  |  | is the tick/check mark and it exists in Segoe UI Symbol at least... + e.Graphics.DrawString("\uE001", new Font("Segoe UI Symbol", 7.75f), new SolidBrush(glyph), -4, 0); } var textRect = new Rectangle(_textXCoord, 0, Width - 16, Height); TextRenderer.DrawText(e.Graphics, Text, Font, textRect, fore, Parent.BackColor, TextFormatFlags.PathEllipsis); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGCheckBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGCheckBox.resx b/mRemoteV1/UI/Controls/Base/NGCheckBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGCheckBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGComboBox.cs b/mRemoteV1/UI/Controls/Base/NGComboBox.cs index 133452a75..5a46ab8e5 100644 --- a/mRemoteV1/UI/Controls/Base/NGComboBox.cs +++ b/mRemoteV1/UI/Controls/Base/NGComboBox.cs @@ -137,6 +137,16 @@ namespace mRemoteNG.UI.Controls.Base TextRenderer.DrawText(e.Graphics, Text, Font, textRect, Fore, Back, TextFormatFlags.Left | TextFormatFlags.VerticalCenter); } + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGComboBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } + public T GetSelectedItemAs() where T : class { diff --git a/mRemoteV1/UI/Controls/Base/NGComboBox.resx b/mRemoteV1/UI/Controls/Base/NGComboBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGComboBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGGroupBox.cs b/mRemoteV1/UI/Controls/Base/NGGroupBox.cs index 3d369529f..8b52dbb85 100644 --- a/mRemoteV1/UI/Controls/Base/NGGroupBox.cs +++ b/mRemoteV1/UI/Controls/Base/NGGroupBox.cs @@ -86,6 +86,17 @@ namespace mRemoteNG.UI.Controls.Base e.Graphics.DrawLine(pen, bounds.Width - Padding.Right, num - Padding.Top, bounds.Width - Padding.Right, bounds.Height - Padding.Bottom); } RaisePaintEvent(this, e); - } + } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGGroupBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGGroupBox.resx b/mRemoteV1/UI/Controls/Base/NGGroupBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGGroupBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGLabel.cs b/mRemoteV1/UI/Controls/Base/NGLabel.cs index 47bb5f526..987bc55d1 100644 --- a/mRemoteV1/UI/Controls/Base/NGLabel.cs +++ b/mRemoteV1/UI/Controls/Base/NGLabel.cs @@ -96,6 +96,17 @@ namespace mRemoteNG.UI.Controls.Base var disabledtextLabel = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Disabled_Foreground"); TextRenderer.DrawText(e.Graphics, Text, Font, ClientRectangle, disabledtextLabel, _textFormatFlags); } - } + } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGLabel + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGLabel.resx b/mRemoteV1/UI/Controls/Base/NGLabel.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGLabel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGListView.cs b/mRemoteV1/UI/Controls/Base/NGListView.cs index 35c69c7a1..3c551d730 100644 --- a/mRemoteV1/UI/Controls/Base/NGListView.cs +++ b/mRemoteV1/UI/Controls/Base/NGListView.cs @@ -66,5 +66,18 @@ namespace mRemoteNG.UI.Controls.Base e.SubItem.Decoration = deco; } } + + private void InitializeComponent() + { + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + this.SuspendLayout(); + // + // NGListView + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGListView.resx b/mRemoteV1/UI/Controls/Base/NGListView.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGListView.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGNumericUpDown.cs b/mRemoteV1/UI/Controls/Base/NGNumericUpDown.cs index 4b6cec616..532470e16 100644 --- a/mRemoteV1/UI/Controls/Base/NGNumericUpDown.cs +++ b/mRemoteV1/UI/Controls/Base/NGNumericUpDown.cs @@ -11,7 +11,7 @@ namespace mRemoteNG.UI.Controls.Base internal class NGNumericUpDown : NumericUpDown { - private ThemeManager _themeManager; + private readonly ThemeManager _themeManager; private NGButton Up; private NGButton Down; @@ -28,23 +28,42 @@ namespace mRemoteNG.UI.Controls.Base ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground"); BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background"); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); - //Hide those nonthemable butons + if (Controls.Count > 0) - Controls[0].Hide(); + { + for (var i = 0; i < Controls.Count; i++) + { + //Remove those non-themable buttons + if (Controls[i].GetType().ToString().Equals("System.Windows.Forms.UpDownBase+UpDownButtons")) + Controls.Remove(Controls[i]); + + /* This is a bit of a hack. + * But if we have the buttons that we created already, redraw/return and don't add any more... + * + * OptionsPages are an example where the control is potentially created twice: + * AddOptionsPagesToListView and then LstOptionPages_SelectedIndexChanged + */ + if (!(Controls[i] is NGButton)) continue; + if (!Controls[i].Text.Equals("\u25B2") && !Controls[i].Text.Equals("\u25BC")) continue; + Invalidate(); + return; + } + } + //Add new themable buttons Up = new NGButton { Text = "\u25B2", - Font = new Font(Font.FontFamily, 6f) + Font = new Font(Font.FontFamily, 5f) }; - Up.SetBounds(Width - 17, 1, 16, Height / 2 - 1); + Up.SetBounds(Controls.Owner.Width - 17, 2, 16, Controls.Owner.Height / 2 - 1); Up.Click += Up_Click; Down = new NGButton { Text = "\u25BC", - Font = new Font(Font.FontFamily, 6f) + Font = new Font(Font.FontFamily, 5f) }; - Down.SetBounds(Width - 17, Height/2, 16, Height / 2 - 1); + Down.SetBounds(Controls.Owner.Width - 17, Controls.Owner.Height /2 + 1, 16, Controls.Owner.Height / 2 - 1); Down.Click += Down_Click; Controls.Add(Up); Controls.Add(Down); @@ -91,6 +110,17 @@ namespace mRemoteNG.UI.Controls.Base e.Graphics.DrawRectangle(new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Border"), 1), 0, 0, Width - 1, Height - 1); } - + private void InitializeComponent() + { + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + this.SuspendLayout(); + // + // NGNumericUpDown + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGNumericUpDown.resx b/mRemoteV1/UI/Controls/Base/NGNumericUpDown.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGNumericUpDown.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGRadioButton.cs b/mRemoteV1/UI/Controls/Base/NGRadioButton.cs index e4a7949c8..fc16b226b 100644 --- a/mRemoteV1/UI/Controls/Base/NGRadioButton.cs +++ b/mRemoteV1/UI/Controls/Base/NGRadioButton.cs @@ -119,5 +119,16 @@ namespace mRemoteNG.UI.Controls.Base g.FillEllipse(new SolidBrush(center), _circleSmall); g.DrawEllipse(new Pen(outline), _circle); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGRadioButton + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGRadioButton.resx b/mRemoteV1/UI/Controls/Base/NGRadioButton.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGRadioButton.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/Base/NGTextBox.cs b/mRemoteV1/UI/Controls/Base/NGTextBox.cs index 0d51c25e3..0356bf1de 100644 --- a/mRemoteV1/UI/Controls/Base/NGTextBox.cs +++ b/mRemoteV1/UI/Controls/Base/NGTextBox.cs @@ -50,6 +50,15 @@ namespace mRemoteNG.UI.Controls.Base Invalidate(); } - + private void InitializeComponent() + { + this.SuspendLayout(); + // + // NGTextBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Controls/Base/NGTextBox.resx b/mRemoteV1/UI/Controls/Base/NGTextBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/Base/NGTextBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.Designer.cs b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.Designer.cs index 637ff1747..f8c8d7b0d 100644 --- a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.Designer.cs +++ b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.Designer.cs @@ -15,7 +15,15 @@ /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + this.SuspendLayout(); + // + // ConnectionTree + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs index d9282015b..5768b7da8 100644 --- a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs +++ b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs @@ -109,15 +109,13 @@ namespace mRemoteNG.UI.Controls { Collapsed += (sender, args) => { - var container = args.Model as ContainerInfo; - if (container == null) return; + if (!(args.Model is ContainerInfo container)) return; container.IsExpanded = false; AutoResizeColumn(Columns[0]); }; Expanded += (sender, args) => { - var container = args.Model as ContainerInfo; - if (container == null) return; + if (!(args.Model is ContainerInfo container)) return; container.IsExpanded = true; AutoResizeColumn(Columns[0]); }; @@ -204,8 +202,7 @@ namespace mRemoteNG.UI.Controls return; } - var senderAsConnectionInfo = sender as ConnectionInfo; - if (senderAsConnectionInfo == null) + if (!(sender is ConnectionInfo senderAsConnectionInfo)) return; RefreshObject(senderAsConnectionInfo); @@ -310,11 +307,9 @@ namespace mRemoteNG.UI.Controls public void RenameSelectedNode() { - if (SelectedItem != null) - { - _allowEdit = true; - SelectedItem.BeginEdit(); - } + if (SelectedItem == null) return; + _allowEdit = true; + SelectedItem.BeginEdit(); } public void DeleteSelectedNode() @@ -336,8 +331,7 @@ namespace mRemoteNG.UI.Controls Runtime.ConnectionsService.BeginBatchingSaves(); - var sortTargetAsContainer = sortTarget as ContainerInfo; - if (sortTargetAsContainer != null) + if (sortTarget is ContainerInfo sortTargetAsContainer) sortTargetAsContainer.SortRecursive(sortDirection); else SelectedNode.Parent.SortRecursive(sortDirection); @@ -390,12 +384,10 @@ namespace mRemoteNG.UI.Controls AutoResizeColumn(Columns[0]); // turn filtering back on - if (filteringEnabled) - { - ModelFilter = filter; - UpdateFiltering(); - } - } + if (!filteringEnabled) return; + ModelFilter = filter; + UpdateFiltering(); + } protected override void UpdateFiltering() { @@ -418,20 +410,20 @@ namespace mRemoteNG.UI.Controls private void OnMouse_DoubleClick(object sender, MouseEventArgs mouseEventArgs) { if (mouseEventArgs.Clicks < 2) return; + // ReSharper disable once NotAccessedVariable OLVColumn column; var listItem = GetItemAt(mouseEventArgs.X, mouseEventArgs.Y, out column); - var clickedNode = listItem?.RowObject as ConnectionInfo; - if (clickedNode == null) return; + if (!(listItem?.RowObject is ConnectionInfo clickedNode)) return; DoubleClickHandler.Execute(clickedNode); } private void OnMouse_SingleClick(object sender, MouseEventArgs mouseEventArgs) { if (mouseEventArgs.Clicks > 1) return; + // ReSharper disable once NotAccessedVariable OLVColumn column; var listItem = GetItemAt(mouseEventArgs.X, mouseEventArgs.Y, out column); - var clickedNode = listItem?.RowObject as ConnectionInfo; - if (clickedNode == null) return; + if (!(listItem?.RowObject is ConnectionInfo clickedNode)) return; SingleClickHandler.Execute(clickedNode); } diff --git a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.resx b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTreeSearchTextFilter.cs b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTreeSearchTextFilter.cs index 82e388584..425c329db 100644 --- a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTreeSearchTextFilter.cs +++ b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTreeSearchTextFilter.cs @@ -17,8 +17,7 @@ namespace mRemoteNG.UI.Controls public bool Filter(object modelObject) { - var objectAsConnectionInfo = modelObject as ConnectionInfo; - if (objectAsConnectionInfo == null) + if (!(modelObject is ConnectionInfo objectAsConnectionInfo)) return false; if (SpecialInclusionList.Contains(objectAsConnectionInfo)) @@ -26,12 +25,9 @@ namespace mRemoteNG.UI.Controls var filterTextLower = FilterText.ToLowerInvariant(); - if (objectAsConnectionInfo.Name.ToLowerInvariant().Contains(filterTextLower) || - objectAsConnectionInfo.Hostname.ToLowerInvariant().Contains(filterTextLower) || - objectAsConnectionInfo.Description.ToLowerInvariant().Contains(filterTextLower)) - return true; - - return false; + return objectAsConnectionInfo.Name.ToLowerInvariant().Contains(filterTextLower) || + objectAsConnectionInfo.Hostname.ToLowerInvariant().Contains(filterTextLower) || + objectAsConnectionInfo.Description.ToLowerInvariant().Contains(filterTextLower); } } } diff --git a/mRemoteV1/UI/Controls/CredentialRecordComboBox.Designer.cs b/mRemoteV1/UI/Controls/CredentialRecordComboBox.Designer.cs index 2c9dbf369..3877645d5 100644 --- a/mRemoteV1/UI/Controls/CredentialRecordComboBox.Designer.cs +++ b/mRemoteV1/UI/Controls/CredentialRecordComboBox.Designer.cs @@ -28,7 +28,13 @@ /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // CredentialRecordComboBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Controls/CredentialRecordComboBox.resx b/mRemoteV1/UI/Controls/CredentialRecordComboBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/CredentialRecordComboBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/CredentialRecordListBox.Designer.cs b/mRemoteV1/UI/Controls/CredentialRecordListBox.Designer.cs index 445bad9f4..645745053 100644 --- a/mRemoteV1/UI/Controls/CredentialRecordListBox.Designer.cs +++ b/mRemoteV1/UI/Controls/CredentialRecordListBox.Designer.cs @@ -28,7 +28,13 @@ /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // CredentialRecordListBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Controls/CredentialRecordListBox.resx b/mRemoteV1/UI/Controls/CredentialRecordListBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/CredentialRecordListBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/CredentialRecordListView.Designer.cs b/mRemoteV1/UI/Controls/CredentialRecordListView.Designer.cs index 44e7d7857..cc002ab45 100644 --- a/mRemoteV1/UI/Controls/CredentialRecordListView.Designer.cs +++ b/mRemoteV1/UI/Controls/CredentialRecordListView.Designer.cs @@ -28,13 +28,13 @@ /// private void InitializeComponent() { - this.objectListView1 = new Base.NGListView(); - this.olvColumnCredentialId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.objectListView1 = new mRemoteNG.UI.Controls.Base.NGListView(); this.olvColumnTitle = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnUsername = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnDomain = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); - this.olvColumnRepositorySource = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.olvColumnCredentialId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnRepositoryTitle = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.olvColumnRepositorySource = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); ((System.ComponentModel.ISupportInitialize)(this.objectListView1)).BeginInit(); this.SuspendLayout(); // @@ -55,6 +55,7 @@ this.objectListView1.CopySelectionOnControlC = false; this.objectListView1.CopySelectionOnControlCUsesDragSource = false; this.objectListView1.Cursor = System.Windows.Forms.Cursors.Default; + this.objectListView1.DecorateLines = true; this.objectListView1.Dock = System.Windows.Forms.DockStyle.Fill; this.objectListView1.FullRowSelect = true; this.objectListView1.HideSelection = false; @@ -68,14 +69,6 @@ this.objectListView1.UseNotifyPropertyChanged = true; this.objectListView1.View = System.Windows.Forms.View.Details; // - // olvColumnCredentialId - // - this.olvColumnCredentialId.AspectName = ""; - this.olvColumnCredentialId.DisplayIndex = 0; - this.olvColumnCredentialId.IsEditable = false; - this.olvColumnCredentialId.IsVisible = false; - this.olvColumnCredentialId.Text = "Credential ID"; - // // olvColumnTitle // this.olvColumnTitle.AspectName = ""; @@ -92,21 +85,30 @@ this.olvColumnDomain.AspectName = ""; this.olvColumnDomain.Text = "Domain"; // + // olvColumnCredentialId + // + this.olvColumnCredentialId.AspectName = ""; + this.olvColumnCredentialId.DisplayIndex = 0; + this.olvColumnCredentialId.IsEditable = false; + this.olvColumnCredentialId.IsVisible = false; + this.olvColumnCredentialId.Text = "Credential ID"; + // + // olvColumnRepositoryTitle + // + this.olvColumnRepositoryTitle.Text = "Repository Title"; + // // olvColumnRepositorySource // this.olvColumnRepositorySource.DisplayIndex = 4; this.olvColumnRepositorySource.IsVisible = false; this.olvColumnRepositorySource.Text = "Source"; // - // olvColumnRepositoryTitle - // - this.olvColumnRepositoryTitle.Text = "Repository Title"; - // // CredentialRecordListView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.objectListView1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "CredentialRecordListView"; this.Size = new System.Drawing.Size(367, 204); ((System.ComponentModel.ISupportInitialize)(this.objectListView1)).EndInit(); diff --git a/mRemoteV1/UI/Controls/CredentialRepositoryListView.Designer.cs b/mRemoteV1/UI/Controls/CredentialRepositoryListView.Designer.cs index 175993320..5195dfdbf 100644 --- a/mRemoteV1/UI/Controls/CredentialRepositoryListView.Designer.cs +++ b/mRemoteV1/UI/Controls/CredentialRepositoryListView.Designer.cs @@ -15,12 +15,12 @@ /// private void InitializeComponent() { - this.objectListView1 = new Base.NGListView(); + this.objectListView1 = new mRemoteNG.UI.Controls.Base.NGListView(); this.olvColumnTitle = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnProvider = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnIsLoaded = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); - this.olvColumnId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnSource = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.olvColumnId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); ((System.ComponentModel.ISupportInitialize)(this.objectListView1)).BeginInit(); this.SuspendLayout(); // @@ -41,6 +41,7 @@ this.objectListView1.CopySelectionOnControlC = false; this.objectListView1.CopySelectionOnControlCUsesDragSource = false; this.objectListView1.Cursor = System.Windows.Forms.Cursors.Default; + this.objectListView1.DecorateLines = true; this.objectListView1.Dock = System.Windows.Forms.DockStyle.Fill; this.objectListView1.FullRowSelect = true; this.objectListView1.HideSelection = false; @@ -73,10 +74,6 @@ this.olvColumnIsLoaded.IsEditable = false; this.olvColumnIsLoaded.Text = "Loaded"; // - // olvColumnId - // - this.olvColumnId.Text = "ID"; - // // olvColumnSource // this.olvColumnSource.AspectName = ""; @@ -84,11 +81,16 @@ this.olvColumnSource.Groupable = false; this.olvColumnSource.Text = "Source"; // + // olvColumnId + // + this.olvColumnId.Text = "ID"; + // // CredentialRepositoryListView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.objectListView1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "CredentialRepositoryListView"; this.Size = new System.Drawing.Size(308, 171); ((System.ComponentModel.ISupportInitialize)(this.objectListView1)).EndInit(); diff --git a/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.cs b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.cs index 127654ba5..57c745386 100644 --- a/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.cs +++ b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.cs @@ -50,8 +50,8 @@ namespace mRemoteNG.UI.Controls.FilteredPropertyGrid public IEnumerable VisibleProperties => _propertyDescriptors.Select(p => p.Name); public new AttributeCollection BrowsableAttributes { - get { return _browsableAttributes; } - set { + get => _browsableAttributes; + set { if (_browsableAttributes == value) return; _hiddenAttributes = null; _browsableAttributes = value; @@ -63,8 +63,8 @@ namespace mRemoteNG.UI.Controls.FilteredPropertyGrid /// Get or set the categories to hide. /// public AttributeCollection HiddenAttributes { - get { return _hiddenAttributes; } - set { + get => _hiddenAttributes; + set { if (value == _hiddenAttributes) return; _hiddenAttributes = value; _browsableAttributes = null; @@ -77,8 +77,8 @@ namespace mRemoteNG.UI.Controls.FilteredPropertyGrid /// /// if one or several properties don't exist. public string[] BrowsableProperties { - get { return _mBrowsableProperties; } - set { + get => _mBrowsableProperties; + set { if (value == _mBrowsableProperties) return; _mBrowsableProperties = value; RefreshProperties(); @@ -87,8 +87,8 @@ namespace mRemoteNG.UI.Controls.FilteredPropertyGrid /// Get or set the properties to hide. public string[] HiddenProperties { - get { return _mHiddenProperties; } - set { + get => _mHiddenProperties; + set { if (value == _mHiddenProperties) return; _mHiddenProperties = value; RefreshProperties(); @@ -100,13 +100,11 @@ namespace mRemoteNG.UI.Controls.FilteredPropertyGrid /// /// The object passed to the base PropertyGrid is the wrapper. public new object SelectedObject { - get - { - return _mWrapper != null - ? ((ObjectWrapper)base.SelectedObject).SelectedObject - : null; - } - set { + get => + _mWrapper != null + ? ((ObjectWrapper)base.SelectedObject).SelectedObject + : null; + set { // Set the new object to the wrapper and create one if necessary. if(_mWrapper == null) { diff --git a/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.designer.cs b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.designer.cs index 586b88139..1113c99d9 100644 --- a/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.designer.cs +++ b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.designer.cs @@ -25,8 +25,13 @@ /// the contents of this method with the code editor. /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.SuspendLayout(); + // + // FilteredPropertyGrid + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.resx b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/FilteredPropertyGrid/FilteredPropertyGrid.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/HeadlessTabControl.cs b/mRemoteV1/UI/Controls/HeadlessTabControl.cs index dd960bec0..d9c821bae 100644 --- a/mRemoteV1/UI/Controls/HeadlessTabControl.cs +++ b/mRemoteV1/UI/Controls/HeadlessTabControl.cs @@ -14,5 +14,16 @@ namespace mRemoteNG.UI.Controls else base.WndProc(ref m); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // HeadlessTabControl + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } } } \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/HeadlessTabControl.resx b/mRemoteV1/UI/Controls/HeadlessTabControl.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/HeadlessTabControl.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/IPTextBox.cs b/mRemoteV1/UI/Controls/IPTextBox.cs index 7dad5a666..7fb4063bd 100644 --- a/mRemoteV1/UI/Controls/IPTextBox.cs +++ b/mRemoteV1/UI/Controls/IPTextBox.cs @@ -101,126 +101,127 @@ namespace mRemoteNG.UI.Controls /// the contents of this method with the code editor. private void InitializeComponent() { - components = new System.ComponentModel.Container(); - panel1 = new Panel(); - label3 = new Base.NGLabel(); - label2 = new Base.NGLabel(); - Octet4 = new Base.NGTextBox(); - Octet3 = new Base.NGTextBox(); - Octet2 = new Base.NGTextBox(); - label1 = new Base.NGLabel(); - Octet1 = new Base.NGTextBox(); - toolTip1 = new System.Windows.Forms.ToolTip(components); - panel1.SuspendLayout(); - SuspendLayout(); + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.Octet4 = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.Octet3 = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.Octet2 = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.Octet1 = new mRemoteNG.UI.Controls.Base.NGTextBox(); + this.label2 = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.label1 = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.label3 = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.panel1.SuspendLayout(); + this.SuspendLayout(); // // panel1 // - panel1.BackColor = System.Drawing.SystemColors.Window; - panel1.Controls.Add(Octet4); - panel1.Controls.Add(Octet3); - panel1.Controls.Add(Octet2); - panel1.Controls.Add(Octet1); - panel1.Controls.Add(label2); - panel1.Controls.Add(label1); - panel1.Controls.Add(label3); - panel1.Font = new System.Drawing.Font("Segoe UI", 9F); - panel1.Location = new System.Drawing.Point(0, 0); - panel1.Name = "panel1"; - panel1.Size = new System.Drawing.Size(124, 18); - panel1.TabIndex = 0; - // - // label3 - // - label3.Location = new System.Drawing.Point(23, 1); - label3.Name = "label3"; - label3.Size = new System.Drawing.Size(8, 13); - label3.TabIndex = 6; - label3.Text = "."; - // - // label2 - // - label2.Location = new System.Drawing.Point(86, 2); - label2.Name = "label2"; - label2.Size = new System.Drawing.Size(8, 13); - label2.TabIndex = 5; - label2.Text = "."; + this.panel1.BackColor = System.Drawing.SystemColors.Window; + this.panel1.Controls.Add(this.Octet4); + this.panel1.Controls.Add(this.Octet3); + this.panel1.Controls.Add(this.Octet2); + this.panel1.Controls.Add(this.Octet1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.label3); + this.panel1.Font = new System.Drawing.Font("Segoe UI", 9F); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(124, 18); + this.panel1.TabIndex = 0; // // Octet4 // - Octet4.BackColor = System.Drawing.SystemColors.Menu; - Octet4.BorderStyle = System.Windows.Forms.BorderStyle.None; - Octet4.Font = new System.Drawing.Font("Segoe UI", 9F); - Octet4.Location = new System.Drawing.Point(95, 1); - Octet4.MaxLength = 3; - Octet4.Name = "Octet4"; - Octet4.Size = new System.Drawing.Size(24, 16); - Octet4.TabIndex = 4; - Octet4.TabStop = false; - Octet4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - Octet4.Enter += new System.EventHandler(Box_Enter); - Octet4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box4_KeyPress); + this.Octet4.BackColor = System.Drawing.SystemColors.Menu; + this.Octet4.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.Octet4.Font = new System.Drawing.Font("Segoe UI", 9F); + this.Octet4.Location = new System.Drawing.Point(95, 1); + this.Octet4.MaxLength = 3; + this.Octet4.Name = "Octet4"; + this.Octet4.Size = new System.Drawing.Size(24, 16); + this.Octet4.TabIndex = 4; + this.Octet4.TabStop = false; + this.Octet4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.Octet4.Enter += new System.EventHandler(this.Box_Enter); + this.Octet4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box4_KeyPress); // // Octet3 // - Octet3.BackColor = System.Drawing.SystemColors.Menu; - Octet3.BorderStyle = System.Windows.Forms.BorderStyle.None; - Octet3.Font = new System.Drawing.Font("Segoe UI", 9F); - Octet3.Location = new System.Drawing.Point(63, 1); - Octet3.MaxLength = 3; - Octet3.Name = "Octet3"; - Octet3.Size = new System.Drawing.Size(24, 16); - Octet3.TabIndex = 3; - Octet3.TabStop = false; - Octet3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - Octet3.Enter += new System.EventHandler(Box_Enter); - Octet3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box3_KeyPress); + this.Octet3.BackColor = System.Drawing.SystemColors.Menu; + this.Octet3.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.Octet3.Font = new System.Drawing.Font("Segoe UI", 9F); + this.Octet3.Location = new System.Drawing.Point(63, 1); + this.Octet3.MaxLength = 3; + this.Octet3.Name = "Octet3"; + this.Octet3.Size = new System.Drawing.Size(24, 16); + this.Octet3.TabIndex = 3; + this.Octet3.TabStop = false; + this.Octet3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.Octet3.Enter += new System.EventHandler(this.Box_Enter); + this.Octet3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box3_KeyPress); // // Octet2 // - Octet2.BackColor = System.Drawing.SystemColors.Menu; - Octet2.BorderStyle = System.Windows.Forms.BorderStyle.None; - Octet2.Font = new System.Drawing.Font("Segoe UI", 9F); - Octet2.Location = new System.Drawing.Point(32, 1); - Octet2.MaxLength = 3; - Octet2.Name = "Octet2"; - Octet2.Size = new System.Drawing.Size(24, 16); - Octet2.TabIndex = 2; - Octet2.TabStop = false; - Octet2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - Octet2.Enter += new System.EventHandler(Box_Enter); - Octet2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box2_KeyPress); - // - // label1 - // - label1.Location = new System.Drawing.Point(55, 2); - label1.Name = "label1"; - label1.Size = new System.Drawing.Size(8, 13); - label1.TabIndex = 1; - label1.Text = "."; + this.Octet2.BackColor = System.Drawing.SystemColors.Menu; + this.Octet2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.Octet2.Font = new System.Drawing.Font("Segoe UI", 9F); + this.Octet2.Location = new System.Drawing.Point(32, 1); + this.Octet2.MaxLength = 3; + this.Octet2.Name = "Octet2"; + this.Octet2.Size = new System.Drawing.Size(24, 16); + this.Octet2.TabIndex = 2; + this.Octet2.TabStop = false; + this.Octet2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.Octet2.Enter += new System.EventHandler(this.Box_Enter); + this.Octet2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box2_KeyPress); // // Octet1 // - Octet1.BackColor = System.Drawing.SystemColors.Menu; - Octet1.BorderStyle = System.Windows.Forms.BorderStyle.None; - Octet1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - Octet1.Location = new System.Drawing.Point(1, 1); - Octet1.MaxLength = 3; - Octet1.Name = "Octet1"; - Octet1.Size = new System.Drawing.Size(24, 16); - Octet1.TabIndex = 1; - Octet1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - Octet1.Enter += new System.EventHandler(Box_Enter); - Octet1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box1_KeyPress); + this.Octet1.BackColor = System.Drawing.SystemColors.Menu; + this.Octet1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.Octet1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Octet1.Location = new System.Drawing.Point(1, 1); + this.Octet1.MaxLength = 3; + this.Octet1.Name = "Octet1"; + this.Octet1.Size = new System.Drawing.Size(24, 16); + this.Octet1.TabIndex = 1; + this.Octet1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.Octet1.Enter += new System.EventHandler(this.Box_Enter); + this.Octet1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box1_KeyPress); + // + // label2 + // + this.label2.Location = new System.Drawing.Point(86, 2); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(8, 13); + this.label2.TabIndex = 5; + this.label2.Text = "."; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(55, 2); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(8, 13); + this.label1.TabIndex = 1; + this.label1.Text = "."; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(23, 1); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(8, 13); + this.label3.TabIndex = 6; + this.label3.Text = "."; // // IPTextBox // - Controls.Add(panel1); - Name = "IPTextBox"; - Size = new System.Drawing.Size(124, 18); - panel1.ResumeLayout(false); - panel1.PerformLayout(); - ResumeLayout(false); + this.Controls.Add(this.panel1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "IPTextBox"; + this.Size = new System.Drawing.Size(124, 18); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); } #endregion diff --git a/mRemoteV1/UI/Controls/MultiSshToolStrip.cs b/mRemoteV1/UI/Controls/MultiSshToolStrip.cs index 2e0de653c..4771d1e42 100644 --- a/mRemoteV1/UI/Controls/MultiSshToolStrip.cs +++ b/mRemoteV1/UI/Controls/MultiSshToolStrip.cs @@ -10,14 +10,13 @@ namespace mRemoteNG.UI.Controls private IContainer components; private ToolStripLabel _lblMultiSsh; private ToolStripTextBox _txtMultiSsh; - private MultiSSHController _multiSshController; - private readonly DisplayProperties _display; - private ThemeManager _themeManager; + // ReSharper disable once NotAccessedField.Local + private MultiSSHController _multiSshController; + private readonly ThemeManager _themeManager; public MultiSshToolStrip() { - _display = new DisplayProperties(); InitializeComponent(); _themeManager = ThemeManager.getInstance(); _themeManager.ThemeChanged += ApplyTheme; @@ -41,7 +40,7 @@ namespace mRemoteNG.UI.Controls // txtMultiSSH // _txtMultiSsh.Name = "_txtMultiSsh"; - _txtMultiSsh.Size = new System.Drawing.Size(_display.ScaleWidth(300), 25); + _txtMultiSsh.Size = new System.Drawing.Size(new DisplayProperties().ScaleWidth(300), 25); _txtMultiSsh.ToolTipText = "Press ENTER to send. Ctrl+C is sent immediately."; Items.AddRange(new ToolStripItem[] { diff --git a/mRemoteV1/UI/Controls/NewPasswordWithVerification.Designer.cs b/mRemoteV1/UI/Controls/NewPasswordWithVerification.Designer.cs index d79bf9ef5..fcf158b40 100644 --- a/mRemoteV1/UI/Controls/NewPasswordWithVerification.Designer.cs +++ b/mRemoteV1/UI/Controls/NewPasswordWithVerification.Designer.cs @@ -28,15 +28,43 @@ /// private void InitializeComponent() { - this.imgError = new System.Windows.Forms.PictureBox(); - this.labelPasswordsDontMatch = new mRemoteNG.UI.Controls.Base.NGLabel(); - this.labelSecondPasswordBox = new mRemoteNG.UI.Controls.Base.NGLabel(); this.labelFirstPasswordBox = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.labelSecondPasswordBox = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.labelPasswordsDontMatch = new mRemoteNG.UI.Controls.Base.NGLabel(); + this.imgError = new System.Windows.Forms.PictureBox(); this.secureTextBox2 = new mRemoteNG.UI.Controls.SecureTextBox(); this.secureTextBox1 = new mRemoteNG.UI.Controls.SecureTextBox(); ((System.ComponentModel.ISupportInitialize)(this.imgError)).BeginInit(); this.SuspendLayout(); // + // labelFirstPasswordBox + // + this.labelFirstPasswordBox.AutoSize = true; + this.labelFirstPasswordBox.Location = new System.Drawing.Point(-3, 0); + this.labelFirstPasswordBox.Name = "labelFirstPasswordBox"; + this.labelFirstPasswordBox.Size = new System.Drawing.Size(82, 13); + this.labelFirstPasswordBox.TabIndex = 2; + this.labelFirstPasswordBox.Text = "New Password"; + // + // labelSecondPasswordBox + // + this.labelSecondPasswordBox.AutoSize = true; + this.labelSecondPasswordBox.Location = new System.Drawing.Point(-3, 42); + this.labelSecondPasswordBox.Name = "labelSecondPasswordBox"; + this.labelSecondPasswordBox.Size = new System.Drawing.Size(84, 13); + this.labelSecondPasswordBox.TabIndex = 3; + this.labelSecondPasswordBox.Text = "VerifyPassword"; + // + // labelPasswordsDontMatch + // + this.labelPasswordsDontMatch.AutoSize = true; + this.labelPasswordsDontMatch.Location = new System.Drawing.Point(23, 83); + this.labelPasswordsDontMatch.Name = "labelPasswordsDontMatch"; + this.labelPasswordsDontMatch.Size = new System.Drawing.Size(133, 13); + this.labelPasswordsDontMatch.TabIndex = 4; + this.labelPasswordsDontMatch.Text = "Passwords do not match"; + this.labelPasswordsDontMatch.Visible = false; + // // imgError // this.imgError.Image = global::mRemoteNG.Resources.ErrorSmall; @@ -47,41 +75,13 @@ this.imgError.TabStop = false; this.imgError.Visible = false; // - // labelPasswordsDontMatch - // - this.labelPasswordsDontMatch.AutoSize = true; - this.labelPasswordsDontMatch.Location = new System.Drawing.Point(23, 83); - this.labelPasswordsDontMatch.Name = "labelPasswordsDontMatch"; - this.labelPasswordsDontMatch.Size = new System.Drawing.Size(123, 13); - this.labelPasswordsDontMatch.TabIndex = 4; - this.labelPasswordsDontMatch.Text = "Passwords do not match"; - this.labelPasswordsDontMatch.Visible = false; - // - // labelSecondPasswordBox - // - this.labelSecondPasswordBox.AutoSize = true; - this.labelSecondPasswordBox.Location = new System.Drawing.Point(-3, 42); - this.labelSecondPasswordBox.Name = "labelSecondPasswordBox"; - this.labelSecondPasswordBox.Size = new System.Drawing.Size(79, 13); - this.labelSecondPasswordBox.TabIndex = 3; - this.labelSecondPasswordBox.Text = "VerifyPassword"; - // - // labelFirstPasswordBox - // - this.labelFirstPasswordBox.AutoSize = true; - this.labelFirstPasswordBox.Location = new System.Drawing.Point(-3, 0); - this.labelFirstPasswordBox.Name = "labelFirstPasswordBox"; - this.labelFirstPasswordBox.Size = new System.Drawing.Size(78, 13); - this.labelFirstPasswordBox.TabIndex = 2; - this.labelFirstPasswordBox.Text = "New Password"; - // // secureTextBox2 // this.secureTextBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.secureTextBox2.Location = new System.Drawing.Point(0, 58); this.secureTextBox2.Name = "secureTextBox2"; - this.secureTextBox2.Size = new System.Drawing.Size(193, 20); + this.secureTextBox2.Size = new System.Drawing.Size(193, 22); this.secureTextBox2.TabIndex = 1; // // secureTextBox1 @@ -90,20 +90,20 @@ | System.Windows.Forms.AnchorStyles.Right))); this.secureTextBox1.Location = new System.Drawing.Point(0, 16); this.secureTextBox1.Name = "secureTextBox1"; - this.secureTextBox1.Size = new System.Drawing.Size(193, 20); + this.secureTextBox1.Size = new System.Drawing.Size(193, 22); this.secureTextBox1.TabIndex = 0; // // NewPasswordWithVerification // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.BackColor = System.Drawing.Color.Transparent; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.imgError); this.Controls.Add(this.labelPasswordsDontMatch); this.Controls.Add(this.labelSecondPasswordBox); this.Controls.Add(this.labelFirstPasswordBox); this.Controls.Add(this.secureTextBox2); this.Controls.Add(this.secureTextBox1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.MinimumSize = new System.Drawing.Size(0, 100); this.Name = "NewPasswordWithVerification"; this.Size = new System.Drawing.Size(193, 100); diff --git a/mRemoteV1/UI/Controls/PageSequence/PageSequence.cs b/mRemoteV1/UI/Controls/PageSequence/PageSequence.cs index dca897c0f..2384518ec 100644 --- a/mRemoteV1/UI/Controls/PageSequence/PageSequence.cs +++ b/mRemoteV1/UI/Controls/PageSequence/PageSequence.cs @@ -19,12 +19,10 @@ namespace mRemoteNG.UI.Controls.PageSequence public PageSequence(Control pageContainer, params SequencedControl[] pages) { - if (pageContainer == null) - throw new ArgumentNullException(nameof(pageContainer)); if (pages == null) throw new ArgumentNullException(nameof(pages)); - _pageContainer = pageContainer; + _pageContainer = pageContainer ?? throw new ArgumentNullException(nameof(pageContainer)); foreach (var page in pages) { SubscribeToPageEvents(page); diff --git a/mRemoteV1/UI/Controls/PageSequence/SequencedControl.cs b/mRemoteV1/UI/Controls/PageSequence/SequencedControl.cs index 8a9111d0e..f503f997d 100644 --- a/mRemoteV1/UI/Controls/PageSequence/SequencedControl.cs +++ b/mRemoteV1/UI/Controls/PageSequence/SequencedControl.cs @@ -12,6 +12,7 @@ namespace mRemoteNG.UI.Controls.PageSequence public SequencedControl() { Themes.ThemeManager.getInstance().ThemeChanged += ApplyTheme; + InitializeComponent(); } protected virtual void RaiseNextPageEvent() @@ -35,5 +36,17 @@ namespace mRemoteNG.UI.Controls.PageSequence { PageReplacementRequested?.Invoke(this, new SequencedPageReplcementRequestArgs(control, pagetoReplace)); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // SequencedControl + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "SequencedControl"; + this.ResumeLayout(false); + + } } } \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/PageSequence/SequencedControl.resx b/mRemoteV1/UI/Controls/PageSequence/SequencedControl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Controls/PageSequence/SequencedControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/PageSequence/SequencedPageReplcementRequestArgs.cs b/mRemoteV1/UI/Controls/PageSequence/SequencedPageReplcementRequestArgs.cs index 5c5d4327f..4cd851089 100644 --- a/mRemoteV1/UI/Controls/PageSequence/SequencedPageReplcementRequestArgs.cs +++ b/mRemoteV1/UI/Controls/PageSequence/SequencedPageReplcementRequestArgs.cs @@ -18,9 +18,7 @@ namespace mRemoteNG.UI.Controls.PageSequence public SequencedPageReplcementRequestArgs(SequencedControl newControl, RelativePagePosition pageToReplace) { - if (newControl == null) - throw new ArgumentNullException(nameof(newControl)); - NewControl = newControl; + NewControl = newControl ?? throw new ArgumentNullException(nameof(newControl)); PagePosition = pageToReplace; } } diff --git a/mRemoteV1/UI/Controls/SecureTextBox.Designer.cs b/mRemoteV1/UI/Controls/SecureTextBox.Designer.cs index c0e72fce8..5e7f73fa2 100644 --- a/mRemoteV1/UI/Controls/SecureTextBox.Designer.cs +++ b/mRemoteV1/UI/Controls/SecureTextBox.Designer.cs @@ -36,7 +36,13 @@ /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // SecureTextBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Controls/SecureTextBox.resx b/mRemoteV1/UI/Controls/SecureTextBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Controls/SecureTextBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/ExportForm.Designer.cs b/mRemoteV1/UI/Forms/ExportForm.Designer.cs index 026534c8a..d70ac834e 100644 --- a/mRemoteV1/UI/Forms/ExportForm.Designer.cs +++ b/mRemoteV1/UI/Forms/ExportForm.Designer.cs @@ -63,7 +63,7 @@ namespace mRemoteNG.UI.Forms this.lblUncheckProperties.AutoSize = true; this.lblUncheckProperties.Location = new System.Drawing.Point(12, 134); this.lblUncheckProperties.Name = "lblUncheckProperties"; - this.lblUncheckProperties.Size = new System.Drawing.Size(244, 13); + this.lblUncheckProperties.Size = new System.Drawing.Size(264, 13); this.lblUncheckProperties.TabIndex = 4; this.lblUncheckProperties.Text = "Uncheck the properties you want not to be saved!"; // @@ -75,7 +75,7 @@ namespace mRemoteNG.UI.Forms this.chkUsername.CheckState = System.Windows.Forms.CheckState.Checked; this.chkUsername.Location = new System.Drawing.Point(15, 32); this.chkUsername.Name = "chkUsername"; - this.chkUsername.Size = new System.Drawing.Size(74, 17); + this.chkUsername.Size = new System.Drawing.Size(77, 17); this.chkUsername.TabIndex = 0; this.chkUsername.Text = "Username"; this.chkUsername.UseVisualStyleBackColor = true; @@ -88,7 +88,7 @@ namespace mRemoteNG.UI.Forms this.chkPassword.CheckState = System.Windows.Forms.CheckState.Checked; this.chkPassword.Location = new System.Drawing.Point(15, 55); this.chkPassword.Name = "chkPassword"; - this.chkPassword.Size = new System.Drawing.Size(72, 17); + this.chkPassword.Size = new System.Drawing.Size(75, 17); this.chkPassword.TabIndex = 1; this.chkPassword.Text = "Password"; this.chkPassword.UseVisualStyleBackColor = true; @@ -101,7 +101,7 @@ namespace mRemoteNG.UI.Forms this.chkDomain.CheckState = System.Windows.Forms.CheckState.Checked; this.chkDomain.Location = new System.Drawing.Point(15, 78); this.chkDomain.Name = "chkDomain"; - this.chkDomain.Size = new System.Drawing.Size(62, 17); + this.chkDomain.Size = new System.Drawing.Size(66, 17); this.chkDomain.TabIndex = 2; this.chkDomain.Text = "Domain"; this.chkDomain.UseVisualStyleBackColor = true; @@ -114,7 +114,7 @@ namespace mRemoteNG.UI.Forms this.chkInheritance.CheckState = System.Windows.Forms.CheckState.Checked; this.chkInheritance.Location = new System.Drawing.Point(15, 101); this.chkInheritance.Name = "chkInheritance"; - this.chkInheritance.Size = new System.Drawing.Size(79, 17); + this.chkInheritance.Size = new System.Drawing.Size(84, 17); this.chkInheritance.TabIndex = 3; this.chkInheritance.Text = "Inheritance"; this.chkInheritance.UseVisualStyleBackColor = true; @@ -124,7 +124,7 @@ namespace mRemoteNG.UI.Forms this.txtFileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtFileName.Location = new System.Drawing.Point(15, 47); this.txtFileName.Name = "txtFileName"; - this.txtFileName.Size = new System.Drawing.Size(396, 20); + this.txtFileName.Size = new System.Drawing.Size(396, 22); this.txtFileName.TabIndex = 1; this.txtFileName.TextChanged += new System.EventHandler(this.txtFileName_TextChanged); // @@ -162,7 +162,7 @@ namespace mRemoteNG.UI.Forms this.chkAssignedCredential.CheckState = System.Windows.Forms.CheckState.Checked; this.chkAssignedCredential.Location = new System.Drawing.Point(143, 32); this.chkAssignedCredential.Name = "chkAssignedCredential"; - this.chkAssignedCredential.Size = new System.Drawing.Size(119, 17); + this.chkAssignedCredential.Size = new System.Drawing.Size(129, 17); this.chkAssignedCredential.TabIndex = 5; this.chkAssignedCredential.Text = "Assigned Credential"; this.chkAssignedCredential.UseVisualStyleBackColor = true; @@ -187,7 +187,7 @@ namespace mRemoteNG.UI.Forms this.lblFileFormat.AutoSize = true; this.lblFileFormat.Location = new System.Drawing.Point(12, 80); this.lblFileFormat.Name = "lblFileFormat"; - this.lblFileFormat.Size = new System.Drawing.Size(61, 13); + this.lblFileFormat.Size = new System.Drawing.Size(67, 13); this.lblFileFormat.TabIndex = 3; this.lblFileFormat.Text = "File &Format:"; // @@ -196,7 +196,7 @@ namespace mRemoteNG.UI.Forms this.lblFileName.AutoSize = true; this.lblFileName.Location = new System.Drawing.Point(12, 28); this.lblFileName.Name = "lblFileName"; - this.lblFileName.Size = new System.Drawing.Size(52, 13); + this.lblFileName.Size = new System.Drawing.Size(56, 13); this.lblFileName.TabIndex = 0; this.lblFileName.Text = "Filename:"; // @@ -230,7 +230,7 @@ namespace mRemoteNG.UI.Forms this.lblSelectedConnection.AutoSize = true; this.lblSelectedConnection.Location = new System.Drawing.Point(48, 111); this.lblSelectedConnection.Name = "lblSelectedConnection"; - this.lblSelectedConnection.Size = new System.Drawing.Size(92, 13); + this.lblSelectedConnection.Size = new System.Drawing.Size(99, 13); this.lblSelectedConnection.TabIndex = 4; this.lblSelectedConnection.Text = "Connection Name"; // @@ -239,7 +239,7 @@ namespace mRemoteNG.UI.Forms this.lblSelectedFolder.AutoSize = true; this.lblSelectedFolder.Location = new System.Drawing.Point(48, 75); this.lblSelectedFolder.Name = "lblSelectedFolder"; - this.lblSelectedFolder.Size = new System.Drawing.Size(67, 13); + this.lblSelectedFolder.Size = new System.Drawing.Size(72, 13); this.lblSelectedFolder.TabIndex = 3; this.lblSelectedFolder.Text = "Folder Name"; // @@ -249,7 +249,7 @@ namespace mRemoteNG.UI.Forms this.rdoExportSelectedConnection.BackColor = System.Drawing.Color.Transparent; this.rdoExportSelectedConnection.Location = new System.Drawing.Point(15, 91); this.rdoExportSelectedConnection.Name = "rdoExportSelectedConnection"; - this.rdoExportSelectedConnection.Size = new System.Drawing.Size(215, 17); + this.rdoExportSelectedConnection.Size = new System.Drawing.Size(232, 17); this.rdoExportSelectedConnection.TabIndex = 2; this.rdoExportSelectedConnection.TabStop = true; this.rdoExportSelectedConnection.Text = "Export the currently selected connection"; @@ -261,7 +261,7 @@ namespace mRemoteNG.UI.Forms this.rdoExportSelectedFolder.BackColor = System.Drawing.Color.Transparent; this.rdoExportSelectedFolder.Location = new System.Drawing.Point(15, 55); this.rdoExportSelectedFolder.Name = "rdoExportSelectedFolder"; - this.rdoExportSelectedFolder.Size = new System.Drawing.Size(188, 17); + this.rdoExportSelectedFolder.Size = new System.Drawing.Size(205, 17); this.rdoExportSelectedFolder.TabIndex = 1; this.rdoExportSelectedFolder.TabStop = true; this.rdoExportSelectedFolder.Text = "Export the currently selected folder"; @@ -274,7 +274,7 @@ namespace mRemoteNG.UI.Forms this.rdoExportEverything.Checked = true; this.rdoExportEverything.Location = new System.Drawing.Point(15, 32); this.rdoExportEverything.Name = "rdoExportEverything"; - this.rdoExportEverything.Size = new System.Drawing.Size(107, 17); + this.rdoExportEverything.Size = new System.Drawing.Size(115, 17); this.rdoExportEverything.TabIndex = 0; this.rdoExportEverything.TabStop = true; this.rdoExportEverything.Text = "Export everything"; @@ -292,6 +292,7 @@ namespace mRemoteNG.UI.Forms this.Controls.Add(this.grpProperties); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOK); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = global::mRemoteNG.Resources.ConnectionsSaveAs_Icon; this.MaximizeBox = false; diff --git a/mRemoteV1/UI/Forms/ExportForm.cs b/mRemoteV1/UI/Forms/ExportForm.cs index 7daedde4a..d4396d8cf 100644 --- a/mRemoteV1/UI/Forms/ExportForm.cs +++ b/mRemoteV1/UI/Forms/ExportForm.cs @@ -16,15 +16,9 @@ namespace mRemoteNG.UI.Forms #region Public Properties public string FileName { - get - { - return txtFileName.Text; - } - set - { - txtFileName.Text = value; - } - } + get => txtFileName.Text; + set => txtFileName.Text = value; + } public SaveFormat SaveFormat { @@ -75,11 +69,8 @@ namespace mRemoteNG.UI.Forms private ContainerInfo _selectedFolder; public ContainerInfo SelectedFolder { - get - { - return _selectedFolder; - } - set + get => _selectedFolder; + set { _selectedFolder = value; lblSelectedFolder.Text = value?.Name; @@ -90,11 +81,8 @@ namespace mRemoteNG.UI.Forms private ConnectionInfo _selectedConnection; public ConnectionInfo SelectedConnection { - get - { - return _selectedConnection; - } - set + get => _selectedConnection; + set { _selectedConnection = value; lblSelectedConnection.Text = value?.Name; @@ -104,57 +92,33 @@ namespace mRemoteNG.UI.Forms public bool IncludeUsername { - get - { - return chkUsername.Checked; - } - set - { - chkUsername.Checked = value; - } - } + get => chkUsername.Checked; + set => chkUsername.Checked = value; + } public bool IncludePassword { - get - { - return chkPassword.Checked; - } - set - { - chkPassword.Checked = value; - } - } + get => chkPassword.Checked; + set => chkPassword.Checked = value; + } public bool IncludeDomain { - get - { - return chkDomain.Checked; - } - set - { - chkDomain.Checked = value; - } - } + get => chkDomain.Checked; + set => chkDomain.Checked = value; + } public bool IncludeAssignedCredential { - get { return chkAssignedCredential.Checked; } - set { chkAssignedCredential.Checked = value; } + get => chkAssignedCredential.Checked; + set => chkAssignedCredential.Checked = value; } public bool IncludeInheritance { - get - { - return chkInheritance.Checked; - } - set - { - chkInheritance.Checked = value; - } - } + get => chkInheritance.Checked; + set => chkInheritance.Checked = value; + } #endregion #region Constructors @@ -247,11 +211,9 @@ namespace mRemoteNG.UI.Forms private void ApplyTheme() { _themeManager = ThemeManager.getInstance(); - if(_themeManager.ThemingActive) - { - BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Background"); - ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground"); - } + if (!_themeManager.ThemingActive) return; + BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Background"); + ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground"); } diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs index ef265c3c0..53864ab58 100644 --- a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs @@ -39,6 +39,7 @@ this.ClientSize = new System.Drawing.Size(450, 120); this.ControlBox = false; this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; diff --git a/mRemoteV1/UI/Forms/FullscreenHandler.cs b/mRemoteV1/UI/Forms/FullscreenHandler.cs index e85fd1555..b601a8e27 100644 --- a/mRemoteV1/UI/Forms/FullscreenHandler.cs +++ b/mRemoteV1/UI/Forms/FullscreenHandler.cs @@ -13,10 +13,7 @@ namespace mRemoteNG.UI.Forms public bool Value { - get - { - return _value; - } + get => _value; set { if (_value == value) return; diff --git a/mRemoteV1/UI/Forms/Input/FrmInputBox.Designer.cs b/mRemoteV1/UI/Forms/Input/FrmInputBox.Designer.cs index 6e5b7532a..daf744f81 100644 --- a/mRemoteV1/UI/Forms/Input/FrmInputBox.Designer.cs +++ b/mRemoteV1/UI/Forms/Input/FrmInputBox.Designer.cs @@ -87,7 +87,7 @@ this.textBox.Dock = System.Windows.Forms.DockStyle.Fill; this.textBox.Location = new System.Drawing.Point(3, 27); this.textBox.Name = "textBox"; - this.textBox.Size = new System.Drawing.Size(278, 20); + this.textBox.Size = new System.Drawing.Size(278, 22); this.textBox.TabIndex = 2; // // label @@ -110,6 +110,7 @@ this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel1); this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs index 3c365e584..bb837bc3b 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.Designer.cs @@ -53,7 +53,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkAutomaticallyGetSessionInfo.AutoSize = true; this.chkAutomaticallyGetSessionInfo.Location = new System.Drawing.Point(3, 3); this.chkAutomaticallyGetSessionInfo.Name = "chkAutomaticallyGetSessionInfo"; - this.chkAutomaticallyGetSessionInfo.Size = new System.Drawing.Size(198, 17); + this.chkAutomaticallyGetSessionInfo.Size = new System.Drawing.Size(220, 17); this.chkAutomaticallyGetSessionInfo.TabIndex = 0; this.chkAutomaticallyGetSessionInfo.Text = "Automatically get session information"; this.chkAutomaticallyGetSessionInfo.UseVisualStyleBackColor = true; @@ -73,7 +73,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkAutomaticReconnect.AutoSize = true; this.chkAutomaticReconnect.Location = new System.Drawing.Point(3, 26); this.chkAutomaticReconnect.Name = "chkAutomaticReconnect"; - this.chkAutomaticReconnect.Size = new System.Drawing.Size(399, 17); + this.chkAutomaticReconnect.Size = new System.Drawing.Size(430, 17); this.chkAutomaticReconnect.TabIndex = 1; this.chkAutomaticReconnect.Text = "Automatically try to reconnect when disconnected from server (RDP && ICA only)"; this.chkAutomaticReconnect.UseVisualStyleBackColor = true; @@ -88,7 +88,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numPuttyWaitTime.Name = "numPuttyWaitTime"; - this.numPuttyWaitTime.Size = new System.Drawing.Size(49, 20); + this.numPuttyWaitTime.Size = new System.Drawing.Size(49, 22); this.numPuttyWaitTime.TabIndex = 7; this.numPuttyWaitTime.Value = new decimal(new int[] { 5, @@ -127,7 +127,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numUVNCSCPort.Name = "numUVNCSCPort"; - this.numUVNCSCPort.Size = new System.Drawing.Size(72, 20); + this.numUVNCSCPort.Size = new System.Drawing.Size(72, 22); this.numUVNCSCPort.TabIndex = 8; this.numUVNCSCPort.Value = new decimal(new int[] { 5500, @@ -142,7 +142,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtCustomPuttyPath.Enabled = false; this.txtCustomPuttyPath.Location = new System.Drawing.Point(21, 95); this.txtCustomPuttyPath.Name = "txtCustomPuttyPath"; - this.txtCustomPuttyPath.Size = new System.Drawing.Size(346, 20); + this.txtCustomPuttyPath.Size = new System.Drawing.Size(346, 22); this.txtCustomPuttyPath.TabIndex = 4; this.txtCustomPuttyPath.TextChanged += new System.EventHandler(this.txtCustomPuttyPath_TextChanged); // @@ -175,7 +175,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblSeconds.AutoSize = true; this.lblSeconds.Location = new System.Drawing.Point(428, 175); this.lblSeconds.Name = "lblSeconds"; - this.lblSeconds.Size = new System.Drawing.Size(47, 13); + this.lblSeconds.Size = new System.Drawing.Size(49, 13); this.lblSeconds.TabIndex = 9; this.lblSeconds.Text = "seconds"; // @@ -197,7 +197,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLoadBalanceInfoUseUtf8.AutoSize = true; this.chkLoadBalanceInfoUseUtf8.Location = new System.Drawing.Point(3, 49); this.chkLoadBalanceInfoUseUtf8.Name = "chkLoadBalanceInfoUseUtf8"; - this.chkLoadBalanceInfoUseUtf8.Size = new System.Drawing.Size(304, 17); + this.chkLoadBalanceInfoUseUtf8.Size = new System.Drawing.Size(317, 17); this.chkLoadBalanceInfoUseUtf8.TabIndex = 2; this.chkLoadBalanceInfoUseUtf8.Text = "Use UTF8 encoding for RDP \"Load Balance Info\" property"; this.chkLoadBalanceInfoUseUtf8.UseVisualStyleBackColor = true; @@ -219,6 +219,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.lblUVNCSCPort); this.Controls.Add(this.lblSeconds); this.Controls.Add(this.btnBrowseCustomPuttyPath); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "AdvancedPage"; this.Size = new System.Drawing.Size(610, 490); ((System.ComponentModel.ISupportInitialize)(this.numPuttyWaitTime)).EndInit(); diff --git a/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.resx b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/AdvancedPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.Designer.cs index ac519b50d..155bb781b 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.Designer.cs @@ -44,7 +44,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblLanguageRestartRequired.AutoSize = true; this.lblLanguageRestartRequired.Location = new System.Drawing.Point(3, 56); this.lblLanguageRestartRequired.Name = "lblLanguageRestartRequired"; - this.lblLanguageRestartRequired.Size = new System.Drawing.Size(380, 13); + this.lblLanguageRestartRequired.Size = new System.Drawing.Size(414, 13); this.lblLanguageRestartRequired.TabIndex = 2; this.lblLanguageRestartRequired.Text = "mRemoteNG must be restarted before changes to the language will take effect."; // @@ -64,7 +64,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblLanguage.AutoSize = true; this.lblLanguage.Location = new System.Drawing.Point(3, 3); this.lblLanguage.Name = "lblLanguage"; - this.lblLanguage.Size = new System.Drawing.Size(55, 13); + this.lblLanguage.Size = new System.Drawing.Size(58, 13); this.lblLanguage.TabIndex = 0; this.lblLanguage.Text = "Language"; // @@ -74,7 +74,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowFullConnectionsFilePathInTitle.AutoSize = true; this.chkShowFullConnectionsFilePathInTitle.Location = new System.Drawing.Point(3, 127); this.chkShowFullConnectionsFilePathInTitle.Name = "chkShowFullConnectionsFilePathInTitle"; - this.chkShowFullConnectionsFilePathInTitle.Size = new System.Drawing.Size(239, 17); + this.chkShowFullConnectionsFilePathInTitle.Size = new System.Drawing.Size(268, 17); this.chkShowFullConnectionsFilePathInTitle.TabIndex = 4; this.chkShowFullConnectionsFilePathInTitle.Text = "Show full connections file path in window title"; this.chkShowFullConnectionsFilePathInTitle.UseVisualStyleBackColor = true; @@ -85,7 +85,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowDescriptionTooltipsInTree.AutoSize = true; this.chkShowDescriptionTooltipsInTree.Location = new System.Drawing.Point(3, 104); this.chkShowDescriptionTooltipsInTree.Name = "chkShowDescriptionTooltipsInTree"; - this.chkShowDescriptionTooltipsInTree.Size = new System.Drawing.Size(231, 17); + this.chkShowDescriptionTooltipsInTree.Size = new System.Drawing.Size(256, 17); this.chkShowDescriptionTooltipsInTree.TabIndex = 3; this.chkShowDescriptionTooltipsInTree.Text = "Show description tooltips in connection tree"; this.chkShowDescriptionTooltipsInTree.UseVisualStyleBackColor = true; @@ -96,7 +96,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowSystemTrayIcon.AutoSize = true; this.chkShowSystemTrayIcon.Location = new System.Drawing.Point(3, 173); this.chkShowSystemTrayIcon.Name = "chkShowSystemTrayIcon"; - this.chkShowSystemTrayIcon.Size = new System.Drawing.Size(172, 17); + this.chkShowSystemTrayIcon.Size = new System.Drawing.Size(177, 17); this.chkShowSystemTrayIcon.TabIndex = 5; this.chkShowSystemTrayIcon.Text = "Always show System Tray Icon"; this.chkShowSystemTrayIcon.UseVisualStyleBackColor = true; @@ -107,7 +107,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkMinimizeToSystemTray.AutoSize = true; this.chkMinimizeToSystemTray.Location = new System.Drawing.Point(3, 196); this.chkMinimizeToSystemTray.Name = "chkMinimizeToSystemTray"; - this.chkMinimizeToSystemTray.Size = new System.Drawing.Size(139, 17); + this.chkMinimizeToSystemTray.Size = new System.Drawing.Size(146, 17); this.chkMinimizeToSystemTray.TabIndex = 6; this.chkMinimizeToSystemTray.Text = "Minimize to System Tray"; this.chkMinimizeToSystemTray.UseVisualStyleBackColor = true; @@ -123,6 +123,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.chkShowDescriptionTooltipsInTree); this.Controls.Add(this.chkShowSystemTrayIcon); this.Controls.Add(this.chkMinimizeToSystemTray); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "AppearancePage"; this.Size = new System.Drawing.Size(610, 490); this.ResumeLayout(false); diff --git a/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.resx b/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/AppearancePage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.Designer.cs index 8aaed4465..263a249c2 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.Designer.cs @@ -71,7 +71,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numRDPConTimeout.Name = "numRDPConTimeout"; - this.numRDPConTimeout.Size = new System.Drawing.Size(53, 20); + this.numRDPConTimeout.Size = new System.Drawing.Size(53, 22); this.numRDPConTimeout.TabIndex = 1; this.numRDPConTimeout.Value = new decimal(new int[] { 20, @@ -109,7 +109,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numRdpReconnectionCount.Name = "numRdpReconnectionCount"; - this.numRdpReconnectionCount.Size = new System.Drawing.Size(53, 20); + this.numRdpReconnectionCount.Size = new System.Drawing.Size(53, 22); this.numRdpReconnectionCount.TabIndex = 1; this.numRdpReconnectionCount.Value = new decimal(new int[] { 5, @@ -123,7 +123,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSingleClickOnConnectionOpensIt.AutoSize = true; this.chkSingleClickOnConnectionOpensIt.Location = new System.Drawing.Point(3, 3); this.chkSingleClickOnConnectionOpensIt.Name = "chkSingleClickOnConnectionOpensIt"; - this.chkSingleClickOnConnectionOpensIt.Size = new System.Drawing.Size(191, 17); + this.chkSingleClickOnConnectionOpensIt.Size = new System.Drawing.Size(206, 17); this.chkSingleClickOnConnectionOpensIt.TabIndex = 0; this.chkSingleClickOnConnectionOpensIt.Text = "Single click on connection opens it"; this.chkSingleClickOnConnectionOpensIt.UseVisualStyleBackColor = true; @@ -134,7 +134,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkHostnameLikeDisplayName.AutoSize = true; this.chkHostnameLikeDisplayName.Location = new System.Drawing.Point(3, 49); this.chkHostnameLikeDisplayName.Name = "chkHostnameLikeDisplayName"; - this.chkHostnameLikeDisplayName.Size = new System.Drawing.Size(328, 17); + this.chkHostnameLikeDisplayName.Size = new System.Drawing.Size(355, 17); this.chkHostnameLikeDisplayName.TabIndex = 2; this.chkHostnameLikeDisplayName.Text = "Set hostname like display name when creating new connections"; this.chkHostnameLikeDisplayName.UseVisualStyleBackColor = true; @@ -145,7 +145,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSingleClickOnOpenedConnectionSwitchesToIt.AutoSize = true; this.chkSingleClickOnOpenedConnectionSwitchesToIt.Location = new System.Drawing.Point(3, 26); this.chkSingleClickOnOpenedConnectionSwitchesToIt.Name = "chkSingleClickOnOpenedConnectionSwitchesToIt"; - this.chkSingleClickOnOpenedConnectionSwitchesToIt.Size = new System.Drawing.Size(457, 17); + this.chkSingleClickOnOpenedConnectionSwitchesToIt.Size = new System.Drawing.Size(490, 17); this.chkSingleClickOnOpenedConnectionSwitchesToIt.TabIndex = 1; this.chkSingleClickOnOpenedConnectionSwitchesToIt.Text = global::mRemoteNG.Language.strSingleClickOnOpenConnectionSwitchesToIt; this.chkSingleClickOnOpenedConnectionSwitchesToIt.UseVisualStyleBackColor = true; @@ -170,7 +170,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numAutoSave.Name = "numAutoSave"; - this.numAutoSave.Size = new System.Drawing.Size(53, 20); + this.numAutoSave.Size = new System.Drawing.Size(53, 22); this.numAutoSave.TabIndex = 1; // // pnlConfirmCloseConnection @@ -190,7 +190,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblClosingConnections.AutoSize = true; this.lblClosingConnections.Location = new System.Drawing.Point(3, 12); this.lblClosingConnections.Name = "lblClosingConnections"; - this.lblClosingConnections.Size = new System.Drawing.Size(136, 13); + this.lblClosingConnections.Size = new System.Drawing.Size(147, 13); this.lblClosingConnections.TabIndex = 0; this.lblClosingConnections.Text = "When closing connections:"; // @@ -199,7 +199,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.radCloseWarnAll.AutoSize = true; this.radCloseWarnAll.Location = new System.Drawing.Point(16, 34); this.radCloseWarnAll.Name = "radCloseWarnAll"; - this.radCloseWarnAll.Size = new System.Drawing.Size(194, 17); + this.radCloseWarnAll.Size = new System.Drawing.Size(209, 17); this.radCloseWarnAll.TabIndex = 1; this.radCloseWarnAll.TabStop = true; this.radCloseWarnAll.Text = "Warn me when closing connections"; @@ -210,7 +210,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.radCloseWarnMultiple.AutoSize = true; this.radCloseWarnMultiple.Location = new System.Drawing.Point(16, 57); this.radCloseWarnMultiple.Name = "radCloseWarnMultiple"; - this.radCloseWarnMultiple.Size = new System.Drawing.Size(254, 17); + this.radCloseWarnMultiple.Size = new System.Drawing.Size(279, 17); this.radCloseWarnMultiple.TabIndex = 2; this.radCloseWarnMultiple.TabStop = true; this.radCloseWarnMultiple.Text = "Warn me only when closing multiple connections"; @@ -221,7 +221,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.radCloseWarnExit.AutoSize = true; this.radCloseWarnExit.Location = new System.Drawing.Point(16, 80); this.radCloseWarnExit.Name = "radCloseWarnExit"; - this.radCloseWarnExit.Size = new System.Drawing.Size(216, 17); + this.radCloseWarnExit.Size = new System.Drawing.Size(233, 17); this.radCloseWarnExit.TabIndex = 3; this.radCloseWarnExit.TabStop = true; this.radCloseWarnExit.Text = "Warn me only when exiting mRemoteNG"; @@ -232,7 +232,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.radCloseWarnNever.AutoSize = true; this.radCloseWarnNever.Location = new System.Drawing.Point(16, 103); this.radCloseWarnNever.Name = "radCloseWarnNever"; - this.radCloseWarnNever.Size = new System.Drawing.Size(226, 17); + this.radCloseWarnNever.Size = new System.Drawing.Size(246, 17); this.radCloseWarnNever.TabIndex = 4; this.radCloseWarnNever.TabStop = true; this.radCloseWarnNever.Text = "Do not warn me when closing connections"; @@ -244,7 +244,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSaveConnectionsAfterEveryEdit.AutoSize = true; this.chkSaveConnectionsAfterEveryEdit.Location = new System.Drawing.Point(3, 72); this.chkSaveConnectionsAfterEveryEdit.Name = "chkSaveConnectionsAfterEveryEdit"; - this.chkSaveConnectionsAfterEveryEdit.Size = new System.Drawing.Size(185, 17); + this.chkSaveConnectionsAfterEveryEdit.Size = new System.Drawing.Size(194, 17); this.chkSaveConnectionsAfterEveryEdit.TabIndex = 7; this.chkSaveConnectionsAfterEveryEdit.Text = "Save connections after every edit"; this.chkSaveConnectionsAfterEveryEdit.UseVisualStyleBackColor = true; @@ -255,7 +255,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkUseFilterSearch.AutoSize = true; this.chkUseFilterSearch.Location = new System.Drawing.Point(3, 95); this.chkUseFilterSearch.Name = "chkUseFilterSearch"; - this.chkUseFilterSearch.Size = new System.Drawing.Size(214, 17); + this.chkUseFilterSearch.Size = new System.Drawing.Size(230, 17); this.chkUseFilterSearch.TabIndex = 8; this.chkUseFilterSearch.Text = "Filter search matches in connection tree"; this.chkUseFilterSearch.UseVisualStyleBackColor = true; @@ -286,7 +286,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkPlaceSearchBarAboveConnectionTree.AutoSize = true; this.chkPlaceSearchBarAboveConnectionTree.Location = new System.Drawing.Point(3, 118); this.chkPlaceSearchBarAboveConnectionTree.Name = "chkPlaceSearchBarAboveConnectionTree"; - this.chkPlaceSearchBarAboveConnectionTree.Size = new System.Drawing.Size(216, 17); + this.chkPlaceSearchBarAboveConnectionTree.Size = new System.Drawing.Size(226, 17); this.chkPlaceSearchBarAboveConnectionTree.TabIndex = 8; this.chkPlaceSearchBarAboveConnectionTree.Text = "Place search bar above connection tree"; this.chkPlaceSearchBarAboveConnectionTree.UseVisualStyleBackColor = true; @@ -303,6 +303,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.chkHostnameLikeDisplayName); this.Controls.Add(this.chkSingleClickOnOpenedConnectionSwitchesToIt); this.Controls.Add(this.pnlConfirmCloseConnection); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "ConnectionsPage"; this.Size = new System.Drawing.Size(610, 490); ((System.ComponentModel.ISupportInitialize)(this.numRDPConTimeout)).EndInit(); diff --git a/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.resx b/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/ConnectionsPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/CredentialsPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/CredentialsPage.Designer.cs index 9f8726625..95ce94cef 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/CredentialsPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/CredentialsPage.Designer.cs @@ -65,7 +65,7 @@ this.radCredentialsCustom.AutoSize = true; this.radCredentialsCustom.Location = new System.Drawing.Point(3, 62); this.radCredentialsCustom.Name = "radCredentialsCustom"; - this.radCredentialsCustom.Size = new System.Drawing.Size(87, 17); + this.radCredentialsCustom.Size = new System.Drawing.Size(98, 17); this.radCredentialsCustom.TabIndex = 3; this.radCredentialsCustom.Text = "the following:"; this.radCredentialsCustom.UseVisualStyleBackColor = true; @@ -76,7 +76,7 @@ this.lblDefaultCredentials.AutoSize = true; this.lblDefaultCredentials.Location = new System.Drawing.Point(0, 0); this.lblDefaultCredentials.Name = "lblDefaultCredentials"; - this.lblDefaultCredentials.Size = new System.Drawing.Size(257, 13); + this.lblDefaultCredentials.Size = new System.Drawing.Size(279, 13); this.lblDefaultCredentials.TabIndex = 0; this.lblDefaultCredentials.Text = "For empty Username, Password or Domain fields use:"; // @@ -86,7 +86,7 @@ this.radCredentialsNoInfo.Checked = true; this.radCredentialsNoInfo.Location = new System.Drawing.Point(3, 16); this.radCredentialsNoInfo.Name = "radCredentialsNoInfo"; - this.radCredentialsNoInfo.Size = new System.Drawing.Size(91, 17); + this.radCredentialsNoInfo.Size = new System.Drawing.Size(103, 17); this.radCredentialsNoInfo.TabIndex = 1; this.radCredentialsNoInfo.TabStop = true; this.radCredentialsNoInfo.Text = "no information"; @@ -97,7 +97,7 @@ this.radCredentialsWindows.AutoSize = true; this.radCredentialsWindows.Location = new System.Drawing.Point(3, 39); this.radCredentialsWindows.Name = "radCredentialsWindows"; - this.radCredentialsWindows.Size = new System.Drawing.Size(227, 17); + this.radCredentialsWindows.Size = new System.Drawing.Size(252, 17); this.radCredentialsWindows.TabIndex = 2; this.radCredentialsWindows.Text = "my current credentials (windows logon info)"; this.radCredentialsWindows.UseVisualStyleBackColor = true; @@ -108,7 +108,7 @@ this.txtCredentialsDomain.Enabled = false; this.txtCredentialsDomain.Location = new System.Drawing.Point(126, 138); this.txtCredentialsDomain.Name = "txtCredentialsDomain"; - this.txtCredentialsDomain.Size = new System.Drawing.Size(150, 20); + this.txtCredentialsDomain.Size = new System.Drawing.Size(150, 22); this.txtCredentialsDomain.TabIndex = 9; // // lblCredentialsUsername @@ -127,7 +127,7 @@ this.txtCredentialsPassword.Enabled = false; this.txtCredentialsPassword.Location = new System.Drawing.Point(126, 112); this.txtCredentialsPassword.Name = "txtCredentialsPassword"; - this.txtCredentialsPassword.Size = new System.Drawing.Size(150, 20); + this.txtCredentialsPassword.Size = new System.Drawing.Size(150, 22); this.txtCredentialsPassword.TabIndex = 7; this.txtCredentialsPassword.UseSystemPasswordChar = true; // @@ -147,7 +147,7 @@ this.txtCredentialsUsername.Enabled = false; this.txtCredentialsUsername.Location = new System.Drawing.Point(126, 86); this.txtCredentialsUsername.Name = "txtCredentialsUsername"; - this.txtCredentialsUsername.Size = new System.Drawing.Size(150, 20); + this.txtCredentialsUsername.Size = new System.Drawing.Size(150, 22); this.txtCredentialsUsername.TabIndex = 5; // // lblCredentialsDomain @@ -177,6 +177,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.checkBoxUnlockOnStartup); this.Controls.Add(this.pnlDefaultCredentials); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "CredentialsPage"; this.Size = new System.Drawing.Size(610, 490); this.pnlDefaultCredentials.ResumeLayout(false); diff --git a/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.Designer.cs index d21e15a4f..45d1dc74d 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.Designer.cs @@ -73,7 +73,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.labelSwitchToErrorsAndInfos.AutoSize = true; this.labelSwitchToErrorsAndInfos.Location = new System.Drawing.Point(177, 25); this.labelSwitchToErrorsAndInfos.Name = "labelSwitchToErrorsAndInfos"; - this.labelSwitchToErrorsAndInfos.Size = new System.Drawing.Size(159, 13); + this.labelSwitchToErrorsAndInfos.Size = new System.Drawing.Size(176, 13); this.labelSwitchToErrorsAndInfos.TabIndex = 5; this.labelSwitchToErrorsAndInfos.Text = "Switch to Notifications panel on:"; // @@ -83,7 +83,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSwitchToMCInformation.AutoSize = true; this.chkSwitchToMCInformation.Location = new System.Drawing.Point(195, 67); this.chkSwitchToMCInformation.Name = "chkSwitchToMCInformation"; - this.chkSwitchToMCInformation.Size = new System.Drawing.Size(78, 17); + this.chkSwitchToMCInformation.Size = new System.Drawing.Size(87, 17); this.chkSwitchToMCInformation.TabIndex = 6; this.chkSwitchToMCInformation.Text = "Information"; this.chkSwitchToMCInformation.UseVisualStyleBackColor = true; @@ -94,7 +94,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSwitchToMCErrors.AutoSize = true; this.chkSwitchToMCErrors.Location = new System.Drawing.Point(195, 113); this.chkSwitchToMCErrors.Name = "chkSwitchToMCErrors"; - this.chkSwitchToMCErrors.Size = new System.Drawing.Size(48, 17); + this.chkSwitchToMCErrors.Size = new System.Drawing.Size(51, 17); this.chkSwitchToMCErrors.TabIndex = 8; this.chkSwitchToMCErrors.Text = "Error"; this.chkSwitchToMCErrors.UseVisualStyleBackColor = true; @@ -105,7 +105,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSwitchToMCWarnings.AutoSize = true; this.chkSwitchToMCWarnings.Location = new System.Drawing.Point(195, 90); this.chkSwitchToMCWarnings.Name = "chkSwitchToMCWarnings"; - this.chkSwitchToMCWarnings.Size = new System.Drawing.Size(66, 17); + this.chkSwitchToMCWarnings.Size = new System.Drawing.Size(71, 17); this.chkSwitchToMCWarnings.TabIndex = 7; this.chkSwitchToMCWarnings.Text = "Warning"; this.chkSwitchToMCWarnings.UseVisualStyleBackColor = true; @@ -133,7 +133,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.labelNotificationsShowTypes.AutoSize = true; this.labelNotificationsShowTypes.Location = new System.Drawing.Point(6, 25); this.labelNotificationsShowTypes.Name = "labelNotificationsShowTypes"; - this.labelNotificationsShowTypes.Size = new System.Drawing.Size(139, 13); + this.labelNotificationsShowTypes.Size = new System.Drawing.Size(147, 13); this.labelNotificationsShowTypes.TabIndex = 0; this.labelNotificationsShowTypes.Text = "Show these message types:"; // @@ -143,7 +143,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowErrorInMC.AutoSize = true; this.chkShowErrorInMC.Location = new System.Drawing.Point(20, 113); this.chkShowErrorInMC.Name = "chkShowErrorInMC"; - this.chkShowErrorInMC.Size = new System.Drawing.Size(48, 17); + this.chkShowErrorInMC.Size = new System.Drawing.Size(51, 17); this.chkShowErrorInMC.TabIndex = 4; this.chkShowErrorInMC.Text = "Error"; this.chkShowErrorInMC.UseVisualStyleBackColor = true; @@ -154,7 +154,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowWarningInMC.AutoSize = true; this.chkShowWarningInMC.Location = new System.Drawing.Point(20, 90); this.chkShowWarningInMC.Name = "chkShowWarningInMC"; - this.chkShowWarningInMC.Size = new System.Drawing.Size(66, 17); + this.chkShowWarningInMC.Size = new System.Drawing.Size(71, 17); this.chkShowWarningInMC.TabIndex = 3; this.chkShowWarningInMC.Text = "Warning"; this.chkShowWarningInMC.UseVisualStyleBackColor = true; @@ -165,7 +165,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowInfoInMC.AutoSize = true; this.chkShowInfoInMC.Location = new System.Drawing.Point(20, 67); this.chkShowInfoInMC.Name = "chkShowInfoInMC"; - this.chkShowInfoInMC.Size = new System.Drawing.Size(78, 17); + this.chkShowInfoInMC.Size = new System.Drawing.Size(87, 17); this.chkShowInfoInMC.TabIndex = 2; this.chkShowInfoInMC.Text = "Information"; this.chkShowInfoInMC.UseVisualStyleBackColor = true; @@ -176,7 +176,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowDebugInMC.AutoSize = true; this.chkShowDebugInMC.Location = new System.Drawing.Point(20, 44); this.chkShowDebugInMC.Name = "chkShowDebugInMC"; - this.chkShowDebugInMC.Size = new System.Drawing.Size(58, 17); + this.chkShowDebugInMC.Size = new System.Drawing.Size(61, 17); this.chkShowDebugInMC.TabIndex = 1; this.chkShowDebugInMC.Text = "Debug"; this.chkShowDebugInMC.UseVisualStyleBackColor = true; @@ -223,7 +223,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLogDebugMsgs.AutoSize = true; this.chkLogDebugMsgs.Location = new System.Drawing.Point(3, 3); this.chkLogDebugMsgs.Name = "chkLogDebugMsgs"; - this.chkLogDebugMsgs.Size = new System.Drawing.Size(58, 17); + this.chkLogDebugMsgs.Size = new System.Drawing.Size(61, 17); this.chkLogDebugMsgs.TabIndex = 0; this.chkLogDebugMsgs.Text = "Debug"; this.chkLogDebugMsgs.UseVisualStyleBackColor = true; @@ -234,7 +234,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLogInfoMsgs.AutoSize = true; this.chkLogInfoMsgs.Location = new System.Drawing.Point(149, 3); this.chkLogInfoMsgs.Name = "chkLogInfoMsgs"; - this.chkLogInfoMsgs.Size = new System.Drawing.Size(78, 17); + this.chkLogInfoMsgs.Size = new System.Drawing.Size(87, 17); this.chkLogInfoMsgs.TabIndex = 1; this.chkLogInfoMsgs.Text = "Information"; this.chkLogInfoMsgs.UseVisualStyleBackColor = true; @@ -245,7 +245,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLogWarningMsgs.AutoSize = true; this.chkLogWarningMsgs.Location = new System.Drawing.Point(295, 3); this.chkLogWarningMsgs.Name = "chkLogWarningMsgs"; - this.chkLogWarningMsgs.Size = new System.Drawing.Size(66, 17); + this.chkLogWarningMsgs.Size = new System.Drawing.Size(71, 17); this.chkLogWarningMsgs.TabIndex = 2; this.chkLogWarningMsgs.Text = "Warning"; this.chkLogWarningMsgs.UseVisualStyleBackColor = true; @@ -256,7 +256,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLogErrorMsgs.AutoSize = true; this.chkLogErrorMsgs.Location = new System.Drawing.Point(441, 3); this.chkLogErrorMsgs.Name = "chkLogErrorMsgs"; - this.chkLogErrorMsgs.Size = new System.Drawing.Size(48, 17); + this.chkLogErrorMsgs.Size = new System.Drawing.Size(51, 17); this.chkLogErrorMsgs.TabIndex = 3; this.chkLogErrorMsgs.Text = "Error"; this.chkLogErrorMsgs.UseVisualStyleBackColor = true; @@ -267,7 +267,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkLogToCurrentDir.AutoSize = true; this.chkLogToCurrentDir.Location = new System.Drawing.Point(9, 18); this.chkLogToCurrentDir.Name = "chkLogToCurrentDir"; - this.chkLogToCurrentDir.Size = new System.Drawing.Size(153, 17); + this.chkLogToCurrentDir.Size = new System.Drawing.Size(168, 17); this.chkLogToCurrentDir.TabIndex = 0; this.chkLogToCurrentDir.Text = "Log to application directory"; this.chkLogToCurrentDir.UseVisualStyleBackColor = true; @@ -311,7 +311,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.labelLogTheseMsgTypes.AutoSize = true; this.labelLogTheseMsgTypes.Location = new System.Drawing.Point(6, 108); this.labelLogTheseMsgTypes.Name = "labelLogTheseMsgTypes"; - this.labelLogTheseMsgTypes.Size = new System.Drawing.Size(130, 13); + this.labelLogTheseMsgTypes.Size = new System.Drawing.Size(137, 13); this.labelLogTheseMsgTypes.TabIndex = 6; this.labelLogTheseMsgTypes.Text = "Log these message types:"; // @@ -320,7 +320,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.labelLogFilePath.AutoSize = true; this.labelLogFilePath.Location = new System.Drawing.Point(6, 38); this.labelLogFilePath.Name = "labelLogFilePath"; - this.labelLogFilePath.Size = new System.Drawing.Size(68, 13); + this.labelLogFilePath.Size = new System.Drawing.Size(75, 13); this.labelLogFilePath.TabIndex = 1; this.labelLogFilePath.Text = "Log file path:"; // @@ -330,7 +330,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.textBoxLogPath.Location = new System.Drawing.Point(9, 57); this.textBoxLogPath.Name = "textBoxLogPath"; this.textBoxLogPath.ReadOnly = true; - this.textBoxLogPath.Size = new System.Drawing.Size(585, 20); + this.textBoxLogPath.Size = new System.Drawing.Size(585, 22); this.textBoxLogPath.TabIndex = 2; // // groupBoxPopups @@ -369,7 +369,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkPopupDebug.AutoSize = true; this.chkPopupDebug.Location = new System.Drawing.Point(3, 3); this.chkPopupDebug.Name = "chkPopupDebug"; - this.chkPopupDebug.Size = new System.Drawing.Size(58, 17); + this.chkPopupDebug.Size = new System.Drawing.Size(61, 17); this.chkPopupDebug.TabIndex = 0; this.chkPopupDebug.Text = "Debug"; this.chkPopupDebug.UseVisualStyleBackColor = true; @@ -380,7 +380,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkPopupError.AutoSize = true; this.chkPopupError.Location = new System.Drawing.Point(441, 3); this.chkPopupError.Name = "chkPopupError"; - this.chkPopupError.Size = new System.Drawing.Size(48, 17); + this.chkPopupError.Size = new System.Drawing.Size(51, 17); this.chkPopupError.TabIndex = 3; this.chkPopupError.Text = "Error"; this.chkPopupError.UseVisualStyleBackColor = true; @@ -391,7 +391,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkPopupInfo.AutoSize = true; this.chkPopupInfo.Location = new System.Drawing.Point(149, 3); this.chkPopupInfo.Name = "chkPopupInfo"; - this.chkPopupInfo.Size = new System.Drawing.Size(78, 17); + this.chkPopupInfo.Size = new System.Drawing.Size(87, 17); this.chkPopupInfo.TabIndex = 1; this.chkPopupInfo.Text = "Information"; this.chkPopupInfo.UseVisualStyleBackColor = true; @@ -402,7 +402,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkPopupWarning.AutoSize = true; this.chkPopupWarning.Location = new System.Drawing.Point(295, 3); this.chkPopupWarning.Name = "chkPopupWarning"; - this.chkPopupWarning.Size = new System.Drawing.Size(66, 17); + this.chkPopupWarning.Size = new System.Drawing.Size(71, 17); this.chkPopupWarning.TabIndex = 2; this.chkPopupWarning.Text = "Warning"; this.chkPopupWarning.UseVisualStyleBackColor = true; @@ -412,7 +412,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.labelPopupShowTypes.AutoSize = true; this.labelPopupShowTypes.Location = new System.Drawing.Point(8, 24); this.labelPopupShowTypes.Name = "labelPopupShowTypes"; - this.labelPopupShowTypes.Size = new System.Drawing.Size(139, 13); + this.labelPopupShowTypes.Size = new System.Drawing.Size(147, 13); this.labelPopupShowTypes.TabIndex = 0; this.labelPopupShowTypes.Text = "Show these message types:"; // @@ -423,6 +423,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.groupBoxPopups); this.Controls.Add(this.groupBoxLogging); this.Controls.Add(this.groupBoxNotifications); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "NotificationsPage"; this.Size = new System.Drawing.Size(610, 490); this.groupBoxNotifications.ResumeLayout(false); @@ -443,13 +444,11 @@ namespace mRemoteNG.UI.Forms.OptionsPages internal Controls.Base.NGCheckBox chkSwitchToMCInformation; internal Controls.Base.NGCheckBox chkSwitchToMCErrors; internal Controls.Base.NGCheckBox chkSwitchToMCWarnings; - private System.Windows.Forms.GroupBox groupBoxNotifications; private Controls.Base.NGLabel labelNotificationsShowTypes; private Controls.Base.NGCheckBox chkShowErrorInMC; private Controls.Base.NGCheckBox chkShowWarningInMC; private Controls.Base.NGCheckBox chkShowInfoInMC; private Controls.Base.NGCheckBox chkShowDebugInMC; - private System.Windows.Forms.GroupBox groupBoxLogging; private System.Windows.Forms.SaveFileDialog saveFileDialogLogging; private Controls.Base.NGLabel labelLogFilePath; private Controls.Base.NGTextBox textBoxLogPath; @@ -461,7 +460,6 @@ namespace mRemoteNG.UI.Forms.OptionsPages private Controls.Base.NGCheckBox chkLogDebugMsgs; private Controls.Base.NGButton buttonOpenLogFile; private Controls.Base.NGButton buttonRestoreDefaultLogPath; - private System.Windows.Forms.GroupBox groupBoxPopups; private Controls.Base.NGCheckBox chkPopupError; private Controls.Base.NGLabel labelPopupShowTypes; private Controls.Base.NGCheckBox chkPopupWarning; @@ -470,5 +468,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages private Controls.Base.NGCheckBox chkLogToCurrentDir; private System.Windows.Forms.TableLayoutPanel tblLogging; private System.Windows.Forms.TableLayoutPanel tblPopups; + private Controls.Base.NGGroupBox groupBoxNotifications; + private Controls.Base.NGGroupBox groupBoxLogging; + private Controls.Base.NGGroupBox groupBoxPopups; } } diff --git a/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.resx b/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.resx new file mode 100644 index 000000000..5324ee22c --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/NotificationsPage.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.cs b/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.cs index 63357fd18..dbbb1113a 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.cs @@ -64,5 +64,17 @@ namespace mRemoteNG.UI.Forms.OptionsPages ForeColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground"); Invalidate(); } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // OptionsPage + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "OptionsPage"; + this.ResumeLayout(false); + + } } } diff --git a/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.resx b/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/OptionsPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.Designer.cs index b073e9133..9e9e88aa5 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.Designer.cs @@ -46,7 +46,7 @@ this.chkEncryptCompleteFile.AutoSize = true; this.chkEncryptCompleteFile.Location = new System.Drawing.Point(3, 3); this.chkEncryptCompleteFile.Name = "chkEncryptCompleteFile"; - this.chkEncryptCompleteFile.Size = new System.Drawing.Size(180, 17); + this.chkEncryptCompleteFile.Size = new System.Drawing.Size(194, 17); this.chkEncryptCompleteFile.TabIndex = 0; this.chkEncryptCompleteFile.Text = "Encrypt complete connection file"; this.chkEncryptCompleteFile.UseVisualStyleBackColor = true; @@ -67,7 +67,7 @@ this.labelEncryptionEngine.AutoSize = true; this.labelEncryptionEngine.Location = new System.Drawing.Point(9, 28); this.labelEncryptionEngine.Name = "labelEncryptionEngine"; - this.labelEncryptionEngine.Size = new System.Drawing.Size(93, 13); + this.labelEncryptionEngine.Size = new System.Drawing.Size(101, 13); this.labelEncryptionEngine.TabIndex = 0; this.labelEncryptionEngine.Text = "Encryption Engine"; // @@ -76,7 +76,7 @@ this.labelBlockCipher.AutoSize = true; this.labelBlockCipher.Location = new System.Drawing.Point(9, 60); this.labelBlockCipher.Name = "labelBlockCipher"; - this.labelBlockCipher.Size = new System.Drawing.Size(97, 13); + this.labelBlockCipher.Size = new System.Drawing.Size(105, 13); this.labelBlockCipher.TabIndex = 2; this.labelBlockCipher.Text = "Block Cipher Mode"; // @@ -124,7 +124,7 @@ 0, 0}); this.numberBoxKdfIterations.Name = "numberBoxKdfIterations"; - this.numberBoxKdfIterations.Size = new System.Drawing.Size(90, 20); + this.numberBoxKdfIterations.Size = new System.Drawing.Size(90, 22); this.numberBoxKdfIterations.TabIndex = 5; this.numberBoxKdfIterations.ThousandsSeparator = true; this.numberBoxKdfIterations.Value = new decimal(new int[] { @@ -138,7 +138,7 @@ this.labelKdfIterations.AutoSize = true; this.labelKdfIterations.Location = new System.Drawing.Point(9, 90); this.labelKdfIterations.Name = "labelKdfIterations"; - this.labelKdfIterations.Size = new System.Drawing.Size(166, 13); + this.labelKdfIterations.Size = new System.Drawing.Size(181, 13); this.labelKdfIterations.TabIndex = 4; this.labelKdfIterations.Text = "Key Derivation Function Iterations"; // @@ -148,6 +148,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.chkEncryptCompleteFile); this.Controls.Add(this.groupAdvancedSecurityOptions); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "SecurityPage"; this.Size = new System.Drawing.Size(610, 490); this.groupAdvancedSecurityOptions.ResumeLayout(false); diff --git a/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.resx b/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/SecurityPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs index 53df8409a..e91509ae3 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.Designer.cs @@ -63,7 +63,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtSQLDatabaseName.Enabled = false; this.txtSQLDatabaseName.Location = new System.Drawing.Point(140, 130); this.txtSQLDatabaseName.Name = "txtSQLDatabaseName"; - this.txtSQLDatabaseName.Size = new System.Drawing.Size(153, 20); + this.txtSQLDatabaseName.Size = new System.Drawing.Size(153, 22); this.txtSQLDatabaseName.TabIndex = 6; // // lblExperimental @@ -86,7 +86,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkUseSQLServer.AutoSize = true; this.chkUseSQLServer.Location = new System.Drawing.Point(3, 76); this.chkUseSQLServer.Name = "chkUseSQLServer"; - this.chkUseSQLServer.Size = new System.Drawing.Size(234, 17); + this.chkUseSQLServer.Size = new System.Drawing.Size(244, 17); this.chkUseSQLServer.TabIndex = 2; this.chkUseSQLServer.Text = "Use SQL Server to load && save connections"; this.chkUseSQLServer.UseVisualStyleBackColor = true; @@ -108,7 +108,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtSQLPassword.Enabled = false; this.txtSQLPassword.Location = new System.Drawing.Point(140, 182); this.txtSQLPassword.Name = "txtSQLPassword"; - this.txtSQLPassword.Size = new System.Drawing.Size(153, 20); + this.txtSQLPassword.Size = new System.Drawing.Size(153, 22); this.txtSQLPassword.TabIndex = 10; this.txtSQLPassword.UseSystemPasswordChar = true; // @@ -142,7 +142,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtSQLUsername.Enabled = false; this.txtSQLUsername.Location = new System.Drawing.Point(140, 156); this.txtSQLUsername.Name = "txtSQLUsername"; - this.txtSQLUsername.Size = new System.Drawing.Size(153, 20); + this.txtSQLUsername.Size = new System.Drawing.Size(153, 22); this.txtSQLUsername.TabIndex = 8; // // txtSQLServer @@ -151,7 +151,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtSQLServer.Enabled = false; this.txtSQLServer.Location = new System.Drawing.Point(140, 103); this.txtSQLServer.Name = "txtSQLServer"; - this.txtSQLServer.Size = new System.Drawing.Size(153, 20); + this.txtSQLServer.Size = new System.Drawing.Size(153, 22); this.txtSQLServer.TabIndex = 4; // // lblSQLPassword @@ -191,7 +191,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblTestConnectionResults.AutoSize = true; this.lblTestConnectionResults.Location = new System.Drawing.Point(137, 254); this.lblTestConnectionResults.Name = "lblTestConnectionResults"; - this.lblTestConnectionResults.Size = new System.Drawing.Size(117, 13); + this.lblTestConnectionResults.Size = new System.Drawing.Size(124, 13); this.lblTestConnectionResults.TabIndex = 13; this.lblTestConnectionResults.Text = "Test connection details"; // @@ -235,6 +235,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.txtSQLUsername); this.Controls.Add(this.txtSQLServer); this.Controls.Add(this.lblSQLPassword); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "SqlServerPage"; this.Size = new System.Drawing.Size(610, 490); ((System.ComponentModel.ISupportInitialize)(this.imgConnectionStatus)).EndInit(); diff --git a/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.resx b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/SqlServerPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.Designer.cs index 2309fdd8c..f0ad70b56 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.Designer.cs @@ -43,7 +43,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkReconnectOnStart.AutoSize = true; this.chkReconnectOnStart.Location = new System.Drawing.Point(3, 26); this.chkReconnectOnStart.Name = "chkReconnectOnStart"; - this.chkReconnectOnStart.Size = new System.Drawing.Size(273, 17); + this.chkReconnectOnStart.Size = new System.Drawing.Size(295, 17); this.chkReconnectOnStart.TabIndex = 1; this.chkReconnectOnStart.Text = "Reconnect to previously opened sessions on startup"; this.chkReconnectOnStart.UseVisualStyleBackColor = true; @@ -54,7 +54,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSaveConsOnExit.AutoSize = true; this.chkSaveConsOnExit.Location = new System.Drawing.Point(3, 2); this.chkSaveConsOnExit.Name = "chkSaveConsOnExit"; - this.chkSaveConsOnExit.Size = new System.Drawing.Size(146, 17); + this.chkSaveConsOnExit.Size = new System.Drawing.Size(153, 17); this.chkSaveConsOnExit.TabIndex = 0; this.chkSaveConsOnExit.Text = "Save connections on exit"; this.chkSaveConsOnExit.UseVisualStyleBackColor = true; @@ -65,7 +65,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkSingleInstance.AutoSize = true; this.chkSingleInstance.Location = new System.Drawing.Point(3, 50); this.chkSingleInstance.Name = "chkSingleInstance"; - this.chkSingleInstance.Size = new System.Drawing.Size(366, 17); + this.chkSingleInstance.Size = new System.Drawing.Size(404, 17); this.chkSingleInstance.TabIndex = 2; this.chkSingleInstance.Text = "Allow only a single instance of the application (mRemote restart required)"; this.chkSingleInstance.UseVisualStyleBackColor = true; @@ -76,7 +76,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkProperInstallationOfComponentsAtStartup.AutoSize = true; this.chkProperInstallationOfComponentsAtStartup.Location = new System.Drawing.Point(3, 74); this.chkProperInstallationOfComponentsAtStartup.Name = "chkProperInstallationOfComponentsAtStartup"; - this.chkProperInstallationOfComponentsAtStartup.Size = new System.Drawing.Size(262, 17); + this.chkProperInstallationOfComponentsAtStartup.Size = new System.Drawing.Size(290, 17); this.chkProperInstallationOfComponentsAtStartup.TabIndex = 3; this.chkProperInstallationOfComponentsAtStartup.Text = "Check proper installation of components at startup"; this.chkProperInstallationOfComponentsAtStartup.UseVisualStyleBackColor = true; @@ -89,6 +89,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.chkSaveConsOnExit); this.Controls.Add(this.chkSingleInstance); this.Controls.Add(this.chkProperInstallationOfComponentsAtStartup); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "StartupExitPage"; this.Size = new System.Drawing.Size(610, 490); this.Load += new System.EventHandler(this.StartupExitPage_Load); diff --git a/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.resx b/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/StartupExitPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs index eecb603bf..582ebe570 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs @@ -49,7 +49,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkAlwaysShowPanelTabs.AutoSize = true; this.chkAlwaysShowPanelTabs.Location = new System.Drawing.Point(3, 3); this.chkAlwaysShowPanelTabs.Name = "chkAlwaysShowPanelTabs"; - this.chkAlwaysShowPanelTabs.Size = new System.Drawing.Size(139, 17); + this.chkAlwaysShowPanelTabs.Size = new System.Drawing.Size(149, 17); this.chkAlwaysShowPanelTabs.TabIndex = 0; this.chkAlwaysShowPanelTabs.Text = "Always show panel tabs"; this.chkAlwaysShowPanelTabs.UseVisualStyleBackColor = true; @@ -60,7 +60,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkIdentifyQuickConnectTabs.AutoSize = true; this.chkIdentifyQuickConnectTabs.Location = new System.Drawing.Point(3, 95); this.chkIdentifyQuickConnectTabs.Name = "chkIdentifyQuickConnectTabs"; - this.chkIdentifyQuickConnectTabs.Size = new System.Drawing.Size(293, 17); + this.chkIdentifyQuickConnectTabs.Size = new System.Drawing.Size(315, 17); this.chkIdentifyQuickConnectTabs.TabIndex = 4; this.chkIdentifyQuickConnectTabs.Text = global::mRemoteNG.Language.strIdentifyQuickConnectTabs; this.chkIdentifyQuickConnectTabs.UseVisualStyleBackColor = true; @@ -71,7 +71,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkOpenNewTabRightOfSelected.AutoSize = true; this.chkOpenNewTabRightOfSelected.Location = new System.Drawing.Point(3, 26); this.chkOpenNewTabRightOfSelected.Name = "chkOpenNewTabRightOfSelected"; - this.chkOpenNewTabRightOfSelected.Size = new System.Drawing.Size(280, 17); + this.chkOpenNewTabRightOfSelected.Size = new System.Drawing.Size(309, 17); this.chkOpenNewTabRightOfSelected.TabIndex = 1; this.chkOpenNewTabRightOfSelected.Text = "Open new tab to the right of the currently selected tab"; this.chkOpenNewTabRightOfSelected.UseVisualStyleBackColor = true; @@ -82,7 +82,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkAlwaysShowPanelSelectionDlg.AutoSize = true; this.chkAlwaysShowPanelSelectionDlg.Location = new System.Drawing.Point(3, 141); this.chkAlwaysShowPanelSelectionDlg.Name = "chkAlwaysShowPanelSelectionDlg"; - this.chkAlwaysShowPanelSelectionDlg.Size = new System.Drawing.Size(317, 17); + this.chkAlwaysShowPanelSelectionDlg.Size = new System.Drawing.Size(347, 17); this.chkAlwaysShowPanelSelectionDlg.TabIndex = 6; this.chkAlwaysShowPanelSelectionDlg.Text = "Always show panel selection dialog when opening connectins"; this.chkAlwaysShowPanelSelectionDlg.UseVisualStyleBackColor = true; @@ -93,7 +93,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowLogonInfoOnTabs.AutoSize = true; this.chkShowLogonInfoOnTabs.Location = new System.Drawing.Point(3, 49); this.chkShowLogonInfoOnTabs.Name = "chkShowLogonInfoOnTabs"; - this.chkShowLogonInfoOnTabs.Size = new System.Drawing.Size(203, 17); + this.chkShowLogonInfoOnTabs.Size = new System.Drawing.Size(226, 17); this.chkShowLogonInfoOnTabs.TabIndex = 2; this.chkShowLogonInfoOnTabs.Text = "Show logon information on tab names"; this.chkShowLogonInfoOnTabs.UseVisualStyleBackColor = true; @@ -104,7 +104,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkDoubleClickClosesTab.AutoSize = true; this.chkDoubleClickClosesTab.Location = new System.Drawing.Point(3, 118); this.chkDoubleClickClosesTab.Name = "chkDoubleClickClosesTab"; - this.chkDoubleClickClosesTab.Size = new System.Drawing.Size(159, 17); + this.chkDoubleClickClosesTab.Size = new System.Drawing.Size(170, 17); this.chkDoubleClickClosesTab.TabIndex = 5; this.chkDoubleClickClosesTab.Text = "Double click on tab closes it"; this.chkDoubleClickClosesTab.UseVisualStyleBackColor = true; @@ -115,7 +115,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkShowProtocolOnTabs.AutoSize = true; this.chkShowProtocolOnTabs.Location = new System.Drawing.Point(3, 72); this.chkShowProtocolOnTabs.Name = "chkShowProtocolOnTabs"; - this.chkShowProtocolOnTabs.Size = new System.Drawing.Size(166, 17); + this.chkShowProtocolOnTabs.Size = new System.Drawing.Size(180, 17); this.chkShowProtocolOnTabs.TabIndex = 3; this.chkShowProtocolOnTabs.Text = "Show protocols on tab names"; this.chkShowProtocolOnTabs.UseVisualStyleBackColor = true; @@ -126,7 +126,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkCreateEmptyPanelOnStart.AutoSize = true; this.chkCreateEmptyPanelOnStart.Location = new System.Drawing.Point(3, 164); this.chkCreateEmptyPanelOnStart.Name = "chkCreateEmptyPanelOnStart"; - this.chkCreateEmptyPanelOnStart.Size = new System.Drawing.Size(253, 17); + this.chkCreateEmptyPanelOnStart.Size = new System.Drawing.Size(271, 17); this.chkCreateEmptyPanelOnStart.TabIndex = 7; this.chkCreateEmptyPanelOnStart.Text = "Create an empty panel when mRemoteNG starts"; this.chkCreateEmptyPanelOnStart.UseVisualStyleBackColor = true; @@ -136,7 +136,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages // this.txtBoxPanelName.Location = new System.Drawing.Point(43, 200); this.txtBoxPanelName.Name = "txtBoxPanelName"; - this.txtBoxPanelName.Size = new System.Drawing.Size(213, 20); + this.txtBoxPanelName.Size = new System.Drawing.Size(213, 22); this.txtBoxPanelName.TabIndex = 8; // // lblPanelName @@ -144,7 +144,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblPanelName.AutoSize = true; this.lblPanelName.Location = new System.Drawing.Point(40, 184); this.lblPanelName.Name = "lblPanelName"; - this.lblPanelName.Size = new System.Drawing.Size(66, 13); + this.lblPanelName.Size = new System.Drawing.Size(69, 13); this.lblPanelName.TabIndex = 9; this.lblPanelName.Text = "Panel name:"; // @@ -162,6 +162,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.chkShowLogonInfoOnTabs); this.Controls.Add(this.chkDoubleClickClosesTab); this.Controls.Add(this.chkShowProtocolOnTabs); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "TabsPanelsPage"; this.Size = new System.Drawing.Size(610, 490); this.ResumeLayout(false); diff --git a/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.resx b/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/TabsPanelsPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.Designer.cs index f83434737..4c969da84 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.Designer.cs @@ -33,7 +33,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.btnThemeDelete = new mRemoteNG.UI.Controls.Base.NGButton(); this.btnThemeNew = new mRemoteNG.UI.Controls.Base.NGButton(); this.cboTheme = new mRemoteNG.UI.Controls.Base.NGComboBox(); - this.themeEnableCombo = new mRemoteNG.UI.Controls.Base.NGCheckBox(); + this.themeEnableChk = new mRemoteNG.UI.Controls.Base.NGCheckBox(); this.listPalette = new mRemoteNG.UI.Controls.Base.NGListView(); this.keyCol = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.ColorCol = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); @@ -84,18 +84,19 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.cboTheme.TabIndex = 0; this.cboTheme.SelectionChangeCommitted += new System.EventHandler(this.cboTheme_SelectionChangeCommitted); // - // themeEnableCombo + // themeEnableChk // - this.themeEnableCombo._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; - this.themeEnableCombo.AutoSize = true; - this.themeEnableCombo.Dock = System.Windows.Forms.DockStyle.Fill; - this.themeEnableCombo.Location = new System.Drawing.Point(3, 3); - this.themeEnableCombo.Name = "themeEnableCombo"; - this.themeEnableCombo.Size = new System.Drawing.Size(175, 22); - this.themeEnableCombo.TabIndex = 5; - this.themeEnableCombo.Text = "Enable Themes"; - this.themeEnableCombo.UseVisualStyleBackColor = true; - this.themeEnableCombo.CheckedChanged += new System.EventHandler(this.themeEnableCombo_CheckedChanged); + this.themeEnableChk._mice = mRemoteNG.UI.Controls.Base.NGCheckBox.MouseState.HOVER; + this.themeEnableChk.AutoSize = true; + this.themeEnableChk.Dock = System.Windows.Forms.DockStyle.Fill; + this.themeEnableChk.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.themeEnableChk.Location = new System.Drawing.Point(3, 3); + this.themeEnableChk.Name = "themeEnableChk"; + this.themeEnableChk.Size = new System.Drawing.Size(140, 22); + this.themeEnableChk.TabIndex = 5; + this.themeEnableChk.Text = "Enable Themes"; + this.themeEnableChk.UseVisualStyleBackColor = true; + this.themeEnableChk.CheckedChanged += new System.EventHandler(this.ThemeEnableChkCheckedChanged); // // listPalette // @@ -143,9 +144,9 @@ namespace mRemoteNG.UI.Forms.OptionsPages // this.labelRestart.AutoSize = true; this.labelRestart.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelRestart.Location = new System.Drawing.Point(184, 0); + this.labelRestart.Location = new System.Drawing.Point(149, 0); this.labelRestart.Name = "labelRestart"; - this.labelRestart.Size = new System.Drawing.Size(417, 28); + this.labelRestart.Size = new System.Drawing.Size(452, 28); this.labelRestart.TabIndex = 4; this.labelRestart.Text = "Warning: Restart is required to disable the themes or to completely apply a new o" + "ne"; @@ -171,10 +172,10 @@ namespace mRemoteNG.UI.Forms.OptionsPages // tableLayoutPanel2 // this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 24.33775F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75.66225F)); this.tableLayoutPanel2.Controls.Add(this.labelRestart, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.themeEnableCombo, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.themeEnableChk, 0, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 459); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; @@ -206,6 +207,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.Controls.Add(this.tlpMain); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "ThemePage"; this.Size = new System.Drawing.Size(610, 490); ((System.ComponentModel.ISupportInitialize)(this.listPalette)).EndInit(); @@ -219,7 +221,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages internal Controls.Base.NGButton btnThemeDelete; internal Controls.Base.NGButton btnThemeNew; internal Controls.Base.NGComboBox cboTheme; - private Controls.Base.NGCheckBox themeEnableCombo; + private Controls.Base.NGCheckBox themeEnableChk; private Controls.Base.NGListView listPalette; private Controls.Base.NGLabel labelRestart; private BrightIdeasSoftware.OLVColumn keyCol; diff --git a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs index b26c59c77..0f584ce27 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.cs @@ -3,7 +3,6 @@ using System.Windows.Forms; using mRemoteNG.Themes; using System.Linq; using System.Collections.Generic; -using System.Drawing; using BrightIdeasSoftware; using mRemoteNG.UI.Forms.Input; @@ -13,10 +12,10 @@ namespace mRemoteNG.UI.Forms.OptionsPages { #region Private Fields - private ThemeManager _themeManager; - private ThemeInfo _oriTheme; - private bool _oriActiveTheming; - List modifiedThemes = new List(); + private readonly ThemeManager _themeManager; + private readonly ThemeInfo _oriTheme; + private readonly bool _oriActiveTheming; + private readonly List modifiedThemes = new List(); #endregion public ThemePage() @@ -44,7 +43,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages btnThemeDelete.Text = Language.strOptionsThemeButtonDelete; btnThemeNew.Text = Language.strOptionsThemeButtonNew; labelRestart.Text = Language.strOptionsThemeThemeChaangeWarning; - themeEnableCombo.Text = Language.strOptionsThemeEnableTheming; + themeEnableChk.Text = Language.strOptionsThemeEnableTheming; } private new void ApplyTheme() @@ -56,6 +55,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages public override void LoadSettings() { + themeEnableChk.CheckedChanged -= ThemeEnableChkCheckedChanged; base.SaveSettings(); //At first we cannot create or delete themes, depends later on the type of selected theme btnThemeNew.Enabled = false; @@ -72,15 +72,16 @@ namespace mRemoteNG.UI.Forms.OptionsPages //Load theming active property and disable controls if (_themeManager.ThemingActive) { - themeEnableCombo.Checked = true; + themeEnableChk.Checked = true; } else { - themeEnableCombo.Checked = false; + themeEnableChk.Checked = false; cboTheme.Enabled = false; // reset to the default theme when disabling theme support _themeManager.ActiveTheme = _themeManager.DefaultTheme; } + themeEnableChk.CheckedChanged += ThemeEnableChkCheckedChanged; } private void ListPalette_FormatCell(object sender, FormatCellEventArgs e) @@ -172,21 +173,19 @@ namespace mRemoteNG.UI.Forms.OptionsPages private void btnThemeNew_Click(object sender, EventArgs e) { var name = _themeManager.ActiveTheme.Name; - using (FrmInputBox frmInputBox = new FrmInputBox(Language.strOptionsThemeNewThemeCaption, Language.strOptionsThemeNewThemeText, ref name)) + using (var frmInputBox = new FrmInputBox(Language.strOptionsThemeNewThemeCaption, Language.strOptionsThemeNewThemeText, ref name)) { - DialogResult dr = frmInputBox.ShowDialog(); - if (dr == DialogResult.OK) + var dr = frmInputBox.ShowDialog(); + if (dr != DialogResult.OK) return; + if (_themeManager.isThemeNameOk(frmInputBox.returnValue)) { - if (_themeManager.isThemeNameOk(frmInputBox.returnValue)) - { - var addedTheme = _themeManager.addTheme(_themeManager.ActiveTheme, frmInputBox.returnValue); - _themeManager.ActiveTheme = addedTheme; - LoadSettings(); - } - else - { - TaskDialog.CTaskDialog.ShowTaskDialogBox(this, Language.strErrors, Language.strOptionsThemeNewThemeError, "", "", "", "", "", "", TaskDialog.ETaskDialogButtons.Ok, TaskDialog.ESysIcons.Error, TaskDialog.ESysIcons.Information, 0); - } + var addedTheme = _themeManager.addTheme(_themeManager.ActiveTheme, frmInputBox.returnValue); + _themeManager.ActiveTheme = addedTheme; + LoadSettings(); + } + else + { + TaskDialog.CTaskDialog.ShowTaskDialogBox(this, Language.strErrors, Language.strOptionsThemeNewThemeError, "", "", "", "", "", "", TaskDialog.ETaskDialogButtons.Ok, TaskDialog.ESysIcons.Error, TaskDialog.ESysIcons.Information, 0); } } } @@ -207,26 +206,28 @@ namespace mRemoteNG.UI.Forms.OptionsPages #endregion - private void themeEnableCombo_CheckedChanged(object sender, EventArgs e) + private void ThemeEnableChkCheckedChanged(object sender, EventArgs e) { - if (themeEnableCombo.Checked) + if (themeEnableChk.Checked) { - _themeManager.ThemingActive = true; - if(_themeManager.ThemingActive) + + if(_themeManager.ThemesCount > 0) { - themeEnableCombo.Checked = true; + _themeManager.ThemingActive = true; cboTheme.Enabled = true; } else { TaskDialog.CTaskDialog.ShowTaskDialogBox(this, Language.strErrors, Language.strOptionsThemeErrorNoThemes, "", "", "", "", "", "", TaskDialog.ETaskDialogButtons.Ok, TaskDialog.ESysIcons.Error, TaskDialog.ESysIcons.Information, 0); - themeEnableCombo.Checked = false; + themeEnableChk.Checked = false; + _themeManager.ThemingActive = false; + cboTheme.Enabled = false; } } else { _themeManager.ThemingActive = false; - themeEnableCombo.Checked = false; + themeEnableChk.Checked = false; cboTheme.Enabled = false; } LoadSettings(); diff --git a/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/ThemePage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.Designer.cs b/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.Designer.cs index 92f08880c..35fd5e2fb 100644 --- a/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.Designer.cs +++ b/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.Designer.cs @@ -96,7 +96,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkCheckForUpdatesOnStartup.AutoSize = true; this.chkCheckForUpdatesOnStartup.Location = new System.Drawing.Point(3, 4); this.chkCheckForUpdatesOnStartup.Name = "chkCheckForUpdatesOnStartup"; - this.chkCheckForUpdatesOnStartup.Size = new System.Drawing.Size(113, 17); + this.chkCheckForUpdatesOnStartup.Size = new System.Drawing.Size(120, 17); this.chkCheckForUpdatesOnStartup.TabIndex = 0; this.chkCheckForUpdatesOnStartup.Text = "Check for updates"; this.chkCheckForUpdatesOnStartup.UseVisualStyleBackColor = true; @@ -132,7 +132,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.lblReleaseChannel.Location = new System.Drawing.Point(0, 3); this.lblReleaseChannel.Margin = new System.Windows.Forms.Padding(3); this.lblReleaseChannel.Name = "lblReleaseChannel"; - this.lblReleaseChannel.Size = new System.Drawing.Size(91, 13); + this.lblReleaseChannel.Size = new System.Drawing.Size(95, 13); this.lblReleaseChannel.TabIndex = 0; this.lblReleaseChannel.Text = "Release Channel:"; // @@ -184,7 +184,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtProxyAddress.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtProxyAddress.Location = new System.Drawing.Point(110, 4); this.txtProxyAddress.Name = "txtProxyAddress"; - this.txtProxyAddress.Size = new System.Drawing.Size(240, 20); + this.txtProxyAddress.Size = new System.Drawing.Size(240, 22); this.txtProxyAddress.TabIndex = 1; // // lblProxyPort @@ -211,7 +211,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages 0, 0}); this.numProxyPort.Name = "numProxyPort"; - this.numProxyPort.Size = new System.Drawing.Size(64, 20); + this.numProxyPort.Size = new System.Drawing.Size(64, 22); this.numProxyPort.TabIndex = 3; this.numProxyPort.Value = new decimal(new int[] { 80, @@ -225,7 +225,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkUseProxyForAutomaticUpdates.AutoSize = true; this.chkUseProxyForAutomaticUpdates.Location = new System.Drawing.Point(6, 0); this.chkUseProxyForAutomaticUpdates.Name = "chkUseProxyForAutomaticUpdates"; - this.chkUseProxyForAutomaticUpdates.Size = new System.Drawing.Size(168, 17); + this.chkUseProxyForAutomaticUpdates.Size = new System.Drawing.Size(176, 17); this.chkUseProxyForAutomaticUpdates.TabIndex = 0; this.chkUseProxyForAutomaticUpdates.Text = "Use a proxy server to connect"; this.chkUseProxyForAutomaticUpdates.UseVisualStyleBackColor = true; @@ -238,7 +238,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.chkUseProxyAuthentication.Enabled = false; this.chkUseProxyAuthentication.Location = new System.Drawing.Point(27, 70); this.chkUseProxyAuthentication.Name = "chkUseProxyAuthentication"; - this.chkUseProxyAuthentication.Size = new System.Drawing.Size(216, 17); + this.chkUseProxyAuthentication.Size = new System.Drawing.Size(234, 17); this.chkUseProxyAuthentication.TabIndex = 2; this.chkUseProxyAuthentication.Text = "This proxy server requires authentication"; this.chkUseProxyAuthentication.UseVisualStyleBackColor = true; @@ -270,7 +270,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtProxyUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtProxyUsername.Location = new System.Drawing.Point(110, 4); this.txtProxyUsername.Name = "txtProxyUsername"; - this.txtProxyUsername.Size = new System.Drawing.Size(240, 20); + this.txtProxyUsername.Size = new System.Drawing.Size(240, 22); this.txtProxyUsername.TabIndex = 1; // // lblProxyPassword @@ -287,7 +287,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.txtProxyPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtProxyPassword.Location = new System.Drawing.Point(110, 30); this.txtProxyPassword.Name = "txtProxyPassword"; - this.txtProxyPassword.Size = new System.Drawing.Size(240, 20); + this.txtProxyPassword.Size = new System.Drawing.Size(240, 22); this.txtProxyPassword.TabIndex = 3; this.txtProxyPassword.UseSystemPasswordChar = true; // @@ -320,6 +320,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages this.Controls.Add(this.lblUpdatesExplanation); this.Controls.Add(this.pnlUpdateCheck); this.Controls.Add(this.pnlProxy); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "UpdatesPage"; this.Size = new System.Drawing.Size(610, 490); this.pnlUpdateCheck.ResumeLayout(false); diff --git a/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.resx b/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/OptionsPages/UpdatesPage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/PasswordForm.Designer.cs b/mRemoteV1/UI/Forms/PasswordForm.Designer.cs index d1786f4bb..4f5a270ad 100644 --- a/mRemoteV1/UI/Forms/PasswordForm.Designer.cs +++ b/mRemoteV1/UI/Forms/PasswordForm.Designer.cs @@ -48,18 +48,18 @@ namespace mRemoteNG.UI.Forms // lblPassword // this.lblPassword.AutoSize = true; - this.lblPassword.Location = new System.Drawing.Point(73, 10); + this.lblPassword.Location = new System.Drawing.Point(73, 9); this.lblPassword.Name = "lblPassword"; - this.lblPassword.Size = new System.Drawing.Size(56, 13); + this.lblPassword.Size = new System.Drawing.Size(59, 13); this.lblPassword.TabIndex = 1; this.lblPassword.Text = "Password:"; // // lblVerify // this.lblVerify.AutoSize = true; - this.lblVerify.Location = new System.Drawing.Point(73, 49); + this.lblVerify.Location = new System.Drawing.Point(73, 50); this.lblVerify.Name = "lblVerify"; - this.lblVerify.Size = new System.Drawing.Size(36, 13); + this.lblVerify.Size = new System.Drawing.Size(38, 13); this.lblVerify.TabIndex = 3; this.lblVerify.Text = "Verify:"; // @@ -67,7 +67,7 @@ namespace mRemoteNG.UI.Forms // this.btnOK._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOK.Location = new System.Drawing.Point(219, 128); + this.btnOK.Location = new System.Drawing.Point(215, 124); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 7; @@ -80,7 +80,7 @@ namespace mRemoteNG.UI.Forms this.btnCancel._mice = mRemoteNG.UI.Controls.Base.NGButton.MouseState.HOVER; this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(300, 128); + this.btnCancel.Location = new System.Drawing.Point(296, 124); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 6; @@ -94,9 +94,9 @@ namespace mRemoteNG.UI.Forms | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.SetColumnSpan(this.lblStatus, 2); this.lblStatus.ForeColor = System.Drawing.Color.Red; - this.lblStatus.Location = new System.Drawing.Point(73, 88); + this.lblStatus.Location = new System.Drawing.Point(73, 91); this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(302, 13); + this.lblStatus.Size = new System.Drawing.Size(298, 13); this.lblStatus.TabIndex = 5; this.lblStatus.Text = "Status"; this.lblStatus.TextAlign = System.Drawing.ContentAlignment.TopRight; @@ -105,7 +105,7 @@ namespace mRemoteNG.UI.Forms // pbLock // this.pbLock.Image = global::mRemoteNG.Resources.Lock; - this.pbLock.Location = new System.Drawing.Point(3, 13); + this.pbLock.Location = new System.Drawing.Point(3, 12); this.pbLock.Name = "pbLock"; this.tableLayoutPanel1.SetRowSpan(this.pbLock, 6); this.pbLock.Size = new System.Drawing.Size(64, 64); @@ -118,10 +118,10 @@ namespace mRemoteNG.UI.Forms this.txtVerify.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.SetColumnSpan(this.txtVerify, 2); - this.txtVerify.Location = new System.Drawing.Point(73, 65); + this.txtVerify.Location = new System.Drawing.Point(73, 66); this.txtVerify.Name = "txtVerify"; this.txtVerify.SelectAllOnFocus = true; - this.txtVerify.Size = new System.Drawing.Size(302, 20); + this.txtVerify.Size = new System.Drawing.Size(298, 22); this.txtVerify.TabIndex = 4; this.txtVerify.UseSystemPasswordChar = true; this.txtVerify.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); @@ -131,10 +131,10 @@ namespace mRemoteNG.UI.Forms this.txtPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.SetColumnSpan(this.txtPassword, 2); - this.txtPassword.Location = new System.Drawing.Point(73, 26); + this.txtPassword.Location = new System.Drawing.Point(73, 25); this.txtPassword.Name = "txtPassword"; this.txtPassword.SelectAllOnFocus = true; - this.txtPassword.Size = new System.Drawing.Size(302, 20); + this.txtPassword.Size = new System.Drawing.Size(298, 22); this.txtPassword.TabIndex = 2; this.txtPassword.UseSystemPasswordChar = true; this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged); @@ -164,7 +164,7 @@ namespace mRemoteNG.UI.Forms this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 83.33334F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(378, 154); + this.tableLayoutPanel1.Size = new System.Drawing.Size(374, 150); this.tableLayoutPanel1.TabIndex = 8; // // PasswordForm @@ -173,9 +173,10 @@ namespace mRemoteNG.UI.Forms this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(378, 154); + this.ClientSize = new System.Drawing.Size(374, 150); this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/mRemoteV1/UI/Forms/PasswordForm.cs b/mRemoteV1/UI/Forms/PasswordForm.cs index 9fbbabfa2..33b05d270 100644 --- a/mRemoteV1/UI/Forms/PasswordForm.cs +++ b/mRemoteV1/UI/Forms/PasswordForm.cs @@ -98,7 +98,8 @@ namespace mRemoteNG.UI.Forms btnOK.Text = Language.strButtonOK; } - private bool VerifyNewPassword() + // ReSharper disable once UnusedMethodReturnValue.Local + private bool VerifyNewPassword() { if (txtPassword.Text.Length >= 3) { diff --git a/mRemoteV1/UI/Forms/TextBox.cs b/mRemoteV1/UI/Forms/TextBox.cs index 2d191ce2e..38b238d64 100644 --- a/mRemoteV1/UI/Forms/TextBox.cs +++ b/mRemoteV1/UI/Forms/TextBox.cs @@ -13,28 +13,20 @@ namespace mRemoteNG.UI.Forms DefaultValue(false)]private bool _SelectAllOnFocus; public bool SelectAllOnFocus { - get - { - return _SelectAllOnFocus; - } - set - { - _SelectAllOnFocus = value; - } - } + get => _SelectAllOnFocus; + set => _SelectAllOnFocus = value; + } #endregion #region Protected Methods protected override void OnEnter(EventArgs e) { base.OnEnter(e); - - if (MouseButtons == MouseButtons.None) - { - SelectAll(); - _focusHandled = true; - } - } + + if (MouseButtons != MouseButtons.None) return; + SelectAll(); + _focusHandled = true; + } protected override void OnLeave(EventArgs e) { @@ -46,20 +38,29 @@ namespace mRemoteNG.UI.Forms protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); - - if (!_focusHandled) - { - if (SelectionLength == 0) - { - SelectAll(); - } - _focusHandled = true; - } - } + + if (_focusHandled) return; + if (SelectionLength == 0) + { + SelectAll(); + } + _focusHandled = true; + } #endregion #region Private Fields private bool _focusHandled; #endregion - } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // TextBox + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + + } + } } \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/TextBox.resx b/mRemoteV1/UI/Forms/TextBox.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/Forms/TextBox.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/UnhandledExceptionWindow.Designer.cs b/mRemoteV1/UI/Forms/UnhandledExceptionWindow.Designer.cs index 11d3f0dd3..ea19d834b 100644 --- a/mRemoteV1/UI/Forms/UnhandledExceptionWindow.Designer.cs +++ b/mRemoteV1/UI/Forms/UnhandledExceptionWindow.Designer.cs @@ -66,7 +66,7 @@ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 80F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(534, 311); + this.tableLayoutPanel1.Size = new System.Drawing.Size(534, 334); this.tableLayoutPanel1.TabIndex = 0; // // labelExceptionCaught @@ -84,9 +84,9 @@ // this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonClose.Dock = System.Windows.Forms.DockStyle.Right; - this.buttonClose.Location = new System.Drawing.Point(427, 284); + this.buttonClose.Location = new System.Drawing.Point(427, 306); this.buttonClose.Name = "buttonClose"; - this.buttonClose.Size = new System.Drawing.Size(74, 24); + this.buttonClose.Size = new System.Drawing.Size(74, 25); this.buttonClose.TabIndex = 1; this.buttonClose.Text = "Close"; this.buttonClose.UseVisualStyleBackColor = true; @@ -96,19 +96,19 @@ // this.tableLayoutPanel1.SetColumnSpan(this.textBoxStackTrace, 2); this.textBoxStackTrace.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxStackTrace.Location = new System.Drawing.Point(33, 128); + this.textBoxStackTrace.Location = new System.Drawing.Point(33, 132); this.textBoxStackTrace.Multiline = true; this.textBoxStackTrace.Name = "textBoxStackTrace"; this.textBoxStackTrace.ReadOnly = true; this.textBoxStackTrace.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBoxStackTrace.Size = new System.Drawing.Size(468, 150); + this.textBoxStackTrace.Size = new System.Drawing.Size(468, 168); this.textBoxStackTrace.TabIndex = 0; // // labelStackTraceHeader // this.labelStackTraceHeader.AutoSize = true; this.labelStackTraceHeader.Dock = System.Windows.Forms.DockStyle.Bottom; - this.labelStackTraceHeader.Location = new System.Drawing.Point(33, 112); + this.labelStackTraceHeader.Location = new System.Drawing.Point(33, 116); this.labelStackTraceHeader.Name = "labelStackTraceHeader"; this.labelStackTraceHeader.Size = new System.Drawing.Size(388, 13); this.labelStackTraceHeader.TabIndex = 4; @@ -133,15 +133,15 @@ this.textBoxExceptionMessage.Name = "textBoxExceptionMessage"; this.textBoxExceptionMessage.ReadOnly = true; this.textBoxExceptionMessage.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBoxExceptionMessage.Size = new System.Drawing.Size(468, 33); + this.textBoxExceptionMessage.Size = new System.Drawing.Size(468, 37); this.textBoxExceptionMessage.TabIndex = 6; // // buttonCopyAll // this.buttonCopyAll.Dock = System.Windows.Forms.DockStyle.Right; - this.buttonCopyAll.Location = new System.Drawing.Point(346, 284); + this.buttonCopyAll.Location = new System.Drawing.Point(346, 306); this.buttonCopyAll.Name = "buttonCopyAll"; - this.buttonCopyAll.Size = new System.Drawing.Size(75, 24); + this.buttonCopyAll.Size = new System.Drawing.Size(75, 25); this.buttonCopyAll.TabIndex = 7; this.buttonCopyAll.Text = "Copy All"; this.buttonCopyAll.UseVisualStyleBackColor = true; @@ -163,9 +163,10 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.CancelButton = this.buttonClose; - this.ClientSize = new System.Drawing.Size(534, 311); + this.ClientSize = new System.Drawing.Size(534, 334); this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel1); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.MinimumSize = new System.Drawing.Size(550, 350); this.Name = "UnhandledExceptionWindow"; this.ShowInTaskbar = false; diff --git a/mRemoteV1/UI/Forms/frmChoosePanel.Designer.cs b/mRemoteV1/UI/Forms/frmChoosePanel.Designer.cs index 4dc0dc30b..c7a077472 100644 --- a/mRemoteV1/UI/Forms/frmChoosePanel.Designer.cs +++ b/mRemoteV1/UI/Forms/frmChoosePanel.Designer.cs @@ -79,7 +79,7 @@ namespace mRemoteNG.UI.Forms this.btnNew.UseVisualStyleBackColor = true; this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // - // frmChoosePanel + // FrmChoosePanel // this.AcceptButton = this.btnOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -89,11 +89,12 @@ namespace mRemoteNG.UI.Forms this.Controls.Add(this.btnNew); this.Controls.Add(this.btnOK); this.Controls.Add(this.cbPanels); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = global::mRemoteNG.Resources.Panels_Icon; this.MaximizeBox = false; this.MinimizeBox = false; - this.Name = "frmChoosePanel"; + this.Name = "FrmChoosePanel"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Select Panel"; diff --git a/mRemoteV1/UI/Forms/frmChoosePanel.cs b/mRemoteV1/UI/Forms/frmChoosePanel.cs index aa98b5138..0f7f38a06 100644 --- a/mRemoteV1/UI/Forms/frmChoosePanel.cs +++ b/mRemoteV1/UI/Forms/frmChoosePanel.cs @@ -69,16 +69,14 @@ namespace mRemoteNG.UI.Forms private void btnNew_Click(object sender, System.EventArgs e) { var pnlName = Language.strNewPanel; - using (FrmInputBox frmInputBox = new FrmInputBox(Language.strNewPanel, Language.strPanelName + ":", ref pnlName)) + using (var frmInputBox = new FrmInputBox(Language.strNewPanel, Language.strPanelName + ":", ref pnlName)) { - DialogResult dr = frmInputBox.ShowDialog(); - if (dr == DialogResult.OK && !string.IsNullOrEmpty(frmInputBox.returnValue)) - { - _panelAdder.AddPanel(frmInputBox.returnValue); - AddAvailablePanels(); - cbPanels.SelectedItem = frmInputBox.returnValue; - cbPanels.Focus(); - } + var dr = frmInputBox.ShowDialog(); + if (dr != DialogResult.OK || string.IsNullOrEmpty(frmInputBox.returnValue)) return; + _panelAdder.AddPanel(frmInputBox.returnValue); + AddAvailablePanels(); + cbPanels.SelectedItem = frmInputBox.returnValue; + cbPanels.Focus(); } } diff --git a/mRemoteV1/UI/Forms/frmMain.Designer.cs b/mRemoteV1/UI/Forms/frmMain.Designer.cs index 3475af4f2..7932a4190 100644 --- a/mRemoteV1/UI/Forms/frmMain.Designer.cs +++ b/mRemoteV1/UI/Forms/frmMain.Designer.cs @@ -191,6 +191,7 @@ namespace mRemoteNG.UI.Forms this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(1129, 571); this.Controls.Add(this.tsContainer); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.msMain; this.MinimumSize = new System.Drawing.Size(400, 400); diff --git a/mRemoteV1/UI/Forms/frmOptions.Designer.cs b/mRemoteV1/UI/Forms/frmOptions.Designer.cs index 658526aa0..7371c779d 100644 --- a/mRemoteV1/UI/Forms/frmOptions.Designer.cs +++ b/mRemoteV1/UI/Forms/frmOptions.Designer.cs @@ -135,7 +135,7 @@ this.PageName.ImageAspectName = "IconImage"; this.PageName.IsEditable = false; // - // frmOptions + // FrmOptions // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; @@ -146,11 +146,12 @@ this.Controls.Add(this.lstOptionPages); this.Controls.Add(this.splitter1); this.Controls.Add(this.pnlBottom); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; - this.Name = "frmOptions"; + this.Name = "FrmOptions"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "mRemoteNG Options"; diff --git a/mRemoteV1/UI/Menu/HelpMenu.cs b/mRemoteV1/UI/Menu/HelpMenu.cs index 2fe249a68..74db6e2f5 100644 --- a/mRemoteV1/UI/Menu/HelpMenu.cs +++ b/mRemoteV1/UI/Menu/HelpMenu.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.Windows.Forms; using mRemoteNG.App; using mRemoteNG.App.Info; -using mRemoteNG.Connection; namespace mRemoteNG.UI.Menu { diff --git a/mRemoteV1/UI/Menu/MainFileMenu.cs b/mRemoteV1/UI/Menu/MainFileMenu.cs index 85e08c88c..e656e95cc 100644 --- a/mRemoteV1/UI/Menu/MainFileMenu.cs +++ b/mRemoteV1/UI/Menu/MainFileMenu.cs @@ -445,15 +445,13 @@ namespace mRemoteNG.UI.Menu if (Runtime.WindowList == null || Runtime.WindowList.Count == 0) return; foreach (BaseWindow window in Runtime.WindowList) { - var connectionWindow = window as ConnectionWindow; - if (connectionWindow == null) + if (!(window is ConnectionWindow connectionWindow)) return; var icList = new List(); foreach (Crownwood.Magic.Controls.TabPage tab in connectionWindow.TabController.TabPages) { - var tag = tab.Tag as InterfaceControl; - if (tag != null) + if (tab.Tag is InterfaceControl tag) { icList.Add(tag); } diff --git a/mRemoteV1/UI/Menu/ViewMenu.cs b/mRemoteV1/UI/Menu/ViewMenu.cs index ffc97bbf2..38b294d7b 100644 --- a/mRemoteV1/UI/Menu/ViewMenu.cs +++ b/mRemoteV1/UI/Menu/ViewMenu.cs @@ -158,8 +158,7 @@ namespace mRemoteNG.UI.Menu // _mMenViewJumpToConnectionsConfig.Image = Resources.Root; _mMenViewJumpToConnectionsConfig.Name = "mMenViewJumpToConnectionsConfig"; - _mMenViewJumpToConnectionsConfig.ShortcutKeys = ((Keys)(((Keys.Control | Keys.Alt) - | Keys.C))); + _mMenViewJumpToConnectionsConfig.ShortcutKeys = Keys.Control | Keys.Alt | Keys.C; _mMenViewJumpToConnectionsConfig.Size = new System.Drawing.Size(258, 22); _mMenViewJumpToConnectionsConfig.Text = Language.strMenuConnectionsAndConfig; _mMenViewJumpToConnectionsConfig.Click += mMenViewJumpToConnectionsConfig_Click; @@ -168,8 +167,7 @@ namespace mRemoteNG.UI.Menu // _mMenViewJumpToErrorsInfos.Image = Resources.InformationSmall; _mMenViewJumpToErrorsInfos.Name = "mMenViewJumpToErrorsInfos"; - _mMenViewJumpToErrorsInfos.ShortcutKeys = ((Keys)(((Keys.Control | Keys.Alt) - | Keys.E))); + _mMenViewJumpToErrorsInfos.ShortcutKeys = Keys.Control | Keys.Alt | Keys.E; _mMenViewJumpToErrorsInfos.Size = new System.Drawing.Size(258, 22); _mMenViewJumpToErrorsInfos.Text = Language.strMenuNotifications; _mMenViewJumpToErrorsInfos.Click += mMenViewJumpToErrorsInfos_Click; diff --git a/mRemoteV1/UI/Panels/PanelAdder.cs b/mRemoteV1/UI/Panels/PanelAdder.cs index f835275dc..238710299 100644 --- a/mRemoteV1/UI/Panels/PanelAdder.cs +++ b/mRemoteV1/UI/Panels/PanelAdder.cs @@ -97,9 +97,9 @@ namespace mRemoteNG.UI.Panels { var conW = (ConnectionWindow)((ToolStripMenuItem)sender).Tag; var nTitle = ""; - using (FrmInputBox frmInputBox = new FrmInputBox(Language.strNewTitle, Language.strNewTitle + ":", ref nTitle)) + using (var frmInputBox = new FrmInputBox(Language.strNewTitle, Language.strNewTitle + ":", ref nTitle)) { - DialogResult dr = frmInputBox.ShowDialog(); + var dr = frmInputBox.ShowDialog(); if (dr == DialogResult.OK && string.IsNullOrEmpty(frmInputBox.returnValue)) conW.SetFormText(frmInputBox.returnValue); } @@ -146,8 +146,7 @@ namespace mRemoteNG.UI.Panels if (tagEnumeration == null) return; foreach (var obj in tagEnumeration) { - var screen1 = obj as Screen; - if (screen1 != null) + if (obj is Screen screen1) { screen = screen1; } diff --git a/mRemoteV1/UI/TaskDialog/CommandButton.designer.cs b/mRemoteV1/UI/TaskDialog/CommandButton.designer.cs index ea110afba..6aa327f75 100644 --- a/mRemoteV1/UI/TaskDialog/CommandButton.designer.cs +++ b/mRemoteV1/UI/TaskDialog/CommandButton.designer.cs @@ -28,7 +28,13 @@ namespace mRemoteNG.UI.TaskDialog /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // CommandButton + // + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/TaskDialog/CommandButton.resx b/mRemoteV1/UI/TaskDialog/CommandButton.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/mRemoteV1/UI/TaskDialog/CommandButton.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/mRemoteV1/UI/TaskDialog/frmTaskDialog.cs b/mRemoteV1/UI/TaskDialog/frmTaskDialog.cs index ce31a7b6f..65096087c 100644 --- a/mRemoteV1/UI/TaskDialog/frmTaskDialog.cs +++ b/mRemoteV1/UI/TaskDialog/frmTaskDialog.cs @@ -32,11 +32,20 @@ namespace mRemoteNG.UI.TaskDialog public ESysIcons MainIcon { get; set; } = ESysIcons.Question; public ESysIcons FooterIcon { get; set; } = ESysIcons.Warning; - public string Title { get { return Text; } set { Text = value; } } - public string MainInstruction { get { return _mainInstruction; } set { _mainInstruction = value; Invalidate(); } } - public string Content { get { return lbContent.Text; } set { lbContent.Text = value; } } - public string ExpandedInfo { get { return lbExpandedInfo.Text; } set { lbExpandedInfo.Text = value; } } - public string Footer { get { return lbFooter.Text; } set { lbFooter.Text = value; } } + public string Title { get => Text; + set => Text = value; + } + public string MainInstruction { get => _mainInstruction; + set { _mainInstruction = value; Invalidate(); } } + public string Content { get => lbContent.Text; + set => lbContent.Text = value; + } + public string ExpandedInfo { get => lbExpandedInfo.Text; + set => lbExpandedInfo.Text = value; + } + public string Footer { get => lbFooter.Text; + set => lbFooter.Text = value; + } public int DefaultButtonIndex { get; set; } public string RadioButtons { get; set; } = ""; @@ -57,8 +66,12 @@ namespace mRemoteNG.UI.TaskDialog public ETaskDialogButtons Buttons { get; set; } = ETaskDialogButtons.YesNoCancel; - public string VerificationText { get { return cbVerify.Text; } set { cbVerify.Text = value; } } - public bool VerificationCheckBoxChecked { get { return cbVerify.Checked; } set { cbVerify.Checked = value; } } + public string VerificationText { get => cbVerify.Text; + set => cbVerify.Text = value; + } + public bool VerificationCheckBoxChecked { get => cbVerify.Checked; + set => cbVerify.Checked = value; + } private bool Expanded { get; set; } @@ -123,7 +136,7 @@ namespace mRemoteNG.UI.TaskDialog formHeight += pnlMainInstruction.Height; // Setup Content - pnlContent.Visible = (Content != ""); + pnlContent.Visible = Content != ""; if (Content != "") { AdjustLabelHeight(lbContent); @@ -131,7 +144,7 @@ namespace mRemoteNG.UI.TaskDialog formHeight += pnlContent.Height; } - var showVerifyCheckbox = (cbVerify.Text != ""); + var showVerifyCheckbox = cbVerify.Text != ""; cbVerify.Visible = showVerifyCheckbox; // Setup Expanded Info and Buttons panels @@ -147,8 +160,8 @@ namespace mRemoteNG.UI.TaskDialog AdjustLabelHeight(lbExpandedInfo); pnlExpandedInfo.Height = lbExpandedInfo.Height + _display.ScaleHeight(4); pnlExpandedInfo.Visible = Expanded; - lbShowHideDetails.Text = (Expanded ? " Hide details" : " Show details"); - lbShowHideDetails.ImageIndex = (Expanded ? 0 : 3); + lbShowHideDetails.Text = Expanded ? " Hide details" : " Show details"; + lbShowHideDetails.ImageIndex = Expanded ? 0 : 3; if (!showVerifyCheckbox) pnlButtons.Height = _display.ScaleHeight(40); if (Expanded) @@ -156,19 +169,18 @@ namespace mRemoteNG.UI.TaskDialog } // Setup RadioButtons - pnlRadioButtons.Visible = (RadioButtons != ""); + pnlRadioButtons.Visible = RadioButtons != ""; if (RadioButtons != "") { var arr = RadioButtons.Split('|'); var pnlHeight = _display.ScaleHeight(12); for (var i = 0; i < arr.Length; i++) { - var rb = new NGRadioButton(); - rb.Parent = pnlRadioButtons; - rb.Location = new Point(_display.ScaleWidth(60), _display.ScaleHeight(4) + (i * rb.Height)); + var rb = new NGRadioButton {Parent = pnlRadioButtons}; + rb.Location = new Point(_display.ScaleWidth(60), _display.ScaleHeight(4) + i * rb.Height); rb.Text = arr[i]; rb.Tag = i; - rb.Checked = (DefaultButtonIndex == i); + rb.Checked = DefaultButtonIndex == i; rb.Width = Width - rb.Left - _display.ScaleWidth(15); pnlHeight += rb.Height; _radioButtonCtrls.Add(rb); @@ -178,7 +190,7 @@ namespace mRemoteNG.UI.TaskDialog } // Setup CommandButtons - pnlCommandButtons.Visible = (CommandButtons != ""); + pnlCommandButtons.Visible = CommandButtons != ""; if (CommandButtons != "") { var arr = CommandButtons.Split('|'); @@ -186,9 +198,10 @@ namespace mRemoteNG.UI.TaskDialog var pnlHeight = _display.ScaleHeight(16); for (var i = 0; i < arr.Length; i++) { - var btn = new CommandButton(); - btn.Parent = pnlCommandButtons; - btn.Location = new Point(_display.ScaleWidth(50), t); + var btn = new CommandButton + { + Parent = pnlCommandButtons, Location = new Point(_display.ScaleWidth(50), t) + }; if (_isVista) // <- tweak font if vista btn.Font = new Font(btn.Font, FontStyle.Regular); btn.Text = arr[i]; @@ -266,17 +279,17 @@ namespace mRemoteNG.UI.TaskDialog throw new ArgumentOutOfRangeException(); } - ControlBox = (Buttons == ETaskDialogButtons.Cancel || - Buttons == ETaskDialogButtons.Close || - Buttons == ETaskDialogButtons.OkCancel || - Buttons == ETaskDialogButtons.YesNoCancel); + ControlBox = Buttons == ETaskDialogButtons.Cancel || + Buttons == ETaskDialogButtons.Close || + Buttons == ETaskDialogButtons.OkCancel || + Buttons == ETaskDialogButtons.YesNoCancel; if (!showVerifyCheckbox && ExpandedInfo == "" && Buttons == ETaskDialogButtons.None) pnlButtons.Visible = false; else formHeight += pnlButtons.Height; - pnlFooter.Visible = (Footer != ""); + pnlFooter.Visible = Footer != ""; if (Footer != "") { AdjustLabelHeight(lbFooter); @@ -392,25 +405,25 @@ namespace mRemoteNG.UI.TaskDialog //-------------------------------------------------------------------------------- private void lbDetails_MouseEnter(object sender, EventArgs e) { - lbShowHideDetails.ImageIndex = (Expanded ? 1 : 4); + lbShowHideDetails.ImageIndex = Expanded ? 1 : 4; } //-------------------------------------------------------------------------------- private void lbDetails_MouseLeave(object sender, EventArgs e) { - lbShowHideDetails.ImageIndex = (Expanded ? 0 : 3); + lbShowHideDetails.ImageIndex = Expanded ? 0 : 3; } //-------------------------------------------------------------------------------- private void lbDetails_MouseUp(object sender, MouseEventArgs e) { - lbShowHideDetails.ImageIndex = (Expanded ? 1 : 4); + lbShowHideDetails.ImageIndex = Expanded ? 1 : 4; } //-------------------------------------------------------------------------------- private void lbDetails_MouseDown(object sender, MouseEventArgs e) { - lbShowHideDetails.ImageIndex = (Expanded ? 2 : 5); + lbShowHideDetails.ImageIndex = Expanded ? 2 : 5; } //-------------------------------------------------------------------------------- @@ -418,7 +431,7 @@ namespace mRemoteNG.UI.TaskDialog { Expanded = !Expanded; pnlExpandedInfo.Visible = Expanded; - lbShowHideDetails.Text = (Expanded ? " Hide details" : " Show details"); + lbShowHideDetails.Text = Expanded ? " Hide details" : " Show details"; if (Expanded) Height += pnlExpandedInfo.Height; else diff --git a/mRemoteV1/UI/Window/BaseWindow.cs b/mRemoteV1/UI/Window/BaseWindow.cs index fdf19d9dd..877456ebd 100644 --- a/mRemoteV1/UI/Window/BaseWindow.cs +++ b/mRemoteV1/UI/Window/BaseWindow.cs @@ -29,7 +29,7 @@ namespace mRemoteNG.UI.Window } #endregion - internal new void ApplyTheme() + internal void ApplyTheme() { _themeManager = ThemeManager.getInstance(); if (!_themeManager.ThemingActive) return; @@ -37,21 +37,34 @@ namespace mRemoteNG.UI.Window ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground"); } - + #region Private Methods -/* - private void Base_Load(object sender, EventArgs e) - { - FrmMain.Default.ShowHidePanelTabs(); - } -*/ - -/* - private void Base_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) - { - FrmMain.Default.ShowHidePanelTabs(this); - } -*/ + /* + private void Base_Load(object sender, EventArgs e) + { + FrmMain.Default.ShowHidePanelTabs(); + } + */ + + /* + private void Base_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) + { + FrmMain.Default.ShowHidePanelTabs(this); + } + */ #endregion - } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // BaseWindow + // + this.ClientSize = new System.Drawing.Size(284, 261); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "BaseWindow"; + this.ResumeLayout(false); + + } + } } \ No newline at end of file diff --git a/mRemoteV1/UI/Window/BaseWindow.resx b/mRemoteV1/UI/Window/BaseWindow.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Window/BaseWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/Window/ComponentsCheckWindow.cs b/mRemoteV1/UI/Window/ComponentsCheckWindow.cs index 43c7efa78..9e70cde86 100644 --- a/mRemoteV1/UI/Window/ComponentsCheckWindow.cs +++ b/mRemoteV1/UI/Window/ComponentsCheckWindow.cs @@ -344,7 +344,7 @@ namespace mRemoteNG.UI.Window this.chkAlwaysShow.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.chkAlwaysShow.Location = new System.Drawing.Point(12, 814); this.chkAlwaysShow.Name = "chkAlwaysShow"; - this.chkAlwaysShow.Size = new System.Drawing.Size(185, 17); + this.chkAlwaysShow.Size = new System.Drawing.Size(200, 17); this.chkAlwaysShow.TabIndex = 51; this.chkAlwaysShow.Text = "Always show this screen at startup"; this.chkAlwaysShow.UseVisualStyleBackColor = true; @@ -374,6 +374,7 @@ namespace mRemoteNG.UI.Window this.Controls.Add(this.pnlChecks); this.Controls.Add(this.chkAlwaysShow); this.Controls.Add(this.btnCheckAgain); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::mRemoteNG.Resources.ComponentsCheck_Icon; this.Name = "ComponentsCheckWindow"; this.TabText = "Components Check"; diff --git a/mRemoteV1/UI/Window/ConfigWindow.cs b/mRemoteV1/UI/Window/ConfigWindow.cs index 73c62cb8d..34f84a5a9 100644 --- a/mRemoteV1/UI/Window/ConfigWindow.cs +++ b/mRemoteV1/UI/Window/ConfigWindow.cs @@ -46,7 +46,7 @@ namespace mRemoteNG.UI.Window private AbstractConnectionRecord _selectedTreeNode; public AbstractConnectionRecord SelectedTreeNode { - get { return _selectedTreeNode; } + get => _selectedTreeNode; set { _selectedTreeNode = value; @@ -207,11 +207,8 @@ namespace mRemoteNG.UI.Window #region Public Properties public bool PropertiesVisible { - get - { - return _btnShowProperties.Checked; - } - set + get => _btnShowProperties.Checked; + set { _btnShowProperties.Checked = value; if (!value) return; @@ -223,11 +220,8 @@ namespace mRemoteNG.UI.Window public bool InheritanceVisible { - get - { - return _btnShowInheritance.Checked; - } - set + get => _btnShowInheritance.Checked; + set { _btnShowInheritance.Checked = value; if (!value) return; @@ -239,11 +233,8 @@ namespace mRemoteNG.UI.Window public bool DefaultPropertiesVisible { - get - { - return _btnShowDefaultProperties.Checked; - } - set + get => _btnShowDefaultProperties.Checked; + set { _btnShowDefaultProperties.Checked = value; if (!value) return; @@ -255,8 +246,8 @@ namespace mRemoteNG.UI.Window public bool DefaultInheritanceVisible { - get { return _btnShowDefaultInheritance.Checked; } - set + get => _btnShowDefaultInheritance.Checked; + set { _btnShowDefaultInheritance.Checked = value; if (!value) return; @@ -432,14 +423,11 @@ namespace mRemoteNG.UI.Window _btnIcon.Image = null; - var gridObjectAsConnectionInfo = propertyGridObject as ConnectionInfo; - if (gridObjectAsConnectionInfo != null) //CONNECTION INFO + if (propertyGridObject is ConnectionInfo gridObjectAsConnectionInfo) //CONNECTION INFO { - var gridObjectAsContainerInfo = propertyGridObject as ContainerInfo; - if (gridObjectAsContainerInfo != null) //CONTAINER + if (propertyGridObject is ContainerInfo gridObjectAsContainerInfo) //CONTAINER { - var gridObjectAsRootNodeInfo = propertyGridObject as RootNodeInfo; - if (gridObjectAsRootNodeInfo != null) // ROOT + if (propertyGridObject is RootNodeInfo gridObjectAsRootNodeInfo) // ROOT { // ReSharper disable once SwitchStatementMissingSomeCases switch (gridObjectAsRootNodeInfo.Type) @@ -617,20 +605,18 @@ namespace mRemoteNG.UI.Window private new void ApplyTheme() { - if (Themes.ThemeManager.getInstance().ThemingActive) - { - _pGrid.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background"); - _pGrid.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground"); - _pGrid.ViewBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Background"); - _pGrid.ViewForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Foreground"); - _pGrid.LineColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Border"); - _pGrid.HelpBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background"); - _pGrid.HelpForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground"); - _pGrid.CategoryForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Foreground"); - _pGrid.CommandsDisabledLinkColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Foreground"); - _pGrid.CommandsBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Background"); - _pGrid.CommandsForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Foreground"); - } + if (!ThemeManager.getInstance().ThemingActive) return; + _pGrid.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background"); + _pGrid.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground"); + _pGrid.ViewBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Background"); + _pGrid.ViewForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Foreground"); + _pGrid.LineColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Border"); + _pGrid.HelpBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background"); + _pGrid.HelpForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground"); + _pGrid.CategoryForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Foreground"); + _pGrid.CommandsDisabledLinkColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Foreground"); + _pGrid.CommandsBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Background"); + _pGrid.CommandsForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Disabled_Foreground"); } private void AddToolStripItems() @@ -716,8 +702,7 @@ namespace mRemoteNG.UI.Window private void UpdateConnectionInfoNode(PropertyValueChangedEventArgs e) { Debug.WriteLine("update config"); - var selectedGridObject = _pGrid.SelectedObject as ConnectionInfo; - if (selectedGridObject == null) return; + if (!(_pGrid.SelectedObject is ConnectionInfo selectedGridObject)) return; if (e.ChangedItem.Label == Language.strPropertyNameProtocol) { selectedGridObject.SetDefaultPort(); @@ -748,8 +733,7 @@ namespace mRemoteNG.UI.Window private void UpdateRootInfoNode(PropertyValueChangedEventArgs e) { - var rootInfo = _pGrid.SelectedObject as RootNodeInfo; - if (rootInfo == null) + if (!(_pGrid.SelectedObject is RootNodeInfo rootInfo)) return; if (e.ChangedItem.PropertyDescriptor?.Name != "Password") @@ -795,8 +779,7 @@ namespace mRemoteNG.UI.Window try { var strHide = new List(); - var o = _pGrid.SelectedObject as RootNodeInfo; - if (o != null) + if (_pGrid.SelectedObject is RootNodeInfo o) { var rootInfo = o; if (rootInfo.Type == RootNodeType.PuttySessions) @@ -1446,8 +1429,7 @@ namespace mRemoteNG.UI.Window private void btnShowProperties_Click(object sender, EventArgs e) { - var o = _pGrid.SelectedObject as ConnectionInfoInheritance; - if (o != null) + if (_pGrid.SelectedObject is ConnectionInfoInheritance o) { if (_pGrid.SelectedObject is DefaultConnectionInheritance) { @@ -1623,8 +1605,7 @@ namespace mRemoteNG.UI.Window { _btnHostStatus.Image = Resources.HostStatus_Check; // To check status, ConnectionInfo must be an mRemoteNG.Connection.Info that is not a container - var info = connectionInfo as ConnectionInfo; - if (info == null) return; + if (!(connectionInfo is ConnectionInfo info)) return; if (info.IsContainer) return; _btnHostStatus.Tag = "checking"; diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index 4daaf428e..644123c43 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -59,10 +59,7 @@ namespace mRemoteNG.UI.Window private void PlaceSearchBar(bool placeSearchBarAboveConnectionTree) { - if (placeSearchBarAboveConnectionTree) - tableLayoutPanel1.Dock = DockStyle.Top; - else - tableLayoutPanel1.Dock = DockStyle.Bottom; + tableLayoutPanel1.Dock = placeSearchBarAboveConnectionTree ? DockStyle.Top : DockStyle.Bottom; } @@ -219,29 +216,32 @@ namespace mRemoteNG.UI.Window private void txtSearch_KeyDown(object sender, KeyEventArgs e) { try - { - if (e.KeyCode == Keys.Escape) - { - e.Handled = true; - olvConnections.Focus(); - } - else if (e.KeyCode == Keys.Up) - { - var match = olvConnections.NodeSearcher.PreviousMatch(); - JumpToNode(match); - e.Handled = true; - } - else if (e.KeyCode == Keys.Down) - { - var match = olvConnections.NodeSearcher.NextMatch(); - JumpToNode(match); - e.Handled = true; - } - else - { - tvConnections_KeyDown(sender, e); - } - } + { + switch (e.KeyCode) + { + case Keys.Escape: + e.Handled = true; + olvConnections.Focus(); + break; + case Keys.Up: + { + var match = olvConnections.NodeSearcher.PreviousMatch(); + JumpToNode(match); + e.Handled = true; + break; + } + case Keys.Down: + { + var match = olvConnections.NodeSearcher.NextMatch(); + JumpToNode(match); + e.Handled = true; + break; + } + default: + tvConnections_KeyDown(sender, e); + break; + } + } catch (Exception ex) { Runtime.MessageCollector.AddExceptionStackTrace("txtSearch_KeyDown (UI.Window.ConnectionTreeWindow) failed", ex); diff --git a/mRemoteV1/UI/Window/ConnectionWindow.cs b/mRemoteV1/UI/Window/ConnectionWindow.cs index 375325bde..e431aae3b 100644 --- a/mRemoteV1/UI/Window/ConnectionWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionWindow.cs @@ -19,7 +19,6 @@ using mRemoteNG.UI.Forms; using mRemoteNG.UI.Forms.Input; using mRemoteNG.UI.TaskDialog; using WeifenLuo.WinFormsUI.Docking; -using Message = System.Windows.Forms.Message; using TabControl = Crownwood.Magic.Controls.TabControl; using TabPage = Crownwood.Magic.Controls.TabPage; @@ -178,16 +177,16 @@ namespace mRemoteNG.UI.Window private new void ApplyTheme() { - if(ThemeManager.getInstance().ThemingActive) + if (!ThemeManager.getInstance().ThemingActive) return; + base.ApplyTheme(); + vsToolStripExtender = new VisualStudioToolStripExtender(components) { - base.ApplyTheme(); - this.vsToolStripExtender = new WeifenLuo.WinFormsUI.Docking.VisualStudioToolStripExtender(this.components); - vsToolStripExtender.DefaultRenderer = _toolStripProfessionalRenderer; - vsToolStripExtender.SetStyle(cmenTab, ThemeManager.getInstance().ActiveTheme.Version, ThemeManager.getInstance().ActiveTheme.Theme); - TabController.BackColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Background"); - TabController.TextColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Foreground"); - TabController.TextInactiveColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Disabled_Foreground"); - } + DefaultRenderer = _toolStripProfessionalRenderer + }; + vsToolStripExtender.SetStyle(cmenTab, ThemeManager.getInstance().ActiveTheme.Version, ThemeManager.getInstance().ActiveTheme.Theme); + TabController.BackColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Background"); + TabController.TextColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Foreground"); + TabController.TextInactiveColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Tab_Item_Disabled_Foreground"); } private bool _documentHandlersAdded; @@ -422,14 +421,7 @@ namespace mRemoteNG.UI.Window cmenTabTransferFile.Visible = true; } - if (interfaceControl.Protocol is PuttyBase) - { - cmenTabPuttySettings.Visible = true; - } - else - { - cmenTabPuttySettings.Visible = false; - } + cmenTabPuttySettings.Visible = interfaceControl.Protocol is PuttyBase; AddExternalApps(); } @@ -448,8 +440,7 @@ namespace mRemoteNG.UI.Window if (!(TabController.SelectedTab?.Tag is InterfaceControl)) return; var interfaceControl = (InterfaceControl)TabController.SelectedTab?.Tag; - var protocol = interfaceControl.Protocol as RdpProtocol; - if (protocol != null) + if (interfaceControl.Protocol is RdpProtocol protocol) { var rdp = protocol; rdp.ToggleSmartSize(); @@ -470,8 +461,7 @@ namespace mRemoteNG.UI.Window { try { - var interfaceControl = TabController.SelectedTab?.Tag as InterfaceControl; - if (interfaceControl == null) return; + if (!(TabController.SelectedTab?.Tag is InterfaceControl interfaceControl)) return; if (interfaceControl.Info.Protocol == ProtocolType.SSH1 | interfaceControl.Info.Protocol == ProtocolType.SSH2) SshTransferFile(); @@ -524,8 +514,7 @@ namespace mRemoteNG.UI.Window try { var interfaceControl = TabController.SelectedTab?.Tag as InterfaceControl; - var vnc = interfaceControl?.Protocol as ProtocolVNC; - if (vnc == null) return; + if (!(interfaceControl?.Protocol is ProtocolVNC vnc)) return; cmenTabViewOnly.Checked = !cmenTabViewOnly.Checked; vnc.ToggleViewOnly(); } @@ -618,7 +607,7 @@ namespace mRemoteNG.UI.Window } //add ext apps - foreach (ExternalTool externalTool in Runtime.ExternalToolsService.ExternalTools) + foreach (var externalTool in Runtime.ExternalToolsService.ExternalTools) { var nItem = new ToolStripMenuItem { @@ -756,8 +745,7 @@ namespace mRemoteNG.UI.Window { try { - var interfaceControl = TabController.SelectedTab?.Tag as InterfaceControl; - if (interfaceControl == null) return; + if (!(TabController.SelectedTab?.Tag is InterfaceControl interfaceControl)) return; _connectionInitiator.OpenConnection(interfaceControl.Info, ConnectionInfo.Force.DoNotJump); _ignoreChangeSelectedTabClick = false; } @@ -771,8 +759,7 @@ namespace mRemoteNG.UI.Window { try { - var interfaceControl = TabController.SelectedTab?.Tag as InterfaceControl; - if (interfaceControl == null) return; + if (!(TabController.SelectedTab?.Tag is InterfaceControl interfaceControl)) return; interfaceControl.Protocol.Close(); _connectionInitiator.OpenConnection(interfaceControl.Info, ConnectionInfo.Force.DoNotJump); } @@ -787,9 +774,9 @@ namespace mRemoteNG.UI.Window try { var title = TabController.SelectedTab.Title; - using (FrmInputBox frmInputBox = new FrmInputBox(Language.strNewTitle, Language.strNewTitle + ":", ref title)) + using (var frmInputBox = new FrmInputBox(Language.strNewTitle, Language.strNewTitle + ":", ref title)) { - DialogResult dr = frmInputBox.ShowDialog(); + var dr = frmInputBox.ShowDialog(); if (dr == DialogResult.OK && !string.IsNullOrEmpty(frmInputBox.returnValue)) TabController.SelectedTab.Title = frmInputBox.returnValue;// newTitle.Replace("&", "&&"); } @@ -812,8 +799,7 @@ namespace mRemoteNG.UI.Window public void Prot_Event_Closed(object sender) { var protocolBase = sender as ProtocolBase; - var tabPage = protocolBase?.InterfaceControl.Parent as TabPage; - if (tabPage != null) + if (protocolBase?.InterfaceControl.Parent is TabPage tabPage) CloseTab(tabPage); } #endregion diff --git a/mRemoteV1/UI/Window/ErrorAndInfoWindow.cs b/mRemoteV1/UI/Window/ErrorAndInfoWindow.cs index 4d7099f35..4b7c2f3df 100644 --- a/mRemoteV1/UI/Window/ErrorAndInfoWindow.cs +++ b/mRemoteV1/UI/Window/ErrorAndInfoWindow.cs @@ -9,6 +9,7 @@ using mRemoteNG.App; using mRemoteNG.Messages; using mRemoteNG.UI.Forms; using mRemoteNG.Themes; +using Message = mRemoteNG.Messages.Message; namespace mRemoteNG.UI.Window { @@ -305,8 +306,7 @@ namespace mRemoteNG.UI.Window foreach (ListViewItem item in items) { - var message = item.Tag as Messages.Message; - if (message == null) + if (!(item.Tag is Message message)) { continue; } diff --git a/mRemoteV1/UI/Window/ExternalToolsWindow.cs b/mRemoteV1/UI/Window/ExternalToolsWindow.cs index 4ba070f94..3c96cd4ad 100644 --- a/mRemoteV1/UI/Window/ExternalToolsWindow.cs +++ b/mRemoteV1/UI/Window/ExternalToolsWindow.cs @@ -314,11 +314,10 @@ namespace mRemoteNG.UI.Window if (e.Column != WaitForExitColumnHeader) return; - var rowItemAsExternalTool = e.Model as ExternalTool; - if (rowItemAsExternalTool == null || !rowItemAsExternalTool.TryIntegrate) + if (!(e.Model is ExternalTool rowItemAsExternalTool) || !rowItemAsExternalTool.TryIntegrate) return; - e.Text = string.Format("'{0}' cannot be enabled if '{1}' is enabled", Language.strCheckboxWaitForExit, Language.strTryIntegrate); + e.Text = $"'{Language.strCheckboxWaitForExit}' cannot be enabled if '{Language.strTryIntegrate}' is enabled"; } #endregion } diff --git a/mRemoteV1/UI/Window/HelpWindow.cs b/mRemoteV1/UI/Window/HelpWindow.cs index 6310223cb..fd71db346 100644 --- a/mRemoteV1/UI/Window/HelpWindow.cs +++ b/mRemoteV1/UI/Window/HelpWindow.cs @@ -12,7 +12,7 @@ namespace mRemoteNG.UI.Window #region Form Init private TreeView tvIndex; - internal ImageList imgListHelp; + private ImageList imgListHelp; private System.ComponentModel.Container components; private SplitContainer pnlSplitter; private Label lblDocName; @@ -20,147 +20,15 @@ namespace mRemoteNG.UI.Window private void InitializeComponent() { - components = new System.ComponentModel.Container(); - Load += Help_Load; - Shown += Help_Shown; - var TreeNode1 = new TreeNode("Introduction"); - var TreeNode2 = new TreeNode("Prerequisites"); - var TreeNode3 = new TreeNode("Installation"); - var TreeNode4 = new TreeNode("Configuration"); - var TreeNode5 = new TreeNode("SQL Configuration"); - var TreeNode6 = new TreeNode("Command-Line Switches"); - var TreeNode7 = new TreeNode("Getting Started", new[] {TreeNode2, TreeNode3, TreeNode4, TreeNode5, TreeNode6}); - var TreeNode8 = new TreeNode("Main Menu"); - var TreeNode9 = new TreeNode("Connections"); - var TreeNode10 = new TreeNode("Config"); - var TreeNode11 = new TreeNode("Errors and Infos"); - var TreeNode12 = new TreeNode("Save As / Export"); - var TreeNode14 = new TreeNode("Screenshot Manager"); - var TreeNode15 = new TreeNode("Connection"); - var TreeNode16 = new TreeNode("Options"); - var TreeNode17 = new TreeNode("Update"); - var TreeNode18 = new TreeNode("SSH File Transfer"); - var TreeNode19 = new TreeNode("Quick Connect"); - var TreeNode20 = new TreeNode("Import From Active Directory"); - var TreeNode21 = new TreeNode("External Applications"); - var TreeNode22 = new TreeNode("Port Scan"); - var TreeNode23 = new TreeNode("User Interface", new[] {TreeNode8, TreeNode9, TreeNode10, TreeNode11, TreeNode12, TreeNode14, TreeNode15, TreeNode16, TreeNode17, TreeNode18, TreeNode19, TreeNode20, TreeNode21, TreeNode22}); - var TreeNode24 = new TreeNode("Quick Reference"); - var TreeNode25 = new TreeNode("Help", new[] {TreeNode1, TreeNode7, TreeNode23, TreeNode24}); - wbHelp = new WebBrowser(); - wbHelp.DocumentTitleChanged += wbHelp_DocumentTitleChanged; - tvIndex = new TreeView(); - tvIndex.NodeMouseClick += tvIndex_NodeMouseClick; - tvIndex.AfterSelect += tvIndex_AfterSelect; - imgListHelp = new ImageList(components); - pnlSplitter = new SplitContainer(); - lblDocName = new Label(); - pnlSplitter.Panel1.SuspendLayout(); - pnlSplitter.Panel2.SuspendLayout(); - pnlSplitter.SuspendLayout(); - SuspendLayout(); - // - //wbHelp - // - wbHelp.Anchor = AnchorStyles.Top | AnchorStyles.Bottom - | AnchorStyles.Left - | AnchorStyles.Right; - wbHelp.Location = new System.Drawing.Point(1, 36); - wbHelp.MinimumSize = new System.Drawing.Size(20, 20); - wbHelp.Name = "wbHelp"; - wbHelp.ScriptErrorsSuppressed = true; - wbHelp.Size = new System.Drawing.Size(327, 286); - wbHelp.TabIndex = 1; - // - //tvIndex - // - tvIndex.Anchor = AnchorStyles.Top | AnchorStyles.Bottom - | AnchorStyles.Left - | AnchorStyles.Right; - tvIndex.BorderStyle = BorderStyle.None; - tvIndex.HideSelection = false; - tvIndex.Location = new System.Drawing.Point(1, 1); - tvIndex.Name = "tvIndex"; - TreeNode1.Tag = "Introduction"; - TreeNode2.Tag = "Prerequisites"; - TreeNode3.Tag = "Installation"; - TreeNode4.Tag = "Configuration"; - TreeNode5.Tag = "ConfigurationSQL"; - TreeNode6.Tag = "CMDSwitches"; - TreeNode8.Tag = "MainMenu"; - TreeNode9.Tag = "Connections"; - TreeNode10.Tag = "Config"; - TreeNode11.Tag = "ErrorsAndInfos"; - TreeNode12.Tag = "SaveAsExport"; - TreeNode14.Tag = "ScreenshotManager"; - TreeNode15.Tag = "Connection"; - TreeNode16.Tag = "Options"; - TreeNode17.Tag = "Update"; - TreeNode18.Tag = "SSHFileTransfer"; - TreeNode19.Tag = "QuickConnect"; - TreeNode20.Tag = "ImportFromAD"; - TreeNode21.Tag = "ExternalTools"; - TreeNode22.Tag = "PortScan"; - TreeNode24.Tag = "QuickReference"; - TreeNode25.Tag = "Index"; - tvIndex.Nodes.AddRange(new[] {TreeNode25}); - tvIndex.ShowRootLines = false; - tvIndex.Size = new System.Drawing.Size(207, 321); - tvIndex.TabIndex = 0; - // - //imgListHelp - // - imgListHelp.ColorDepth = ColorDepth.Depth32Bit; - imgListHelp.ImageSize = new System.Drawing.Size(16, 16); - imgListHelp.TransparentColor = System.Drawing.Color.Transparent; - // - //pnlSplitter - // - pnlSplitter.Anchor = AnchorStyles.Top | AnchorStyles.Bottom - | AnchorStyles.Left - | AnchorStyles.Right; - pnlSplitter.FixedPanel = FixedPanel.Panel1; - pnlSplitter.Location = new System.Drawing.Point(0, 0); - pnlSplitter.Name = "pnlSplitter"; - // - //pnlSplitter.Panel1 - // - pnlSplitter.Panel1.Controls.Add(tvIndex); - // - //pnlSplitter.Panel2 - // - pnlSplitter.Panel2.Controls.Add(lblDocName); - pnlSplitter.Panel2.Controls.Add(wbHelp); - pnlSplitter.Size = new System.Drawing.Size(542, 323); - pnlSplitter.SplitterDistance = 209; - pnlSplitter.TabIndex = 2; - // - //lblDocName - // - lblDocName.Anchor = AnchorStyles.Top | AnchorStyles.Left - | AnchorStyles.Right; - lblDocName.BackColor = System.Drawing.Color.DimGray; - lblDocName.Font = new System.Drawing.Font("Segoe UI", 12.0F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, Convert.ToByte(0)); - lblDocName.ForeColor = System.Drawing.Color.White; - lblDocName.Location = new System.Drawing.Point(1, 1); - lblDocName.Name = "lblDocName"; - lblDocName.Size = new System.Drawing.Size(327, 35); - lblDocName.TabIndex = 2; - lblDocName.Text = @"Introduction"; - lblDocName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - //Help - // - ClientSize = new System.Drawing.Size(542, 323); - Controls.Add(pnlSplitter); - Icon = Resources.Help_Icon; - TabText = @"Help"; - Text = @"Help"; - pnlSplitter.Panel1.ResumeLayout(false); - pnlSplitter.Panel2.ResumeLayout(false); - pnlSplitter.ResumeLayout(false); - ResumeLayout(false); - + this.SuspendLayout(); + // + // HelpWindow + // + this.ClientSize = new System.Drawing.Size(284, 261); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "HelpWindow"; + this.ResumeLayout(false); + } #endregion diff --git a/mRemoteV1/UI/Window/HelpWindow.resx b/mRemoteV1/UI/Window/HelpWindow.resx index 510497c37..ca620d883 100644 --- a/mRemoteV1/UI/Window/HelpWindow.resx +++ b/mRemoteV1/UI/Window/HelpWindow.resx @@ -112,15 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 19, 14 - - + 48 \ No newline at end of file diff --git a/mRemoteV1/UI/Window/PortScanWindow.Designer.cs b/mRemoteV1/UI/Window/PortScanWindow.Designer.cs index 8d460ec4b..b691b1f09 100644 --- a/mRemoteV1/UI/Window/PortScanWindow.Designer.cs +++ b/mRemoteV1/UI/Window/PortScanWindow.Designer.cs @@ -84,6 +84,7 @@ namespace mRemoteNG.UI.Window // // ipStart // + this.ipStart.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ipStart.Location = new System.Drawing.Point(133, 3); this.ipStart.Name = "ipStart"; this.ipStart.Size = new System.Drawing.Size(124, 18); @@ -92,6 +93,7 @@ namespace mRemoteNG.UI.Window // // ipEnd // + this.ipEnd.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ipEnd.Location = new System.Drawing.Point(133, 27); this.ipEnd.Name = "ipEnd"; this.ipEnd.Size = new System.Drawing.Size(124, 18); @@ -355,7 +357,7 @@ namespace mRemoteNG.UI.Window this.portEnd.Name = "portEnd"; this.portEnd.Size = new System.Drawing.Size(67, 22); this.portEnd.TabIndex = 4; - this.portScanToolTip.SetToolTip(this.portEnd, Language.strPortScanSinglePort); + this.portScanToolTip.SetToolTip(this.portEnd, global::mRemoteNG.Language.strPortScanSinglePort); this.portEnd.Value = new decimal(new int[] { 65535, 0, @@ -375,7 +377,7 @@ namespace mRemoteNG.UI.Window this.portStart.Name = "portStart"; this.portStart.Size = new System.Drawing.Size(67, 22); this.portStart.TabIndex = 3; - this.portScanToolTip.SetToolTip(this.portStart, Language.strPortScanSinglePort); + this.portScanToolTip.SetToolTip(this.portStart, global::mRemoteNG.Language.strPortScanSinglePort); this.portStart.Enter += new System.EventHandler(this.portStart_Enter); // // pnlIp @@ -432,7 +434,7 @@ namespace mRemoteNG.UI.Window this.ngCheckFirstPort.Size = new System.Drawing.Size(72, 17); this.ngCheckFirstPort.TabIndex = 17; this.ngCheckFirstPort.Text = "First Port"; - this.portScanToolTip.SetToolTip(this.ngCheckFirstPort, Language.strPortScanSinglePort); + this.portScanToolTip.SetToolTip(this.ngCheckFirstPort, global::mRemoteNG.Language.strPortScanSinglePort); this.ngCheckFirstPort.UseVisualStyleBackColor = true; this.ngCheckFirstPort.CheckedChanged += new System.EventHandler(this.NgCheckFirstPort_CheckedChanged); // @@ -445,7 +447,7 @@ namespace mRemoteNG.UI.Window this.ngCheckLastPort.Size = new System.Drawing.Size(70, 17); this.ngCheckLastPort.TabIndex = 18; this.ngCheckLastPort.Text = "Last Port"; - this.portScanToolTip.SetToolTip(this.ngCheckLastPort, Language.strPortScanSinglePort); + this.portScanToolTip.SetToolTip(this.ngCheckLastPort, global::mRemoteNG.Language.strPortScanSinglePort); this.ngCheckLastPort.UseVisualStyleBackColor = true; this.ngCheckLastPort.CheckedChanged += new System.EventHandler(this.NgCheckLastPort_CheckedChanged); // diff --git a/mRemoteV1/UI/Window/ScreenshotManagerWindow.cs b/mRemoteV1/UI/Window/ScreenshotManagerWindow.cs index 3293c9b0f..eab5589dc 100644 --- a/mRemoteV1/UI/Window/ScreenshotManagerWindow.cs +++ b/mRemoteV1/UI/Window/ScreenshotManagerWindow.cs @@ -23,127 +23,128 @@ namespace mRemoteNG.UI.Window internal SaveFileDialog dlgSaveSingleImage; internal FolderBrowserDialog dlgSaveAllImages; - internal FlowLayoutPanel flpScreenshots; - private WeifenLuo.WinFormsUI.Docking.VisualStudioToolStripExtender vsToolStripExtender; + private FlowLayoutPanel flpScreenshots; + private VisualStudioToolStripExtender vsToolStripExtender; private readonly ToolStripRenderer _toolStripProfessionalRenderer = new ToolStripProfessionalRenderer(); private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.flpScreenshots = new System.Windows.Forms.FlowLayoutPanel(); - this.msMain = new System.Windows.Forms.MenuStrip(); - this.mMenFile = new System.Windows.Forms.ToolStripMenuItem(); - this.mMenFileSaveAll = new System.Windows.Forms.ToolStripMenuItem(); - this.mMenFileRemoveAll = new System.Windows.Forms.ToolStripMenuItem(); - this.cMenScreenshot = new System.Windows.Forms.ContextMenuStrip(this.components); - this.cMenScreenshotCopy = new System.Windows.Forms.ToolStripMenuItem(); - this.cMenScreenshotSave = new System.Windows.Forms.ToolStripMenuItem(); - this.dlgSaveSingleImage = new System.Windows.Forms.SaveFileDialog(); - this.dlgSaveAllImages = new System.Windows.Forms.FolderBrowserDialog(); - this.msMain.SuspendLayout(); - this.cMenScreenshot.SuspendLayout(); - this.SuspendLayout(); + components = new System.ComponentModel.Container(); + flpScreenshots = new FlowLayoutPanel(); + msMain = new MenuStrip(); + mMenFile = new ToolStripMenuItem(); + mMenFileSaveAll = new ToolStripMenuItem(); + mMenFileRemoveAll = new ToolStripMenuItem(); + cMenScreenshot = new ContextMenuStrip(components); + cMenScreenshotCopy = new ToolStripMenuItem(); + cMenScreenshotSave = new ToolStripMenuItem(); + dlgSaveSingleImage = new SaveFileDialog(); + dlgSaveAllImages = new FolderBrowserDialog(); + msMain.SuspendLayout(); + cMenScreenshot.SuspendLayout(); + SuspendLayout(); // // flpScreenshots // - this.flpScreenshots.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.flpScreenshots.AutoScroll = true; - this.flpScreenshots.Location = new System.Drawing.Point(0, 26); - this.flpScreenshots.Name = "flpScreenshots"; - this.flpScreenshots.Size = new System.Drawing.Size(542, 296); - this.flpScreenshots.TabIndex = 0; + flpScreenshots.Anchor = AnchorStyles.Top | AnchorStyles.Bottom + | AnchorStyles.Left + | AnchorStyles.Right; + flpScreenshots.AutoScroll = true; + flpScreenshots.Location = new Point(0, 26); + flpScreenshots.Name = "flpScreenshots"; + flpScreenshots.Size = new Size(542, 296); + flpScreenshots.TabIndex = 0; // // msMain // - this.msMain.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.msMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mMenFile}); - this.msMain.Location = new System.Drawing.Point(0, 0); - this.msMain.Name = "msMain"; - this.msMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.msMain.Size = new System.Drawing.Size(542, 24); - this.msMain.TabIndex = 1; - this.msMain.Text = "MenuStrip1"; + msMain.Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + msMain.Items.AddRange(new ToolStripItem[] { + mMenFile}); + msMain.Location = new Point(0, 0); + msMain.Name = "msMain"; + msMain.RenderMode = ToolStripRenderMode.Professional; + msMain.Size = new Size(542, 24); + msMain.TabIndex = 1; + msMain.Text = "MenuStrip1"; // // mMenFile // - this.mMenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mMenFileSaveAll, - this.mMenFileRemoveAll}); - this.mMenFile.Image = global::mRemoteNG.Resources.File; - this.mMenFile.Name = "mMenFile"; - this.mMenFile.Size = new System.Drawing.Size(53, 20); - this.mMenFile.Text = "&File"; - this.mMenFile.DropDownOpening += new System.EventHandler(this.mMenFile_DropDownOpening); + mMenFile.DropDownItems.AddRange(new ToolStripItem[] { + mMenFileSaveAll, + mMenFileRemoveAll}); + mMenFile.Image = Resources.File; + mMenFile.Name = "mMenFile"; + mMenFile.Size = new Size(53, 20); + mMenFile.Text = "&File"; + mMenFile.DropDownOpening += mMenFile_DropDownOpening; // // mMenFileSaveAll // - this.mMenFileSaveAll.Image = global::mRemoteNG.Resources.Screenshot_Save; - this.mMenFileSaveAll.Name = "mMenFileSaveAll"; - this.mMenFileSaveAll.Size = new System.Drawing.Size(130, 22); - this.mMenFileSaveAll.Text = "Save All"; - this.mMenFileSaveAll.Click += new System.EventHandler(this.mMenFileSaveAll_Click); + mMenFileSaveAll.Image = Resources.Screenshot_Save; + mMenFileSaveAll.Name = "mMenFileSaveAll"; + mMenFileSaveAll.Size = new Size(130, 22); + mMenFileSaveAll.Text = "Save All"; + mMenFileSaveAll.Click += mMenFileSaveAll_Click; // // mMenFileRemoveAll // - this.mMenFileRemoveAll.Image = global::mRemoteNG.Resources.Screenshot_Delete; - this.mMenFileRemoveAll.Name = "mMenFileRemoveAll"; - this.mMenFileRemoveAll.Size = new System.Drawing.Size(130, 22); - this.mMenFileRemoveAll.Text = "Remove All"; - this.mMenFileRemoveAll.Click += new System.EventHandler(this.mMenFileRemoveAll_Click); + mMenFileRemoveAll.Image = Resources.Screenshot_Delete; + mMenFileRemoveAll.Name = "mMenFileRemoveAll"; + mMenFileRemoveAll.Size = new Size(130, 22); + mMenFileRemoveAll.Text = "Remove All"; + mMenFileRemoveAll.Click += mMenFileRemoveAll_Click; // // cMenScreenshot // - this.cMenScreenshot.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.cMenScreenshotCopy, - this.cMenScreenshotSave}); - this.cMenScreenshot.Name = "cMenScreenshot"; - this.cMenScreenshot.Size = new System.Drawing.Size(103, 48); + cMenScreenshot.Items.AddRange(new ToolStripItem[] { + cMenScreenshotCopy, + cMenScreenshotSave}); + cMenScreenshot.Name = "cMenScreenshot"; + cMenScreenshot.Size = new Size(103, 48); // // cMenScreenshotCopy // - this.cMenScreenshotCopy.Image = global::mRemoteNG.Resources.Screenshot_Copy; - this.cMenScreenshotCopy.Name = "cMenScreenshotCopy"; - this.cMenScreenshotCopy.Size = new System.Drawing.Size(102, 22); - this.cMenScreenshotCopy.Text = "Copy"; - this.cMenScreenshotCopy.Click += new System.EventHandler(this.cMenScreenshotCopy_Click); + cMenScreenshotCopy.Image = Resources.Screenshot_Copy; + cMenScreenshotCopy.Name = "cMenScreenshotCopy"; + cMenScreenshotCopy.Size = new Size(102, 22); + cMenScreenshotCopy.Text = "Copy"; + cMenScreenshotCopy.Click += cMenScreenshotCopy_Click; // // cMenScreenshotSave // - this.cMenScreenshotSave.Image = global::mRemoteNG.Resources.Screenshot_Save; - this.cMenScreenshotSave.Name = "cMenScreenshotSave"; - this.cMenScreenshotSave.Size = new System.Drawing.Size(102, 22); - this.cMenScreenshotSave.Text = "Save"; - this.cMenScreenshotSave.Click += new System.EventHandler(this.cMenScreenshotSave_Click); + cMenScreenshotSave.Image = Resources.Screenshot_Save; + cMenScreenshotSave.Name = "cMenScreenshotSave"; + cMenScreenshotSave.Size = new Size(102, 22); + cMenScreenshotSave.Text = "Save"; + cMenScreenshotSave.Click += cMenScreenshotSave_Click; // // dlgSaveSingleImage // - this.dlgSaveSingleImage.Filter = "Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group Fi" + + dlgSaveSingleImage.Filter = "Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group Fi" + "le (.jpeg)|*.jpeg|Joint Photographic Experts Group File (.jpg)|*.jpg|Portable Ne" + "twork Graphics File (.png)|*.png"; - this.dlgSaveSingleImage.FilterIndex = 4; + dlgSaveSingleImage.FilterIndex = 4; // // ScreenshotManagerWindow // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(542, 323); - this.Controls.Add(this.flpScreenshots); - this.Controls.Add(this.msMain); - this.HideOnClose = true; - this.Icon = global::mRemoteNG.Resources.Screenshot_Icon; - this.MainMenuStrip = this.msMain; - this.Name = "ScreenshotManagerWindow"; - this.TabText = "Screenshots"; - this.Text = "Screenshots"; - this.Load += new System.EventHandler(this.ScreenshotManager_Load); - this.msMain.ResumeLayout(false); - this.msMain.PerformLayout(); - this.cMenScreenshot.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + AutoScaleDimensions = new SizeF(96F, 96F); + AutoScaleMode = AutoScaleMode.Dpi; + ClientSize = new Size(542, 323); + Controls.Add(flpScreenshots); + Controls.Add(msMain); + Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0); + HideOnClose = true; + Icon = Resources.Screenshot_Icon; + MainMenuStrip = msMain; + Name = "ScreenshotManagerWindow"; + TabText = "Screenshots"; + Text = "Screenshots"; + Load += ScreenshotManager_Load; + msMain.ResumeLayout(false); + msMain.PerformLayout(); + cMenScreenshot.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -152,19 +153,19 @@ namespace mRemoteNG.UI.Window private void ScreenshotManager_Load(object sender, EventArgs e) { ApplyTheme(); - Themes.ThemeManager.getInstance().ThemeChanged += ApplyTheme; + ThemeManager.getInstance().ThemeChanged += ApplyTheme; ApplyLanguage(); } private new void ApplyTheme() { - if (ThemeManager.getInstance().ThemingActive) + if (!ThemeManager.getInstance().ThemingActive) return; + base.ApplyTheme(); + vsToolStripExtender = new VisualStudioToolStripExtender(components) { - base.ApplyTheme(); - this.vsToolStripExtender = new WeifenLuo.WinFormsUI.Docking.VisualStudioToolStripExtender(this.components); - vsToolStripExtender.DefaultRenderer = _toolStripProfessionalRenderer; - vsToolStripExtender.SetStyle(cMenScreenshot, ThemeManager.getInstance().ActiveTheme.Version, ThemeManager.getInstance().ActiveTheme.Theme); - } + DefaultRenderer = _toolStripProfessionalRenderer + }; + vsToolStripExtender.SetStyle(cMenScreenshot, ThemeManager.getInstance().ActiveTheme.Version, ThemeManager.getInstance().ActiveTheme.Theme); } private void ApplyLanguage() { diff --git a/mRemoteV1/UI/Window/UltraVNCWindow.cs b/mRemoteV1/UI/Window/UltraVNCWindow.cs index ae8d0b2d9..571cdb8ff 100644 --- a/mRemoteV1/UI/Window/UltraVNCWindow.cs +++ b/mRemoteV1/UI/Window/UltraVNCWindow.cs @@ -59,6 +59,7 @@ namespace mRemoteNG.UI.Window this.ClientSize = new System.Drawing.Size(446, 362); this.Controls.Add(this.pnlContainer); this.Controls.Add(this.tsMain); + this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = global::mRemoteNG.Resources.UVNC_SC_Icon; this.Name = "UltraVNCWindow"; this.TabText = "UltraVNC SC"; diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index fe1a31700..92e622231 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -165,6 +165,7 @@ + @@ -842,18 +843,66 @@ ColorMapTheme.Designer.cs mRemoteNG + + NGButton.cs + + + NGCheckBox.cs + + + NGComboBox.cs + + + NGGroupBox.cs + + + NGLabel.cs + + + NGListView.cs + + + NGNumericUpDown.cs + + + NGRadioButton.cs + + + NGTextBox.cs + + + ConnectionTree.cs + + + CredentialRecordComboBox.cs + + + CredentialRecordListBox.cs + CredentialRecordListView.cs CredentialRepositoryListView.cs + + FilteredPropertyGrid.cs + + + HeadlessTabControl.cs + IPTextBox.cs NewPasswordWithVerification.cs + + SequencedControl.cs + + + SecureTextBox.cs + CompositeCredentialRepoUnlockerForm.cs @@ -895,9 +944,42 @@ FrmInputBox.cs + + AdvancedPage.cs + + + AppearancePage.cs + + + ConnectionsPage.cs + CredentialsPage.cs + + NotificationsPage.cs + + + OptionsPage.cs + + + SecurityPage.cs + + + SqlServerPage.cs + + + StartupExitPage.cs + + + TabsPanelsPage.cs + + + ThemePage.cs + + + UpdatesPage.cs + PasswordForm.cs Designer @@ -965,9 +1047,15 @@ ReconnectGroup.cs Designer + + TextBox.cs + UnhandledExceptionWindow.cs + + CommandButton.cs + frmTaskDialog.cs @@ -979,6 +1067,9 @@ ActiveDirectoryImportWindow.cs Designer + + BaseWindow.cs + ComponentsCheckWindow.cs Designer @@ -1064,10 +1155,6 @@ Designer PreserveNewest - - Designer - PreserveNewest - Designer PreserveNewest