renamed more items to RdpVersion as suggested in code review

This commit is contained in:
David Sparer
2019-06-24 08:31:38 -05:00
parent 0d8a3b84fe
commit bb2e0f0b7d
15 changed files with 53 additions and 51 deletions

View File

@@ -374,10 +374,10 @@ namespace mRemoteNG.Config.Serializers.Csv
connectionRecord.Favorite = value;
}
if (headers.Contains("RdpProtocolVersion"))
if (headers.Contains("RdpVersion"))
{
if (Enum.TryParse(connectionCsv[headers.IndexOf("RdpProtocolVersion")], true, out RdpVersion version))
connectionRecord.RdpProtocolVersion = version;
if (Enum.TryParse(connectionCsv[headers.IndexOf("RdpVersion")], true, out RdpVersion version))
connectionRecord.RdpVersion = version;
}
#region Inheritance
@@ -796,11 +796,11 @@ namespace mRemoteNG.Config.Serializers.Csv
connectionRecord.Inheritance.RedirectAudioCapture = value;
}
if (headers.Contains("InheritRdpProtocolVersion"))
if (headers.Contains("InheritRdpVersion"))
{
bool value;
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRdpProtocolVersion")], out value))
connectionRecord.Inheritance.RdpProtocolVersion = value;
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRdpVersion")], out value))
connectionRecord.Inheritance.RdpVersion = value;
}
#endregion

View File

@@ -55,9 +55,9 @@ namespace mRemoteNG.Config.Serializers.Csv
sb.Append("Password;");
if (_saveFilter.SaveDomain)
sb.Append("Domain;");
sb.Append("Hostname;VmId;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;RedirectAudioCapture;RdpProtocolVersion");
sb.Append("Hostname;VmId;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;RedirectAudioCapture;RdpVersion");
if (_saveFilter.SaveInheritance)
sb.Append("InheritCacheBitmaps;InheritVmId;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;InheritUseConsoleSession;InheritUseCredSsp;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain;InheritRDPAlertIdleTimeout;InheritRDPMinutesToIdleTimeout;InheritSoundQuality;InheritRedirectAudioCapture;InheritRdpProtocolVersion;");
sb.Append("InheritCacheBitmaps;InheritVmId;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;InheritUseConsoleSession;InheritUseCredSsp;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain;InheritRDPAlertIdleTimeout;InheritRDPMinutesToIdleTimeout;InheritSoundQuality;InheritRedirectAudioCapture;InheritRdpVersion;");
}
private void SerializeNodesRecursive(ConnectionInfo node, StringBuilder sb)
@@ -149,7 +149,7 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.RDGatewayPassword))
.Append(FormatForCsv(con.RDGatewayDomain))
.Append(FormatForCsv(con.RedirectAudioCapture))
.Append(FormatForCsv(con.RdpProtocolVersion));
.Append(FormatForCsv(con.RdpVersion));
if (!_saveFilter.SaveInheritance)
@@ -214,7 +214,7 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.Inheritance.RDPMinutesToIdleTimeout))
.Append(FormatForCsv(con.Inheritance.SoundQuality))
.Append(FormatForCsv(con.Inheritance.RedirectAudioCapture))
.Append(FormatForCsv(con.Inheritance.RdpProtocolVersion));
.Append(FormatForCsv(con.Inheritance.RdpVersion));
}
private string FormatForCsv(object value)

View File

@@ -164,8 +164,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.RDGatewayPassword = DecryptValue((string)dataRow["RDGatewayPassword"]);
connectionInfo.RDGatewayDomain = (string)dataRow["RDGatewayDomain"];
if (Enum.TryParse((string)dataRow["RdpProtocolVersion"], true, out RdpVersion rdpVersion))
connectionInfo.RdpProtocolVersion = rdpVersion;
if (Enum.TryParse((string)dataRow["RdpVersion"], true, out RdpVersion rdpVersion))
connectionInfo.RdpVersion = rdpVersion;
connectionInfo.Inheritance.CacheBitmaps = (bool)dataRow["InheritCacheBitmaps"];
connectionInfo.Inheritance.Colors = (bool)dataRow["InheritColors"];
@@ -226,7 +226,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.Inheritance.RDGatewayUsername = (bool)dataRow["InheritRDGatewayUsername"];
connectionInfo.Inheritance.RDGatewayPassword = (bool)dataRow["InheritRDGatewayPassword"];
connectionInfo.Inheritance.RDGatewayDomain = (bool)dataRow["InheritRDGatewayDomain"];
connectionInfo.Inheritance.RdpProtocolVersion = (bool)dataRow["InheritRdpProtocolVersion"];
connectionInfo.Inheritance.RdpVersion = (bool)dataRow["InheritRdpVersion"];
}
private string DecryptValue(string cipherText)

View File

