mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Support for saving OpeningCommand and the InheritedOpeningCommand. Tested for stock saving only.
This commit is contained in:
@@ -128,6 +128,10 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
|
||||
? connectionCsv[headers.IndexOf("SSHTunnelConnectionName")]
|
||||
: "";
|
||||
|
||||
connectionRecord.OpeningCommand = headers.Contains("OpeningCommand")
|
||||
? connectionCsv[headers.IndexOf("OpeningCommand")]
|
||||
: "";
|
||||
|
||||
connectionRecord.PuttySession = headers.Contains("PuttySession")
|
||||
? connectionCsv[headers.IndexOf("PuttySession")]
|
||||
: "";
|
||||
@@ -536,6 +540,12 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
|
||||
connectionRecord.Inheritance.SSHTunnelConnectionName = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("InheritOpeningCommand"))
|
||||
{
|
||||
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritOpeningCommand")], out bool value))
|
||||
connectionRecord.Inheritance.OpeningCommand = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("InheritSSHOptions"))
|
||||
{
|
||||
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritSSHOptions")], out bool value))
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
|
||||
if (_saveFilter.SaveDomain)
|
||||
sb.Append("Domain;");
|
||||
|
||||
sb.Append("Hostname;Port;VmId;Protocol;SSHTunnelConnectionName;SSHOptions;PuttySession;ConnectToConsole;UseCredSsp;UseVmId;UseEnhancedMode;RenderingEngine;RDPAuthenticationLevel;" +
|
||||
sb.Append("Hostname;Port;VmId;Protocol;SSHTunnelConnectionName;OpeningCommand;SSHOptions;PuttySession;ConnectToConsole;UseCredSsp;UseVmId;UseEnhancedMode;RenderingEngine;RDPAuthenticationLevel;" +
|
||||
"LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;DisableFullWindowDrag;DisableMenuAnimations;DisableCursorShadow;DisableCursorBlinking;" +
|
||||
"CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" +
|
||||
"PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;" +
|
||||
@@ -120,6 +120,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
|
||||
.Append(FormatForCsv(con.VmId))
|
||||
.Append(FormatForCsv(con.Protocol))
|
||||
.Append(FormatForCsv(con.SSHTunnelConnectionName))
|
||||
.Append(FormatForCsv(con.OpeningCommand))
|
||||
.Append(FormatForCsv(con.SSHOptions))
|
||||
.Append(FormatForCsv(con.PuttySession))
|
||||
.Append(FormatForCsv(con.UseConsoleSession))
|
||||
@@ -196,6 +197,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Csv
|
||||
.Append(FormatForCsv(con.Inheritance.Port))
|
||||
.Append(FormatForCsv(con.Inheritance.Protocol))
|
||||
.Append(FormatForCsv(con.Inheritance.SSHTunnelConnectionName))
|
||||
.Append(FormatForCsv(con.Inheritance.OpeningCommand))
|
||||
.Append(FormatForCsv(con.Inheritance.SSHOptions))
|
||||
.Append(FormatForCsv(con.Inheritance.PuttySession))
|
||||
.Append(FormatForCsv(con.Inheritance.RedirectDiskDrives))
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
|
||||
connectionInfo.UseEnhancedMode = (bool)dataRow["UseEnhancedMode"];
|
||||
connectionInfo.Protocol = (ProtocolType)Enum.Parse(typeof(ProtocolType), (string)dataRow["Protocol"]);
|
||||
connectionInfo.SSHTunnelConnectionName = (string)dataRow["SSHTunnelConnectionName"];
|
||||
connectionInfo.OpeningCommand = (string)dataRow["OpeningCommand"];
|
||||
connectionInfo.SSHOptions = (string)dataRow["SSHOptions"];
|
||||
connectionInfo.PuttySession = (string)dataRow["PuttySession"];
|
||||
connectionInfo.Port = (int)dataRow["Port"];
|
||||
@@ -188,6 +189,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
|
||||
connectionInfo.Inheritance.Port = (bool)dataRow["InheritPort"];
|
||||
connectionInfo.Inheritance.Protocol = (bool)dataRow["InheritProtocol"];
|
||||
connectionInfo.Inheritance.SSHTunnelConnectionName = (bool)dataRow["InheritSSHTunnelConnectionName"];
|
||||
connectionInfo.Inheritance.OpeningCommand = (bool)dataRow["InheritOpeningCommand"];
|
||||
connectionInfo.Inheritance.SSHOptions = (bool)dataRow["InheritSSHOptions"];
|
||||
connectionInfo.Inheritance.PuttySession = (bool)dataRow["InheritPuttySession"];
|
||||
connectionInfo.Inheritance.RedirectDiskDrives = (bool)dataRow["InheritRedirectDiskDrives"];
|
||||
|
||||
@@ -516,6 +516,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
|
||||
dataRow["VmId"] = connectionInfo.VmId;
|
||||
dataRow["Protocol"] = connectionInfo.Protocol;
|
||||
dataRow["SSHTunnelConnectionName"] = connectionInfo.SSHTunnelConnectionName;
|
||||
dataRow["OpeningCommand"] = connectionInfo.OpeningCommand;
|
||||
dataRow["SSHOptions"] = connectionInfo.SSHOptions;
|
||||
dataRow["PuttySession"] = connectionInfo.PuttySession;
|
||||
dataRow["Port"] = connectionInfo.Port;
|
||||
@@ -596,6 +597,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.MsSql
|
||||
dataRow["InheritPort"] = connectionInfo.Inheritance.Port;
|
||||
dataRow["InheritProtocol"] = connectionInfo.Inheritance.Protocol;
|
||||
dataRow["InheritSSHTunnelConnectionName"] = connectionInfo.Inheritance.SSHTunnelConnectionName;
|
||||
dataRow["InheritOpeningCommand"] = connectionInfo.Inheritance.OpeningCommand;
|
||||
dataRow["InheritSSHOptions"] = connectionInfo.Inheritance.SSHOptions;
|
||||
dataRow["InheritPuttySession"] = connectionInfo.Inheritance.PuttySession;
|
||||
dataRow["InheritRedirectDiskDrives"] = connectionInfo.Inheritance.RedirectDiskDrives;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Security;
|
||||
using System.Xml.Linq;
|
||||
using mRemoteNG.Connection;
|
||||
@@ -66,6 +66,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
element.Add(new XAttribute("Hostname", connectionInfo.Hostname));
|
||||
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
|
||||
element.Add(new XAttribute("SSHTunnelConnectionName", connectionInfo.SSHTunnelConnectionName));
|
||||
element.Add(new XAttribute("OpeningCommand", connectionInfo.OpeningCommand));
|
||||
element.Add(new XAttribute("SSHOptions", connectionInfo.SSHOptions));
|
||||
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
|
||||
element.Add(new XAttribute("Port", connectionInfo.Port));
|
||||
@@ -168,6 +169,8 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
element.Add(new XAttribute("InheritProtocol", inheritance.Protocol.ToString().ToLowerInvariant()));
|
||||
if (inheritance.SSHTunnelConnectionName)
|
||||
element.Add(new XAttribute("InheritSSHTunnelConnectionName", inheritance.SSHTunnelConnectionName.ToString().ToLowerInvariant()));
|
||||
if (inheritance.OpeningCommand)
|
||||
element.Add(new XAttribute("InheritOpeningCommand", inheritance.OpeningCommand.ToString().ToLowerInvariant()));
|
||||
if (inheritance.SSHOptions)
|
||||
element.Add(new XAttribute("InheritSSHOptions", inheritance.SSHOptions.ToString().ToLowerInvariant()));
|
||||
if (inheritance.PuttySession)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Security;
|
||||
using System.Xml.Linq;
|
||||
using mRemoteNG.App;
|
||||
@@ -76,6 +76,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
|
||||
element.Add(new XAttribute("RdpVersion", connectionInfo.RdpVersion.ToString().ToLowerInvariant()));
|
||||
element.Add(new XAttribute("SSHTunnelConnectionName", connectionInfo.SSHTunnelConnectionName));
|
||||
element.Add(new XAttribute("OpeningCommand", connectionInfo.OpeningCommand));
|
||||
element.Add(new XAttribute("SSHOptions", connectionInfo.SSHOptions));
|
||||
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
|
||||
element.Add(new XAttribute("Port", connectionInfo.Port));
|
||||
@@ -194,6 +195,8 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
element.Add(new XAttribute("InheritRdpVersion", inheritance.RdpVersion.ToString().ToLowerInvariant()));
|
||||
if (inheritance.SSHTunnelConnectionName)
|
||||
element.Add(new XAttribute("InheritSSHTunnelConnectionName", inheritance.SSHTunnelConnectionName.ToString().ToLowerInvariant()));
|
||||
if (inheritance.OpeningCommand)
|
||||
element.Add(new XAttribute("InheritOpeningCommand", inheritance.OpeningCommand.ToString().ToLowerInvariant()));
|
||||
if (inheritance.SSHOptions)
|
||||
element.Add(new XAttribute("InheritSSHOptions", inheritance.SSHOptions.ToString().ToLowerInvariant()));
|
||||
if (inheritance.PuttySession)
|
||||
|
||||
@@ -539,6 +539,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
connectionInfo.UseEnhancedMode = xmlnode.GetAttributeAsBool("UseEnhancedMode");
|
||||
connectionInfo.RdpVersion = xmlnode.GetAttributeAsEnum("RdpVersion", RdpVersion.Highest);
|
||||
connectionInfo.SSHTunnelConnectionName = xmlnode.GetAttributeAsString("SSHTunnelConnectionName");
|
||||
connectionInfo.OpeningCommand = xmlnode.GetAttributeAsString("OpeningCommand");
|
||||
connectionInfo.SSHOptions = xmlnode.GetAttributeAsString("SSHOptions");
|
||||
connectionInfo.StartProgram = xmlnode.GetAttributeAsString("StartProgram");
|
||||
connectionInfo.DisableFullWindowDrag = xmlnode.GetAttributeAsBool("DisableFullWindowDrag");
|
||||
@@ -552,6 +553,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
|
||||
connectionInfo.Inheritance.VmId = xmlnode.GetAttributeAsBool("InheritVmId");
|
||||
connectionInfo.Inheritance.UseEnhancedMode = xmlnode.GetAttributeAsBool("InheritUseEnhancedMode");
|
||||
connectionInfo.Inheritance.SSHTunnelConnectionName = xmlnode.GetAttributeAsBool("InheritSSHTunnelConnectionName");
|
||||
connectionInfo.Inheritance.OpeningCommand = xmlnode.GetAttributeAsBool("InheritOpeningCommand");
|
||||
connectionInfo.Inheritance.SSHOptions = xmlnode.GetAttributeAsBool("InheritSSHOptions");
|
||||
connectionInfo.Inheritance.DisableFullWindowDrag = xmlnode.GetAttributeAsBool("InheritDisableFullWindowDrag");
|
||||
connectionInfo.Inheritance.DisableMenuAnimations = xmlnode.GetAttributeAsBool("InheritDisableMenuAnimations");
|
||||
|
||||
@@ -92,6 +92,15 @@ namespace mRemoteNG.Connection
|
||||
[Browsable(true)]
|
||||
public bool SSHTunnelConnectionName { get; set; }
|
||||
|
||||
[LocalizedAttributes.LocalizedCategory(nameof(Language.Connection), 3),
|
||||
LocalizedAttributes.LocalizedDisplayNameInheritAttribute(nameof(Language.OpeningCommand)),
|
||||
LocalizedAttributes.LocalizedDescriptionInheritAttribute(nameof(Language.PropertyDescriptionOpeningCommand)),
|
||||
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
|
||||
[Browsable(true)]
|
||||
public bool OpeningCommand { get; set; }
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protocol
|
||||
|
||||
Reference in New Issue
Block a user