@@ -193,6 +193,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataTable.Columns.Add("UseVmId", typeof(bool));
dataTable.Columns.Add("InheritVmId", typeof(bool));
dataTable.Columns.Add("InheritUseVmId", typeof(bool));
dataTable.Columns.Add("RdpVersion", typeof(string));
dataTable.Columns.Add("InheritRdpVersion", typeof(bool));
}
private void SetPrimaryKey(DataTable dataTable)
@@ -262,8 +264,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["SoundQuality"] = connectionInfo.SoundQuality;
dataRow["RedirectAudioCapture"] = connectionInfo.RedirectAudioCapture;
dataRow["RedirectKeys"] = connectionInfo.RedirectKeys;
dataRow["Connected"] =
false; // TODO: this column can eventually be removed. we now save this property locally
dataRow["Connected"] = false; // TODO: this column can eventually be removed. we now save this property locally
dataRow["PreExtApp"] = connectionInfo.PreExtApp;
dataRow["PostExtApp"] = connectionInfo.PostExtApp;
dataRow["MacAddress"] = connectionInfo.MacAddress;
@@ -287,7 +288,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["RDGatewayUsername"] = connectionInfo.RDGatewayUsername;
dataRow["RDGatewayPassword"] = _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey);
dataRow["RDGatewayDomain"] = connectionInfo.RDGatewayDomain;
dataRow["RdpProtocolVersion"] = connectionInfo.RdpProtocolVersion;
dataRow["RdpVersion"] = connectionInfo.RdpVersion;
if (_saveFilter.SaveInheritance)
@@ -350,7 +351,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritRDGatewayUsername"] = connectionInfo.Inheritance.RDGatewayUsername;
dataRow["InheritRDGatewayPassword"] = connectionInfo.Inheritance.RDGatewayPassword;
dataRow["InheritRDGatewayDomain"] = connectionInfo.Inheritance.RDGatewayDomain;
dataRow["InheritRdpProtocolVersion"] = connectionInfo.Inheritance.RdpProtocolVersion;
dataRow["InheritRdpVersion"] = connectionInfo.Inheritance.RdpVersion;
}
else
{
@@ -410,7 +411,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritRDGatewayUsername"] = false;
dataRow["InheritRDGatewayPassword"] = false;
dataRow["InheritRDGatewayDomain"] = false;
dataRow["InheritRdpProtocolVersion"] = false;
dataRow["InheritRdpVersion"] = false;
}
_dataTable.Rows.Add(dataRow);

View File

@@ -74,7 +74,7 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("Hostname", connectionInfo.Hostname));
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
element.Add(new XAttribute("RdpProtocolVersion", connectionInfo.RdpProtocolVersion.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RdpVersion", connectionInfo.RdpVersion.ToString().ToLowerInvariant()));
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
element.Add(new XAttribute("Port", connectionInfo.Port));
element.Add(new XAttribute("ConnectToConsole",
@@ -194,8 +194,8 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.Inheritance.Port.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritProtocol",
connectionInfo.Inheritance.Protocol.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritRdpProtocolVersion",
connectionInfo.Inheritance.RdpProtocolVersion.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritRdpVersion",
connectionInfo.Inheritance.RdpVersion.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritPuttySession",
connectionInfo.Inheritance.PuttySession.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritRedirectDiskDrives",

View File

@@ -544,8 +544,8 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.VmId = xmlnode.GetAttributeAsString("VmId");
connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard");
connectionInfo.Inheritance.Favorite = xmlnode.GetAttributeAsBool("InheritFavorite");
connectionInfo.RdpProtocolVersion = xmlnode.GetAttributeAsEnum("RdpProtocolVersion", RdpVersion.Highest);
connectionInfo.Inheritance.RdpProtocolVersion = xmlnode.GetAttributeAsBool("InheritRdpProtocolVersion");
connectionInfo.RdpVersion = xmlnode.GetAttributeAsEnum("RdpVersion", RdpVersion.Highest);
connectionInfo.Inheritance.RdpVersion = xmlnode.GetAttributeAsBool("InheritRdpVersion");
connectionInfo.Inheritance.UseVmId = xmlnode.GetAttributeAsBool("InheritUseVmId");
connectionInfo.Inheritance.VmId = xmlnode.GetAttributeAsBool("InheritVmId");
}

View File

@@ -198,14 +198,14 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpProtocolVersion"),
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpProtocolVersion"),
LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpVersion"),
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpVersion"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)]
public virtual RdpVersion RdpProtocolVersion
public virtual RdpVersion RdpVersion
{
get => GetPropertyValue(nameof(RdpProtocolVersion), _rdpProtocolVersion);
set => SetField(ref _rdpProtocolVersion, value, nameof(RdpProtocolVersion));
get => GetPropertyValue(nameof(RdpVersion), _rdpProtocolVersion);
set => SetField(ref _rdpProtocolVersion, value, nameof(RdpVersion));
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),

View File

@@ -89,10 +89,10 @@ namespace mRemoteNG.Connection
public bool Protocol { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpProtocolVersion"),
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpProtocolVersion"),
LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpVersion"),
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpVersion"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RdpProtocolVersion { get; set; }
public bool RdpVersion { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalTool"),

View File

@@ -20,7 +20,7 @@ namespace mRemoteNG.Connection.Protocol
switch (connectionInfo.Protocol)
{
case ProtocolType.RDP:
var rdp = _rdpProtocolFactory.Build(connectionInfo.RdpProtocolVersion);
var rdp = _rdpProtocolFactory.Build(connectionInfo.RdpVersion);
rdp.LoadBalanceInfoUseUtf8 = Settings.Default.RdpLoadBalanceInfoUseUtf8;
return rdp;
case ProtocolType.VNC:

View File

@@ -116,7 +116,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
{
connectionInfo = InterfaceControl.Info;
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
$"Requesting RDP version: {connectionInfo.RdpProtocolVersion}. Using: {RdpProtocolVersion}");
$"Requesting RDP version: {connectionInfo.RdpVersion}. Using: {RdpProtocolVersion}");
Control = CreateActiveXRdpClientControl();
base.Initialize();
@@ -157,7 +157,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
if (ex.Message.Contains("CLASS_E_CLASSNOTAVAILABLE"))
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
string.Format(Language.RdpProtocolVersionNotSupported, connectionInfo.RdpProtocolVersion));
string.Format(Language.RdpProtocolVersionNotSupported, connectionInfo.RdpVersion));
}
else
{

View File

@@ -2914,27 +2914,28 @@ namespace mRemoteNG {
this["InhDefaultUseVmId"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Highest")]
public string ConDefaultRdpProtocolVersion {
public string ConDefaultRdpVersion {
get {
return ((string)(this["ConDefaultRdpProtocolVersion"]));
return ((string)(this["ConDefaultRdpVersion"]));
}
set {
this["ConDefaultRdpProtocolVersion"] = value;
this["ConDefaultRdpVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool InhDefaultRdpProtocolVersion {
public bool InhDefaultRdpVersion {
get {
return ((bool)(this["InhDefaultRdpProtocolVersion"]));
return ((bool)(this["InhDefaultRdpVersion"]));
}
set {
this["InhDefaultRdpProtocolVersion"] = value;
this["InhDefaultRdpVersion"] = value;
}
}
}

View File

@@ -725,10 +725,10 @@
<Setting Name="InhDefaultUseVmId" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ConDefaultRdpProtocolVersion" Type="System.String" Scope="User">
<Setting Name="ConDefaultRdpVersion" Type="System.String" Scope="User">
<Value Profile="(Default)">Highest</Value>
</Setting>
<Setting Name="InhDefaultRdpProtocolVersion" Type="System.Boolean" Scope="User">
<Setting Name="InhDefaultRdpVersion" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>

View File

@@ -19,7 +19,7 @@ namespace mRemoteNG {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Language {
@@ -5030,9 +5030,9 @@ namespace mRemoteNG {
/// <summary>
/// Looks up a localized string similar to Sets the version of RDP to use when opening connections..
/// </summary>
internal static string strPropertyDescriptionRdpProtocolVersion {
internal static string strPropertyDescriptionRdpVersion {
get {
return ResourceManager.GetString("strPropertyDescriptionRdpProtocolVersion", resourceCulture);
return ResourceManager.GetString("strPropertyDescriptionRdpVersion", resourceCulture);
}
}
@@ -5588,9 +5588,9 @@ namespace mRemoteNG {
/// <summary>
/// Looks up a localized string similar to RDP Version.
/// </summary>
internal static string strPropertyNameRdpProtocolVersion {
internal static string strPropertyNameRdpVersion {
get {
return ResourceManager.GetString("strPropertyNameRdpProtocolVersion", resourceCulture);
return ResourceManager.GetString("strPropertyNameRdpVersion", resourceCulture);
}
}

View File

@@ -2801,10 +2801,10 @@ Development Channel includes Alphas, Betas &amp; Release Candidates.</value>
<data name="TestSettings" xml:space="preserve">
<value>Test Settings</value>
</data>
<data name="strPropertyDescriptionRdpProtocolVersion" xml:space="preserve">
<data name="strPropertyDescriptionRdpVersion" xml:space="preserve">
<value>Sets the version of RDP to use when opening connections.</value>
</data>
<data name="strPropertyNameRdpProtocolVersion" xml:space="preserve">
<data name="strPropertyNameRdpVersion" xml:space="preserve">
<value>RDP Version</value>
</data>
<data name="strPropertyDescriptionUseVmId" xml:space="preserve">

View File

@@ -759,10 +759,10 @@
<setting name="InhDefaultUseVmId" serializeAs="String">
<value>False</value>
</setting>
<setting name="ConDefaultRdpProtocolVersion" serializeAs="String">
<setting name="ConDefaultRdpVersion" serializeAs="String">
<value>Highest</value>
</setting>
<setting name="InhDefaultRdpProtocolVersion" serializeAs="String">
<setting name="InhDefaultRdpVersion" serializeAs="String">
<value>False</value>
</setting>
</mRemoteNG.Settings>