diff --git a/.gitignore b/.gitignore
index 4485ecca..18a38611 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,9 +283,6 @@ Installer Projects/Installer/Fragments/HelpFilesFragment.wxs
InstallerProjects/Installer/Fragments/FilesFragment.wxs
InstallerProjects/Installer/Resources/License.rtf
-# user preference: .editorconfig - http://editorconfig.org/
-.editorconfig
-
# gh-pages info
runlocal.bat
/_site
\ No newline at end of file
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index d19bed2c..d5e5fe45 100644
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -10,9 +10,12 @@ Features/Enhancements:
#951: Added property to Enable/Disable Clipboard Sharing for RDP connections
#928: Add context menu items to 'Close all but this' and 'Close all tabs to the right'
#765: Port Scan Issues (single port scan option now available)
+#155: Replace MagicLibrary with DockPanelSuite
+#154: MR-139: Close Button on Each Tab - new default theme has a close button on each tab
Fixes:
------
+#1248: RemoveMagicLib Bugs - various bugs that cropped up as a result of removing magiclib
#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
diff --git a/Tools/appveyor_after_build.ps1 b/Tools/appveyor_after_build.ps1
index ec81233c..ab85ebd0 100644
--- a/Tools/appveyor_after_build.ps1
+++ b/Tools/appveyor_after_build.ps1
@@ -32,7 +32,7 @@ if ($ConfigurationName -eq "Release Portable") {
Write-Output "Creating portable ZIP file $($PortableZip)"
Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue
- & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip "mRemoteV1\bin\package\*.*"
+ & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip ".\mRemoteV1\bin\package\*.*"
}
else {
Write-Output "We will not zip anything - this isnt a portable release build."
diff --git a/Tools/cert/CodeSigning_Cert_mRemoteNG_DigiCert.p12.enc b/Tools/cert/CodeSigning_Cert_mRemoteNG_DigiCert.p12.enc
new file mode 100644
index 00000000..38538259
Binary files /dev/null and b/Tools/cert/CodeSigning_Cert_mRemoteNG_DigiCert.p12.enc differ
diff --git a/appveyor.yml b/appveyor.yml
index a8474cb1..9370b432 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -13,7 +13,7 @@ install:
- ps: >-
date
- C:\projects\mremoteng\mRemoteV1\Resources\CitrixReceiver.exe ENABLE_SSON="No" /silent /noreboot /EnableCEIP=false /AutoUpdateCheck=disabled /EnableTracing=false | out-null
+ mRemoteV1\Resources\CitrixReceiver.exe ENABLE_SSON="No" /silent /noreboot /EnableCEIP=false /AutoUpdateCheck=disabled /EnableTracing=false | out-null
date
before_build:
@@ -28,7 +28,7 @@ build:
parallel: true
verbosity: normal
after_build:
-- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Exit\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n$ConfigurationName = $Env:CONFIGURATION.Trim()\nWrite-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\n\n$SIGCHECK=\"Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"Tools\\7zip\\7za.exe\"\n\nif ($ConfigurationName -eq \"Release Portable\") {\n Write-Output \"Packaging Release Portable ZIP\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n $PortableZip=\"Release\\mRemoteNG-Portable-$($version).zip\"\n\n Remove-Item -Recurse \"mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\n New-Item \"mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n \n Copy-Item \"mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"mRemoteV1\\bin\\package\"\n\n Copy-Item \"mRemoteV1\\bin\\$ConfigurationName\\*\" -Destination \"mRemoteV1\\bin\\package\" -Recurse -Force \n Copy-Item \"*.txt\" -Destination \"mRemoteV1\\bin\\package\"\n\n Write-Output \"Creating portable ZIP file $($PortableZip)\"\n Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \"mRemoteV1\\bin\\package\\*.*\"\n}\nelse {\n Write-Output \"We will not zip anything - this isnt a portable release build.\"\n}\n\nWrite-Output \"\"\nWrite-Output \"\"\n\nif ($ConfigurationName -match \"Release\" -And $ConfigurationName -ne \"Release Installer\") {\n Write-Output \"Packaging debug symbols\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n if ($ConfigurationName -match \"Portable\") {\n $zipFilePrefix = \"mRemoteNG-Portable-symbols\"\n } else {\n $zipFilePrefix = \"mRemoteNG-symbols\"\n }\n\n $outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\n Write-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\n Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n $SymPath = (Join-Path -Path mRemoteV1\\bin\\$($ConfigurationName) -ChildPath \"*.pdb\")\n if(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n } else {\n Write-Output \"No Debugging Symbols Found...\"\n }\n \n}\nelse {\n Write-Output \"We will not package debug symbols for this configuration $($ConfigurationName)\"\n}\n\nWrite-Output \"\""
+- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Exit\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n$ConfigurationName = $Env:CONFIGURATION.Trim()\nWrite-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\n\n$SIGCHECK=\"Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"Tools\\7zip\\7za.exe\"\n\nif ($ConfigurationName -eq \"Release Portable\") {\n Write-Output \"Packaging Release Portable ZIP\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n $PortableZip=\"Release\\mRemoteNG-Portable-$($version).zip\"\n\n Remove-Item -Recurse \"mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\n New-Item \"mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n \n Copy-Item \"mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"mRemoteV1\\bin\\package\"\n\n Copy-Item \"mRemoteV1\\bin\\$ConfigurationName\\*\" -Destination \"mRemoteV1\\bin\\package\" -Recurse -Force \n Copy-Item \"*.txt\" -Destination \"mRemoteV1\\bin\\package\"\n\n Write-Output \"Creating portable ZIP file $($PortableZip)\"\n Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \".\\mRemoteV1\\bin\\package\\*.*\"\n}\nelse {\n Write-Output \"We will not zip anything - this isnt a portable release build.\"\n}\n\nWrite-Output \"\"\nWrite-Output \"\"\n\nif ($ConfigurationName -match \"Release\" -And $ConfigurationName -ne \"Release Installer\") {\n Write-Output \"Packaging debug symbols\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n if ($ConfigurationName -match \"Portable\") {\n $zipFilePrefix = \"mRemoteNG-Portable-symbols\"\n } else {\n $zipFilePrefix = \"mRemoteNG-symbols\"\n }\n\n $outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\n Write-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\n Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n $SymPath = (Join-Path -Path mRemoteV1\\bin\\$($ConfigurationName) -ChildPath \"*.pdb\")\n if(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n } else {\n Write-Output \"No Debugging Symbols Found...\"\n }\n \n}\nelse {\n Write-Output \"We will not package debug symbols for this configuration $($ConfigurationName)\"\n}\n\nWrite-Output \"\""
test:
assemblies:
only:
diff --git a/appveyor_publish.yml b/appveyor_publish.yml
new file mode 100644
index 00000000..d25aa074
--- /dev/null
+++ b/appveyor_publish.yml
@@ -0,0 +1,65 @@
+version: 1.76.{build}
+pull_requests:
+ do_not_increment_build_number: true
+environment:
+ cert_path: tools\cert\CodeSigning_Cert_mRemoteNG_DigiCert.p12
+ cert_decrypt_pwd:
+ secure: QK1ldldzIUSVA0u+OtbHixPmsXHAO9ksOKcyByq0FHM=
+ cert_pwd:
+ secure: Fni66m2OgoTxjRzahUNUUNHl5gGwTXLvXIMQYiOMqX8=
+image: Visual Studio 2017
+configuration:
+- Release Portable
+- Release
+- Release Installer
+platform: x86
+shallow_clone: true
+clone_depth: 1
+install:
+- ps: >-
+ iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
+
+ date
+
+ mRemoteV1\Resources\CitrixReceiver.exe ENABLE_SSON="No" /silent /noreboot /EnableCEIP=false /AutoUpdateCheck=disabled /EnableTracing=false | out-null
+
+ date
+before_build:
+- cmd: >-
+ echo %TIME%
+
+ nuget restore
+
+ echo %TIME%
+
+ appveyor-tools\secure-file -decrypt %cert_path%.enc -secret %cert_decrypt_pwd%
+build_script:
+ - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release Portable" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
+for:
+ -
+ matrix:
+ only:
+ - configuration: "Release Installer"
+ build_script:
+ - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release Installer" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
+ -
+ matrix:
+ only:
+ - configuration: Release
+ build_script:
+ - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
+after_build:
+- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Exit\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n$ConfigurationName = $Env:CONFIGURATION.Trim()\nWrite-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\n\n$SIGCHECK=\"Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"Tools\\7zip\\7za.exe\"\n\nif ($ConfigurationName -eq \"Release Portable\") {\n Write-Output \"Packaging Release Portable ZIP\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n $PortableZip=\"Release\\mRemoteNG-Portable-$($version).zip\"\n\n Remove-Item -Recurse \"mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\n New-Item \"mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n \n Copy-Item \"mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"mRemoteV1\\bin\\package\"\n\n Copy-Item \"mRemoteV1\\bin\\$ConfigurationName\\*\" -Destination \"mRemoteV1\\bin\\package\" -Recurse -Force \n Copy-Item \"*.txt\" -Destination \"mRemoteV1\\bin\\package\"\n\n Write-Output \"Creating portable ZIP file $($PortableZip)\"\n Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \".\\mRemoteV1\\bin\\package\\*.*\"\n}\nelse {\n Write-Output \"We will not zip anything - this isnt a portable release build.\"\n}\n\nWrite-Output \"\"\nWrite-Output \"\"\n\nif ($ConfigurationName -match \"Release\" -And $ConfigurationName -ne \"Release Installer\") {\n Write-Output \"Packaging debug symbols\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n if ($ConfigurationName -match \"Portable\") {\n $zipFilePrefix = \"mRemoteNG-Portable-symbols\"\n } else {\n $zipFilePrefix = \"mRemoteNG-symbols\"\n }\n\n $outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\n Write-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\n Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n $SymPath = (Join-Path -Path mRemoteV1\\bin\\$($ConfigurationName) -ChildPath \"*.pdb\")\n if(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n } else {\n Write-Output \"No Debugging Symbols Found...\"\n }\n \n}\nelse {\n Write-Output \"We will not package debug symbols for this configuration $($ConfigurationName)\"\n}\n\nWrite-Output \"\""
+test:
+ assemblies:
+ only:
+ - mRemoteNGTests\bin\$(configuration)\mRemoteNGTests.dll
+artifacts:
+- path: Release\*.msi
+ name: mRemoteNG-installer.msi
+- path: Release\mRemoteNG-Portable-1.*.zip
+ name: mRemoteNG-portable.zip
+- path: Release\mRemoteNG-Portable-symbols*.zip
+ name: mRemoteNG-Portable-symbols.zip
+- path: Release\mRemoteNG-symbols*.zip
+ name: mRemoteNG-symbols.zip
\ No newline at end of file
diff --git a/mRemoteNG.Specs/App.config b/mRemoteNG.Specs/App.config
index 7695b838..902fa1f5 100644
--- a/mRemoteNG.Specs/App.config
+++ b/mRemoteNG.Specs/App.config
@@ -7,7 +7,7 @@
-
+
diff --git a/mRemoteNGTests/Connection/Protocol/IntegratedProgramTests.cs b/mRemoteNGTests/Connection/Protocol/IntegratedProgramTests.cs
index 9c82b320..3ca439d3 100644
--- a/mRemoteNGTests/Connection/Protocol/IntegratedProgramTests.cs
+++ b/mRemoteNGTests/Connection/Protocol/IntegratedProgramTests.cs
@@ -52,8 +52,8 @@ namespace mRemoteNGTests.Connection.Protocol
private InterfaceControl BuildInterfaceControl(string extAppName, ProtocolBase sut)
{
var connectionWindow = new ConnectionWindow(new DockContent());
- var connectionInfo = new ConnectionInfo {ExtApp = extAppName};
- return new InterfaceControl(connectionWindow, sut, connectionInfo);
+ var connectionInfo = new ConnectionInfo {ExtApp = extAppName, Protocol = ProtocolType.IntApp};
+ return new InterfaceControl(connectionWindow, sut, connectionInfo);
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/.editorconfig b/mRemoteV1/.editorconfig
new file mode 100644
index 00000000..6071b846
--- /dev/null
+++ b/mRemoteV1/.editorconfig
@@ -0,0 +1,44 @@
+# top-most EditorConfig file
+root = true
+
+[*]
+end_of_line = crlf
+indent_style = space
+
+[*.xml]
+indent_size = 4
+
+[*.cs]
+indent_size = 4
+trim_trailing_whitespace = true
+charset = utf-8-bom
+
+# Organize usings
+dotnet_sort_system_directives_first = true
+
+# this. preferences
+dotnet_style_qualification_for_field = false:none
+dotnet_style_qualification_for_property = false:none
+dotnet_style_qualification_for_method = false:none
+dotnet_style_qualification_for_event = false:none
+
+# New line preferences
+csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
+csharp_new_line_between_query_expression_clauses = true
+
+# Space preferences
+csharp_space_after_cast = false
+csharp_space_between_method_call_parameter_list_parentheses = false
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_space_between_parentheses = false
+csharp_space_before_colon_in_inheritance_clause = true
+csharp_space_after_colon_in_inheritance_clause = true
+csharp_space_around_binary_operators = before_and_after
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
\ No newline at end of file
diff --git a/mRemoteV1/App/CompatibilityChecker.cs b/mRemoteV1/App/CompatibilityChecker.cs
index c26af6cd..a5a4d281 100644
--- a/mRemoteV1/App/CompatibilityChecker.cs
+++ b/mRemoteV1/App/CompatibilityChecker.cs
@@ -1,11 +1,11 @@
using Microsoft.Win32;
using mRemoteNG.App.Info;
-using mRemoteNG.UI.Forms;
using mRemoteNG.UI.TaskDialog;
using System;
using System.Diagnostics;
using System.Windows.Forms;
using mRemoteNG.Messages;
+using mRemoteNG.UI.Forms;
namespace mRemoteNG.App
{
@@ -19,13 +19,38 @@ namespace mRemoteNG.App
private static void CheckFipsPolicy(MessageCollector messageCollector)
{
+ if (Settings.Default.OverrideFIPSCheck)
+ {
+ messageCollector.AddMessage(MessageClass.InformationMsg, "OverrideFIPSCheck is set. Will skip check...",
+ true);
+ return;
+ }
+
messageCollector.AddMessage(MessageClass.InformationMsg, "Checking FIPS Policy...", true);
if (!FipsPolicyEnabledForServer2003() && !FipsPolicyEnabledForServer2008AndNewer()) return;
- var errorText = string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProductName,
- GeneralAppInfo.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
+
+ var errorText = string.Format(Language.strErrorFipsPolicyIncompatible, GeneralAppInfo.ProductName);
messageCollector.AddMessage(MessageClass.ErrorMsg, errorText, true);
- MessageBox.Show(FrmMain.Default, errorText);
- Environment.Exit(1);
+
+ //About to pop up a message, let's not block it...
+ FrmSplashScreen.getInstance().Close();
+
+ var ShouldIStayOrShouldIGo = CTaskDialog.MessageBox(Application.ProductName,
+ Language.strCompatibilityProblemDetected, errorText, "",
+ "",
+ Language.strCheckboxDoNotShowThisMessageAgain,
+ ETaskDialogButtons.OkCancel, ESysIcons.Warning,
+ ESysIcons.Warning);
+ if (CTaskDialog.VerificationChecked && ShouldIStayOrShouldIGo == DialogResult.OK)
+ {
+ messageCollector.AddMessage(MessageClass.ErrorMsg, "User requests that FIPS check be overridden", true);
+ Settings.Default.OverrideFIPSCheck = true;
+ Settings.Default.Save();
+ return;
+ }
+
+ if (ShouldIStayOrShouldIGo == DialogResult.Cancel)
+ Environment.Exit(1);
}
private static bool FipsPolicyEnabledForServer2003()
@@ -39,7 +64,8 @@ namespace mRemoteNG.App
private static bool FipsPolicyEnabledForServer2008AndNewer()
{
- var regKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy");
+ var regKey =
+ Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Lsa\\FIPSAlgorithmPolicy");
var fipsPolicy = regKey?.GetValue("Enabled");
if (fipsPolicy == null) return false;
fipsPolicy = Convert.ToInt32(fipsPolicy);
@@ -64,9 +90,14 @@ namespace mRemoteNG.App
}
if (proccesses.Length <= 0) return;
- CTaskDialog.MessageBox(Application.ProductName, Language.strCompatibilityProblemDetected, string.Format(Language.strCompatibilityLenovoAutoScrollUtilityDetected, Application.ProductName), "", "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok, ESysIcons.Warning, ESysIcons.Warning);
+ CTaskDialog.MessageBox(Application.ProductName, Language.strCompatibilityProblemDetected,
+ string.Format(Language.strCompatibilityLenovoAutoScrollUtilityDetected,
+ Application.ProductName), "",
+ "", Language.strCheckboxDoNotShowThisMessageAgain, ETaskDialogButtons.Ok,
+ ESysIcons.Warning,
+ ESysIcons.Warning);
if (CTaskDialog.VerificationChecked)
Settings.Default.CompatibilityWarnLenovoAutoScrollUtility = false;
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/App/Export.cs b/mRemoteV1/App/Export.cs
index 1bb2d7be..a973e2ae 100644
--- a/mRemoteV1/App/Export.cs
+++ b/mRemoteV1/App/Export.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Linq;
using System.Windows.Forms;
using mRemoteNG.Config.Connections;
@@ -17,92 +17,100 @@ using mRemoteNG.UI.Forms;
namespace mRemoteNG.App
{
- public static class Export
- {
+ public static class Export
+ {
public static void ExportToFile(ConnectionInfo selectedNode, IConnectionTreeModel connectionTreeModel)
- {
- try
- {
- var saveFilter = new SaveFilter();
-
- using (var exportForm = new ExportForm())
- {
- if (selectedNode?.GetTreeNodeType() == TreeNodeType.Container)
- exportForm.SelectedFolder = selectedNode as ContainerInfo;
- else if (selectedNode?.GetTreeNodeType() == TreeNodeType.Connection)
- {
- if (selectedNode.Parent.GetTreeNodeType() == TreeNodeType.Container)
- exportForm.SelectedFolder = selectedNode.Parent;
- exportForm.SelectedConnection = selectedNode;
- }
-
- if (exportForm.ShowDialog(FrmMain.Default) != DialogResult.OK)
- return;
+ {
+ try
+ {
+ var saveFilter = new SaveFilter();
- ConnectionInfo exportTarget;
- switch (exportForm.Scope)
- {
- case ExportForm.ExportScope.SelectedFolder:
- exportTarget = exportForm.SelectedFolder;
- break;
+ using (var exportForm = new ExportForm())
+ {
+ if (selectedNode?.GetTreeNodeType() == TreeNodeType.Container)
+ exportForm.SelectedFolder = selectedNode as ContainerInfo;
+ else if (selectedNode?.GetTreeNodeType() == TreeNodeType.Connection)
+ {
+ if (selectedNode.Parent.GetTreeNodeType() == TreeNodeType.Container)
+ exportForm.SelectedFolder = selectedNode.Parent;
+ exportForm.SelectedConnection = selectedNode;
+ }
+
+ if (exportForm.ShowDialog(FrmMain.Default) != DialogResult.OK)
+ return;
+
+ ConnectionInfo exportTarget;
+ switch (exportForm.Scope)
+ {
+ case ExportForm.ExportScope.SelectedFolder:
+ exportTarget = exportForm.SelectedFolder;
+ break;
case ExportForm.ExportScope.SelectedConnection:
- exportTarget = exportForm.SelectedConnection;
- break;
- default:
- exportTarget = connectionTreeModel.RootNodes.First(node => node is RootNodeInfo);
- break;
- }
-
- saveFilter.SaveUsername = exportForm.IncludeUsername;
- saveFilter.SavePassword = exportForm.IncludePassword;
- saveFilter.SaveDomain = exportForm.IncludeDomain;
- saveFilter.SaveInheritance = exportForm.IncludeInheritance;
- saveFilter.SaveCredentialId = exportForm.IncludeAssignedCredential;
-
- SaveExportFile(exportForm.FileName, exportForm.SaveFormat, saveFilter, exportTarget);
- }
-
- }
- catch (Exception ex)
- {
+ exportTarget = exportForm.SelectedConnection;
+ break;
+ default:
+ exportTarget = connectionTreeModel.RootNodes.First(node => node is RootNodeInfo);
+ break;
+ }
+
+ saveFilter.SaveUsername = exportForm.IncludeUsername;
+ saveFilter.SavePassword = exportForm.IncludePassword;
+ saveFilter.SaveDomain = exportForm.IncludeDomain;
+ saveFilter.SaveInheritance = exportForm.IncludeInheritance;
+ saveFilter.SaveCredentialId = exportForm.IncludeAssignedCredential;
+
+ SaveExportFile(exportForm.FileName, exportForm.SaveFormat, saveFilter, exportTarget);
+ }
+ }
+ catch (Exception ex)
+ {
Runtime.MessageCollector.AddExceptionMessage("App.Export.ExportToFile() failed.", ex);
- }
- }
-
- private static void SaveExportFile(string fileName, SaveFormat saveFormat, SaveFilter saveFilter, ConnectionInfo exportTarget)
- {
- try
- {
- ISerializer serializer;
- switch (saveFormat)
- {
- case SaveFormat.mRXML:
+ }
+ }
+
+ private static void SaveExportFile(string fileName,
+ SaveFormat saveFormat,
+ SaveFilter saveFilter,
+ ConnectionInfo exportTarget)
+ {
+ try
+ {
+ ISerializer serializer;
+ switch (saveFormat)
+ {
+ case SaveFormat.mRXML:
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
- var rootNode = exportTarget.GetRootParent() as RootNodeInfo;
+ var rootNode = exportTarget.GetRootParent() as RootNodeInfo;
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
- cryptographyProvider,
- rootNode?.PasswordString.ConvertToSecureString() ?? new RootNodeInfo(RootNodeType.Connection).PasswordString.ConvertToSecureString(),
- saveFilter);
- serializer = new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer);
- break;
- case SaveFormat.mRCSV:
+ cryptographyProvider,
+ rootNode?.PasswordString
+ .ConvertToSecureString() ??
+ new RootNodeInfo(RootNodeType
+ .Connection)
+ .PasswordString
+ .ConvertToSecureString(),
+ saveFilter);
+ serializer = new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer);
+ break;
+ case SaveFormat.mRCSV:
serializer = new CsvConnectionsSerializerMremotengFormat(saveFilter, Runtime.CredentialService.RepositoryList);
break;
- default:
- throw new ArgumentOutOfRangeException(nameof(saveFormat), saveFormat, null);
- }
- var serializedData = serializer.Serialize(exportTarget);
- var fileDataProvider = new FileDataProvider(fileName);
+ default:
+ throw new ArgumentOutOfRangeException(nameof(saveFormat), saveFormat, null);
+ }
+
+ var serializedData = serializer.Serialize(exportTarget);
+ var fileDataProvider = new FileDataProvider(fileName);
fileDataProvider.Save(serializedData);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace($"Export.SaveExportFile(\"{fileName}\") failed.", ex);
- }
- finally
- {
- Runtime.ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
- }
- }
- }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace($"Export.SaveExportFile(\"{fileName}\") failed.", ex);
+ }
+ finally
+ {
+ Runtime.ConnectionsService.RemoteConnectionsSyncronizer?.Enable();
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Import.cs b/mRemoteV1/App/Import.cs
index c700e3e0..4235c49b 100644
--- a/mRemoteV1/App/Import.cs
+++ b/mRemoteV1/App/Import.cs
@@ -45,8 +45,10 @@ namespace mRemoteNG.App
}
catch (Exception ex)
{
- MessageBox.Show(string.Format(Language.strImportFileFailedContent, fileName), Language.strImportFileFailedMainInstruction,
- MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
+ MessageBox.Show(string.Format(Language.strImportFileFailedContent, fileName),
+ Language.strImportFileFailedMainInstruction,
+ MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
+ MessageBoxDefaultButton.Button1);
Runtime.MessageCollector.AddExceptionMessage("Unable to import file.", ex);
}
}
@@ -60,7 +62,9 @@ namespace mRemoteNG.App
}
}
- public static void ImportFromActiveDirectory(string ldapPath, ContainerInfo importDestinationContainer, bool importSubOu)
+ public static void ImportFromActiveDirectory(string ldapPath,
+ ContainerInfo importDestinationContainer,
+ bool importSubOu)
{
try
{
@@ -73,7 +77,9 @@ namespace mRemoteNG.App
}
}
- public static void ImportFromPortScan(IEnumerable hosts, ProtocolType protocol, ContainerInfo importDestinationContainer)
+ public static void ImportFromPortScan(IEnumerable hosts,
+ ProtocolType protocol,
+ ContainerInfo importDestinationContainer)
{
try
{
diff --git a/mRemoteV1/App/Info/ConnectionsFileInfo.cs b/mRemoteV1/App/Info/ConnectionsFileInfo.cs
index 6017865f..36793e36 100644
--- a/mRemoteV1/App/Info/ConnectionsFileInfo.cs
+++ b/mRemoteV1/App/Info/ConnectionsFileInfo.cs
@@ -1,6 +1,6 @@
namespace mRemoteNG.App.Info
{
- public static class ConnectionsFileInfo
+ public static class ConnectionsFileInfo
{
public static readonly string DefaultConnectionsPath = SettingsFileInfo.SettingsPath;
public static readonly string DefaultConnectionsFile = "confCons.xml";
diff --git a/mRemoteV1/App/Info/GeneralAppInfo.cs b/mRemoteV1/App/Info/GeneralAppInfo.cs
index 17977389..fe424beb 100644
--- a/mRemoteV1/App/Info/GeneralAppInfo.cs
+++ b/mRemoteV1/App/Info/GeneralAppInfo.cs
@@ -9,46 +9,53 @@ using static System.Environment;
namespace mRemoteNG.App.Info
{
- public static class GeneralAppInfo
- {
- public const string UrlHome = "https://www.mremoteng.org/";
- public const string UrlDonate = "https://mremoteng.org/contribute/";
- public const string UrlForum = "https://www.reddit.com/r/mRemoteNG/";
- public const string UrlBugs = "https://bugs.mremoteng.org/";
- public static string ApplicationVersion = Application.ProductVersion;
+ public static class GeneralAppInfo
+ {
+ public const string UrlHome = "https://www.mremoteng.org/";
+ public const string UrlDonate = "https://mremoteng.org/contribute/";
+ public const string UrlForum = "https://www.reddit.com/r/mRemoteNG/";
+ public const string UrlBugs = "https://bugs.mremoteng.org/";
+ public static string ApplicationVersion = Application.ProductVersion;
public static readonly string ProductName = Application.ProductName;
- public static readonly string Copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright;
- public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
- //public static string ReportingFilePath = "";
- public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
- public static string UserAgent
- {
- get
- {
- var details = new List
- {
- "compatible",
- OSVersion.Platform == PlatformID.Win32NT
- ? $"Windows NT {OSVersion.Version.Major}.{OSVersion.Version.Minor}"
- : OSVersion.VersionString
- };
- if (Is64BitProcess)
- {
- details.Add("WOW64");
- }
- details.Add(Thread.CurrentThread.CurrentUICulture.Name);
- details.Add($".NET CLR {Environment.Version}");
- var detailsString = string.Join("; ", details.ToArray());
-
- return $"Mozilla/5.0 ({detailsString}) {ProductName}/{ApplicationVersion}";
- }
- }
- public static Version GetApplicationVersion()
- {
- Version v;
- System.Version.TryParse(ApplicationVersion, out v);
- return v;
- }
- }
+ public static readonly string Copyright =
+ ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(),
+ typeof(AssemblyCopyrightAttribute), false))
+ .Copyright;
+
+ public static readonly string HomePath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
+
+ //public static string ReportingFilePath = "";
+ public static readonly string PuttyPath = HomePath + "\\PuTTYNG.exe";
+
+ public static string UserAgent
+ {
+ get
+ {
+ var details = new List
+ {
+ "compatible",
+ OSVersion.Platform == PlatformID.Win32NT
+ ? $"Windows NT {OSVersion.Version.Major}.{OSVersion.Version.Minor}"
+ : OSVersion.VersionString
+ };
+ if (Is64BitProcess)
+ {
+ details.Add("WOW64");
+ }
+
+ details.Add(Thread.CurrentThread.CurrentUICulture.Name);
+ details.Add($".NET CLR {Environment.Version}");
+ var detailsString = string.Join("; ", details.ToArray());
+
+ return $"Mozilla/5.0 ({detailsString}) {ProductName}/{ApplicationVersion}";
+ }
+ }
+
+ public static Version GetApplicationVersion()
+ {
+ System.Version.TryParse(ApplicationVersion, out var v);
+ return v;
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Info/SettingsFileInfo.cs b/mRemoteV1/App/Info/SettingsFileInfo.cs
index a91d9497..e6007b9f 100644
--- a/mRemoteV1/App/Info/SettingsFileInfo.cs
+++ b/mRemoteV1/App/Info/SettingsFileInfo.cs
@@ -8,13 +8,22 @@ namespace mRemoteNG.App.Info
{
public static class SettingsFileInfo
{
- private static readonly string ExePath = Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConnectionInfo))?.Location);
+ private static readonly string ExePath =
+ Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConnectionInfo))?.Location);
+
+ public static string SettingsPath =>
+ Runtime.IsPortableEdition
+ ? ExePath
+ : Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName;
- public static string SettingsPath => Runtime.IsPortableEdition ? ExePath : Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName;
public static string LayoutFileName { get; } = "pnlLayout.xml";
public static string ExtAppsFilesName { get; } = "extApps.xml";
public static string ThemesFileName { get; } = "Themes.xml";
- public static string ThemeFolder { get; } = SettingsPath != null ? Path.Combine(SettingsPath, "Themes") : String.Empty;
- public static string InstalledThemeFolder { get; } = ExePath != null ? Path.Combine(ExePath, "Themes") : String.Empty;
+
+ public static string ThemeFolder { get; } =
+ SettingsPath != null ? Path.Combine(SettingsPath, "Themes") : String.Empty;
+
+ public static string InstalledThemeFolder { get; } =
+ ExePath != null ? Path.Combine(ExePath, "Themes") : String.Empty;
}
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Info/UpdateChannelInfo.cs b/mRemoteV1/App/Info/UpdateChannelInfo.cs
index e3b3f4e2..c5f3ec46 100644
--- a/mRemoteV1/App/Info/UpdateChannelInfo.cs
+++ b/mRemoteV1/App/Info/UpdateChannelInfo.cs
@@ -1,4 +1,5 @@
using System;
+
// ReSharper disable InconsistentNaming
namespace mRemoteNG.App.Info
@@ -27,7 +28,9 @@ namespace mRemoteNG.App.Info
private static string GetChannelFileName(string channel)
{
- return Runtime.IsPortableEdition ? GetChannelFileNamePortableEdition(channel) : GetChannelFileNameNormalEdition(channel);
+ return Runtime.IsPortableEdition
+ ? GetChannelFileNamePortableEdition(channel)
+ : GetChannelFileNameNormalEdition(channel);
}
private static string GetChannelFileNameNormalEdition(string channel)
@@ -62,7 +65,8 @@ namespace mRemoteNG.App.Info
private static Uri GetUpdateTxtUri(string channel)
{
- return new Uri(new Uri(Settings.Default.UpdateAddress), new Uri(GetChannelFileName(channel), UriKind.Relative));
+ return new Uri(new Uri(Settings.Default.UpdateAddress),
+ new Uri(GetChannelFileName(channel), UriKind.Relative));
}
private static bool IsValidChannel(string s)
diff --git a/mRemoteV1/App/Initialization/ConnectionIconLoader.cs b/mRemoteV1/App/Initialization/ConnectionIconLoader.cs
index f9282ff8..b9267f63 100644
--- a/mRemoteV1/App/Initialization/ConnectionIconLoader.cs
+++ b/mRemoteV1/App/Initialization/ConnectionIconLoader.cs
@@ -11,7 +11,7 @@ namespace mRemoteNG.App.Initialization
public ConnectionIconLoader(string folderPath)
{
- if(string.IsNullOrEmpty(folderPath))
+ if (string.IsNullOrEmpty(folderPath))
throw new ArgumentException($"{nameof(folderPath)} must be a valid folder path.");
_path = folderPath;
diff --git a/mRemoteV1/App/Initialization/CredsAndConsSetup.cs b/mRemoteV1/App/Initialization/CredsAndConsSetup.cs
index 14cfdbe1..77c5ad2b 100644
--- a/mRemoteV1/App/Initialization/CredsAndConsSetup.cs
+++ b/mRemoteV1/App/Initialization/CredsAndConsSetup.cs
@@ -14,7 +14,8 @@ namespace mRemoteNG.App.Initialization
{
connectionsOnEdit.Subscribe(connectionsService);
- if (Settings.Default.FirstStart && !Settings.Default.LoadConsFromCustomLocation && !File.Exists(connectionsService.GetStartupConnectionFileName()))
+ if (Settings.Default.FirstStart && !Settings.Default.LoadConsFromCustomLocation &&
+ !File.Exists(connectionsService.GetStartupConnectionFileName()))
connectionsService.NewConnectionsFile(connectionsService.GetStartupConnectionFileName());
credentialService.LoadRepositoryList();
diff --git a/mRemoteV1/App/Initialization/MessageCollectorSetup.cs b/mRemoteV1/App/Initialization/MessageCollectorSetup.cs
index 5f110cc7..faf6a394 100644
--- a/mRemoteV1/App/Initialization/MessageCollectorSetup.cs
+++ b/mRemoteV1/App/Initialization/MessageCollectorSetup.cs
@@ -8,7 +8,8 @@ namespace mRemoteNG.App.Initialization
{
public class MessageCollectorSetup
{
- public static void SetupMessageCollector(MessageCollector messageCollector, IList messageWriterList)
+ public static void SetupMessageCollector(MessageCollector messageCollector,
+ IList messageWriterList)
{
messageCollector.CollectionChanged += (o, args) =>
{
@@ -37,34 +38,37 @@ namespace mRemoteNG.App.Initialization
private static IMessageWriter BuildTextLogMessageWriter()
{
return new MessageTypeFilterDecorator(
- new LogMessageTypeFilteringOptions(),
- new TextLogMessageWriter(Logger.Instance)
- );
+ new LogMessageTypeFilteringOptions(),
+ new TextLogMessageWriter(Logger.Instance)
+ );
}
private static IMessageWriter BuildNotificationPanelMessageWriter()
{
-
return new OnlyLogMessageFilter(
- new MessageTypeFilterDecorator(
- new NotificationPanelMessageFilteringOptions(),
- new MessageFocusDecorator(
- Windows.ErrorsForm,
- new NotificationPanelSwitchOnMessageFilteringOptions(),
- new NotificationPanelMessageWriter(Windows.ErrorsForm)
- )
- )
- );
+ new MessageTypeFilterDecorator(
+ new
+ NotificationPanelMessageFilteringOptions(),
+ new MessageFocusDecorator(
+ Windows.ErrorsForm,
+ new
+ NotificationPanelSwitchOnMessageFilteringOptions(),
+ new
+ NotificationPanelMessageWriter(Windows
+ .ErrorsForm)
+ )
+ )
+ );
}
private static IMessageWriter BuildPopupMessageWriter()
{
return new OnlyLogMessageFilter(
- new MessageTypeFilterDecorator(
- new PopupMessageFilteringOptions(),
- new PopupMessageWriter()
- )
- );
+ new MessageTypeFilterDecorator(
+ new PopupMessageFilteringOptions(),
+ new PopupMessageWriter()
+ )
+ );
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Initialization/StartupDataLogger.cs b/mRemoteV1/App/Initialization/StartupDataLogger.cs
index e5ea3a23..d4bc791e 100644
--- a/mRemoteV1/App/Initialization/StartupDataLogger.cs
+++ b/mRemoteV1/App/Initialization/StartupDataLogger.cs
@@ -43,7 +43,8 @@ namespace mRemoteNG.App.Initialization
try
{
- foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True").Get())
+ foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True")
+ .Get())
{
var managementObject = (ManagementObject)o;
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
@@ -54,6 +55,7 @@ namespace mRemoteNG.App.Initialization
{
_messageCollector.AddExceptionMessage("Error retrieving operating system information from WMI.", ex);
}
+
var osData = string.Join(" ", osVersion, servicePack);
return osData;
}
@@ -65,6 +67,7 @@ namespace mRemoteNG.App.Initialization
{
servicePack = $"Service Pack {servicePackNumber}";
}
+
return servicePack;
}
@@ -73,7 +76,8 @@ namespace mRemoteNG.App.Initialization
var architecture = string.Empty;
try
{
- foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'").Get())
+ foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'")
+ .Get())
{
var managementObject = (ManagementObject)o;
var addressWidth = Convert.ToInt32(managementObject.GetPropertyValue("AddressWidth"));
@@ -84,6 +88,7 @@ namespace mRemoteNG.App.Initialization
{
_messageCollector.AddExceptionMessage("Error retrieving operating system address width from WMI.", ex);
}
+
return architecture;
}
@@ -110,7 +115,8 @@ namespace mRemoteNG.App.Initialization
private void LogCultureData()
{
- var data = $"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}";
+ var data =
+ $"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}";
_messageCollector.AddMessage(MessageClass.InformationMsg, data, true);
}
}
diff --git a/mRemoteV1/App/Logger.cs b/mRemoteV1/App/Logger.cs
index 4031e058..b39fffb4 100644
--- a/mRemoteV1/App/Logger.cs
+++ b/mRemoteV1/App/Logger.cs
@@ -4,11 +4,12 @@ using System.Windows.Forms;
using log4net;
using log4net.Appender;
using log4net.Config;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App
{
- public class Logger
+ public class Logger
{
public static readonly Logger Instance = new Logger();
@@ -42,6 +43,7 @@ namespace mRemoteNG.App
fileAppender.File = path;
fileAppender.ActivateOptions();
}
+
Log = LogManager.GetLogger("Logger");
}
@@ -56,7 +58,8 @@ namespace mRemoteNG.App
private static string GetLogPathNormalEdition()
{
- return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Application.ProductName);
+ return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+ Application.ProductName);
}
private static string GetLogPathPortableEdition()
diff --git a/mRemoteV1/App/NativeMethods.cs b/mRemoteV1/App/NativeMethods.cs
index aaac65bd..0e15954b 100644
--- a/mRemoteV1/App/NativeMethods.cs
+++ b/mRemoteV1/App/NativeMethods.cs
@@ -4,6 +4,7 @@ using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Text;
+#pragma warning disable 649
#pragma warning disable 169
namespace mRemoteNG.App
@@ -11,33 +12,41 @@ namespace mRemoteNG.App
public static class NativeMethods
{
#region Functions
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool AppendMenu(IntPtr hMenu, int uFlags, IntPtr uIDNewItem, string lpNewItem);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr CreatePopupMenu();
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
-
+ internal static extern IntPtr FindWindowEx(IntPtr parentHandle,
+ IntPtr childAfter,
+ string lclassName,
+ string windowTitle);
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr GetForegroundWindow();
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern bool InsertMenu(IntPtr hMenu, int uPosition, int uFlags, IntPtr uIDNewItem, string lpNewItem);
-
+ internal static extern bool InsertMenu(IntPtr hMenu,
+ int uPosition,
+ int uFlags,
+ IntPtr uIDNewItem,
+ string lpNewItem);
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int IsIconic(IntPtr hWnd);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam);
@@ -54,31 +63,38 @@ namespace mRemoteNG.App
internal static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, string lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
- internal static extern IntPtr SendMessage([In] IntPtr hWnd, [In] uint msg, [Out] StringBuilder wParam, [In] IntPtr lParam);
+ internal static extern IntPtr SendMessage([In] IntPtr hWnd,
+ [In] uint msg,
+ [Out] StringBuilder wParam,
+ [In] IntPtr lParam);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern bool SetMenuItemBitmaps(IntPtr hMenu, int uPosition, int uFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked);
-
+ internal static extern bool SetMenuItemBitmaps(IntPtr hMenu,
+ int uPosition,
+ int uFlags,
+ IntPtr hBitmapUnchecked,
+ IntPtr hBitmapChecked);
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
-
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern IntPtr WindowFromPoint(Point point);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder lpClassName, int nMaxCount);
+ internal static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern int GetDlgCtrlID(IntPtr hwndCtl);
@@ -92,9 +108,11 @@ namespace mRemoteNG.App
[DllImport("kernel32", SetLastError = true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static extern bool CloseHandle(IntPtr handle);
+
#endregion
#region Structures
+
[StructLayout(LayoutKind.Sequential)]
internal struct WINDOWPOS
{
@@ -130,60 +148,71 @@ namespace mRemoteNG.App
public long right;
public long bottom;
}
+
#endregion
#region Helpers
+
public static int MAKELONG(int wLow, int wHigh)
{
return wLow | wHigh << 16;
}
-
+
public static int MAKELPARAM(ref int wLow, ref int wHigh)
{
return MAKELONG(wLow, wHigh);
}
-
+
public static int LOWORD(int value)
{
return value & 0xFFFF;
}
-
+
public static int LOWORD(IntPtr value)
{
return LOWORD(value.ToInt32());
}
-
+
public static int HIWORD(int value)
{
return value >> 16;
}
-
+
public static int HIWORD(IntPtr value)
{
return HIWORD(value.ToInt32());
}
+
#endregion
#region Constants
+
public const int TRUE = 1;
#region GetWindowLong
+
public const int GWL_STYLE = (-16);
+
#endregion
#region AppendMenu / ModifyMenu / DeleteMenu / RemoveMenu
+
public const int MF_BYCOMMAND = 0x0;
public const int MF_BYPOSITION = 0x400;
public const int MF_STRING = 0x0;
public const int MF_POPUP = 0x10;
public const int MF_SEPARATOR = 0x800;
+
#endregion
#region WM_LBUTTONDOWN / WM_LBUTTONUP
+
public const int MK_LBUTTON = 0x1;
+
#endregion
#region ShowWindow
+
public const uint SW_HIDE = 0;
public const uint SW_SHOWNORMAL = 1;
public const uint SW_SHOWMINIMIZED = 2;
@@ -195,9 +224,11 @@ namespace mRemoteNG.App
public const uint SW_SHOWMINNOACTIVE = 7;
public const uint SW_SHOWNA = 8;
public const uint SW_RESTORE = 9;
+
#endregion
#region SetWindowPos / WM_WINDOWPOSCHANGING / WM_WINDOWPOSCHANGED
+
///
/// Retains the current size (ignores the cx and cy parameters).
///
@@ -269,12 +300,12 @@ namespace mRemoteNG.App
public const int SWP_NOCLIENTMOVE = 0x1000;
///
- /// Prevents generation of the WM_SYNCPAINT message.
+ /// Prevents generation of the WM_SYNCPAINT message.
///
public const int SWP_DEFERERASE = 0x2000;
///
- /// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
+ /// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
///
public const int SWP_ASYNCWINDOWPOS = 0x4000;
@@ -282,15 +313,19 @@ namespace mRemoteNG.App
///
///
public const int SWP_STATECHANGED = 0x8000;
+
#endregion
#region Window Placement Flags (WPF)
+
public const uint WPF_SETMINPOSITION = 0x1;
public const uint WPF_RESTORETOMAXIMIZED = 0x2;
public const uint WPF_ASYNCWINDOWPLACEMENT = 0x4;
+
#endregion
#region WM_ACTIVATE
+
///
///
///
@@ -303,14 +338,16 @@ namespace mRemoteNG.App
///
/// Sent to both the window being activated and the window being deactivated.
- /// If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the
- /// top-level window being deactivated, then to the window procedure of the top-level window being activated. If the
+ /// If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the
+ /// top-level window being deactivated, then to the window procedure of the top-level window being activated. If the
/// windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
///
public const int WA_CLICKACTIVE = 0x2;
+
#endregion
#region Window Messages
+
///
/// Sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
///
@@ -332,7 +369,7 @@ namespace mRemoteNG.App
public const int WM_SETTEXT = 0xC;
///
- /// Copies the text that corresponds to a window into a buffer provided by the caller.
+ /// Copies the text that corresponds to a window into a buffer provided by the caller.
///
public const int WM_GETTEXT = 0xD;
@@ -347,7 +384,7 @@ namespace mRemoteNG.App
public const int WM_ACTIVATEAPP = 0x1C;
///
- /// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
+ /// Sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
///
public const int WM_SETCURSOR = 0x20;
@@ -372,12 +409,12 @@ namespace mRemoteNG.App
public const int WM_WINDOWPOSCHANGED = 0x47;
///
- /// Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
+ /// Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
///
public const int WM_KEYDOWN = 0x100;
///
- /// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
+ /// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
///
public const int WM_KEYUP = 0x101;
@@ -432,7 +469,7 @@ namespace mRemoteNG.App
public const int WM_MBUTTONUP = 0x208;
///
- /// Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
///
public const int WM_XBUTTONDOWN = 0x20B;
@@ -447,47 +484,56 @@ namespace mRemoteNG.App
public const int WM_PARENTNOTIFY = 0x210;
///
- /// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
+ /// Sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
///
public const int WM_ENTERSIZEMOVE = 0x231;
///
- /// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
+ /// Sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
///
public const int WM_EXITSIZEMOVE = 0x232;
///
- /// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
+ /// Sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
///
public const int WM_DRAWCLIPBOARD = 0x308;
///
- /// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
+ /// Sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
///
public const int WM_CHANGECBCHAIN = 0x30D;
+
#endregion
#region Window Styles
+
public const int WS_MAXIMIZE = 0x1000000;
public const int WS_VISIBLE = 0x10000000;
public const int WS_CHILD = 0x40000000;
public const int WS_EX_MDICHILD = 0x40;
+
#endregion
#region Virtual Key Codes
+
public const int VK_CONTROL = 0x11;
public const int VK_C = 0x67;
+
#endregion
#region EM
+
public const uint ECM_FIRST = 0x1500;
public const uint EM_SETCUEBANNER = ECM_FIRST + 1;
public const uint EM_GETCUEBANNER = ECM_FIRST + 2;
+
#endregion
#region LB
+
public const int LB_ERR = -1;
public const int LB_SELECTSTRING = 0x18C;
+
#endregion
#region TCM
diff --git a/mRemoteV1/App/ProgramRoot.cs b/mRemoteV1/App/ProgramRoot.cs
index b2fcd4a7..5906d2e0 100644
--- a/mRemoteV1/App/ProgramRoot.cs
+++ b/mRemoteV1/App/ProgramRoot.cs
@@ -67,9 +67,12 @@ namespace mRemoteNG.App
var currentProcess = Process.GetCurrentProcess();
foreach (var enumeratedProcess in Process.GetProcessesByName(currentProcess.ProcessName))
{
- if (enumeratedProcess.Id != currentProcess.Id && enumeratedProcess.MainModule.FileName == currentProcess.MainModule.FileName && enumeratedProcess.MainWindowHandle != IntPtr.Zero)
+ if (enumeratedProcess.Id != currentProcess.Id &&
+ enumeratedProcess.MainModule.FileName == currentProcess.MainModule.FileName &&
+ enumeratedProcess.MainWindowHandle != IntPtr.Zero)
windowHandle = enumeratedProcess.MainWindowHandle;
}
+
return windowHandle;
}
diff --git a/mRemoteV1/App/Runtime.cs b/mRemoteV1/App/Runtime.cs
index 6aa27f0b..f404ae22 100644
--- a/mRemoteV1/App/Runtime.cs
+++ b/mRemoteV1/App/Runtime.cs
@@ -40,11 +40,16 @@ namespace mRemoteNG.App
public static MessageCollector MessageCollector { get; } = new MessageCollector();
public static NotificationAreaIcon NotificationAreaIcon { get; set; }
public static ExternalToolsService ExternalToolsService { get; } = new ExternalToolsService();
- public static SecureString EncryptionKey { get; set; } = new RootNodeInfo(RootNodeType.Connection).PasswordString.ConvertToSecureString();
+
+ public static SecureString EncryptionKey { get; set; } =
+ new RootNodeInfo(RootNodeType.Connection).PasswordString.ConvertToSecureString();
+
public static CredentialService CredentialService { get; } = new CredentialServiceFactory().Build();
+
public static ConnectionsService ConnectionsService { get; } = new ConnectionsService(PuttySessionsManager.Instance, CredentialService);
#region Connections Loading/Saving
+
public static void LoadConnectionsAsync()
{
var t = new Thread(LoadConnectionsBGd);
@@ -105,8 +110,14 @@ namespace mRemoteNG.App
if (Settings.Default.UseSQLServer)
{
MessageCollector.AddExceptionMessage(Language.strLoadFromSqlFailed, ex);
- var commandButtons = string.Join("|", Language.strCommandTryAgain, Language.strCommandOpenConnectionFile, string.Format(Language.strCommandExitProgram, Application.ProductName));
- CTaskDialog.ShowCommandBox(Application.ProductName, Language.strLoadFromSqlFailed, Language.strLoadFromSqlFailedContent, MiscTools.GetExceptionMessageRecursive(ex), "", "", commandButtons, false, ESysIcons.Error, ESysIcons.Error);
+ var commandButtons = string.Join("|", Language.strCommandTryAgain,
+ Language.strCommandOpenConnectionFile,
+ string.Format(Language.strCommandExitProgram,
+ Application.ProductName));
+ CTaskDialog.ShowCommandBox(Application.ProductName, Language.strLoadFromSqlFailed,
+ Language.strLoadFromSqlFailedContent,
+ MiscTools.GetExceptionMessageRecursive(ex), "", "",
+ commandButtons, false, ESysIcons.Error, ESysIcons.Error);
switch (CTaskDialog.CommandButtonResult)
{
case 0:
@@ -121,9 +132,13 @@ namespace mRemoteNG.App
return;
}
}
+
if (ex is FileNotFoundException && !withDialog)
{
- MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionFileName), ex, MessageClass.InformationMsg);
+ MessageCollector.AddExceptionMessage(
+ string.Format(Language.strConnectionsFileCouldNotBeLoadedNew,
+ connectionFileName), ex,
+ MessageClass.InformationMsg);
string[] commandButtons =
{
@@ -139,13 +154,13 @@ namespace mRemoteNG.App
try
{
CTaskDialog.ShowTaskDialogBox(
- GeneralAppInfo.ProductName,
- Language.ConnectionFileNotFound,
- "", "", "", "", "",
- string.Join(" | ", commandButtons),
- ETaskDialogButtons.None,
- ESysIcons.Question,
- ESysIcons.Question);
+ GeneralAppInfo.ProductName,
+ Language.ConnectionFileNotFound,
+ "", "", "", "", "",
+ string.Join(" | ", commandButtons),
+ ETaskDialogButtons.None,
+ ESysIcons.Question,
+ ESysIcons.Question);
switch (CTaskDialog.CommandButtonResult)
{
@@ -166,17 +181,24 @@ namespace mRemoteNG.App
Application.Exit();
answered = true;
break;
- }
+ }
}
catch (Exception exc)
{
- MessageCollector.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotBeLoadedNew, connectionFileName), exc, MessageClass.InformationMsg);
+ MessageCollector.AddExceptionMessage(
+ string
+ .Format(Language.strConnectionsFileCouldNotBeLoadedNew,
+ connectionFileName), exc,
+ MessageClass.InformationMsg);
}
}
+
return;
}
- MessageCollector.AddExceptionStackTrace(string.Format(Language.strConnectionsFileCouldNotBeLoaded, connectionFileName), ex);
+ MessageCollector.AddExceptionStackTrace(
+ string.Format(Language.strConnectionsFileCouldNotBeLoaded,
+ connectionFileName), ex);
if (connectionFileName != ConnectionsService.GetStartupConnectionFileName())
{
LoadConnections(withDialog);
@@ -184,12 +206,16 @@ namespace mRemoteNG.App
else
{
MessageBox.Show(FrmMain.Default,
- string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine, Application.ProductName, ConnectionsService.GetStartupConnectionFileName(), MiscTools.GetExceptionMessageRecursive(ex)),
- @"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ string.Format(Language.strErrorStartupConnectionFileLoad, Environment.NewLine,
+ Application.ProductName,
+ ConnectionsService.GetStartupConnectionFileName(),
+ MiscTools.GetExceptionMessageRecursive(ex)),
+ @"Could not load startup file.", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
}
+
#endregion
}
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Shutdown.cs b/mRemoteV1/App/Shutdown.cs
index 56977bba..817d451a 100644
--- a/mRemoteV1/App/Shutdown.cs
+++ b/mRemoteV1/App/Shutdown.cs
@@ -5,6 +5,7 @@ using System.Windows.Forms;
using mRemoteNG.Config.Putty;
using mRemoteNG.UI.Controls;
using mRemoteNG.UI.Forms;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.App
@@ -25,7 +26,10 @@ namespace mRemoteNG.App
ProgramRoot.CloseSingletonInstanceMutex();
}
- public static void Cleanup(Control quickConnectToolStrip, ExternalToolsToolStrip externalToolsToolStrip, MultiSshToolStrip multiSshToolStrip, FrmMain frmMain)
+ public static void Cleanup(Control quickConnectToolStrip,
+ ExternalToolsToolStrip externalToolsToolStrip,
+ MultiSshToolStrip multiSshToolStrip,
+ FrmMain frmMain)
{
try
{
@@ -58,9 +62,13 @@ namespace mRemoteNG.App
Runtime.ConnectionsService.SaveConnections();
}
- private static void SaveSettings(Control quickConnectToolStrip, ExternalToolsToolStrip externalToolsToolStrip, MultiSshToolStrip multiSshToolStrip, FrmMain frmMain)
+ private static void SaveSettings(Control quickConnectToolStrip,
+ ExternalToolsToolStrip externalToolsToolStrip,
+ MultiSshToolStrip multiSshToolStrip,
+ FrmMain frmMain)
{
- Config.Settings.SettingsSaver.SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip, frmMain);
+ Config.Settings.SettingsSaver.SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip,
+ frmMain);
}
private static void UnregisterBrowsers()
diff --git a/mRemoteV1/App/Startup.cs b/mRemoteV1/App/Startup.cs
index 77b62b94..531190bf 100644
--- a/mRemoteV1/App/Startup.cs
+++ b/mRemoteV1/App/Startup.cs
@@ -37,15 +37,16 @@ namespace mRemoteNG.App
public void InitializeProgram(MessageCollector messageCollector)
{
- Debug.Print("---------------------------" + Environment.NewLine + "[START] - " + Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));
+ Debug.Print("---------------------------" + Environment.NewLine + "[START] - " +
+ Convert.ToString(DateTime.Now, CultureInfo.InvariantCulture));
var startupLogger = new StartupDataLogger(messageCollector);
startupLogger.LogStartupData();
CompatibilityChecker.CheckCompatibility(messageCollector);
ParseCommandLineArgs(messageCollector);
IeBrowserEmulation.Register();
_connectionIconLoader.GetConnectionIcons();
- DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a=>"ConDefault"+a);
- DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a=>"InhDefault"+a);
+ DefaultConnectionInfo.Instance.LoadFrom(Settings.Default, a => "ConDefault" + a);
+ DefaultConnectionInheritance.Instance.LoadFrom(Settings.Default, a => "InhDefault" + a);
}
private static void ParseCommandLineArgs(MessageCollector messageCollector)
@@ -59,7 +60,8 @@ namespace mRemoteNG.App
messageCollector.AddMessage(MessageClass.DebugMsg, "Determining if we need a database syncronizer");
if (!Settings.Default.UseSQLServer) return;
messageCollector.AddMessage(MessageClass.DebugMsg, "Creating database syncronizer");
- Runtime.ConnectionsService.RemoteConnectionsSyncronizer = new RemoteConnectionsSyncronizer(new SqlConnectionsUpdateChecker());
+ Runtime.ConnectionsService.RemoteConnectionsSyncronizer =
+ new RemoteConnectionsSyncronizer(new SqlConnectionsUpdateChecker());
Runtime.ConnectionsService.RemoteConnectionsSyncronizer.Enable();
}
@@ -74,7 +76,12 @@ namespace mRemoteNG.App
return;
}
- var nextUpdateCheck = Convert.ToDateTime(Settings.Default.CheckForUpdatesLastCheck.Add(TimeSpan.FromDays(Convert.ToDouble(Settings.Default.CheckForUpdatesFrequencyDays))));
+ var nextUpdateCheck =
+ Convert.ToDateTime(Settings.Default.CheckForUpdatesLastCheck.Add(
+ TimeSpan
+ .FromDays(Convert.ToDouble(Settings
+ .Default
+ .CheckForUpdatesFrequencyDays))));
if (!Settings.Default.UpdatePending && DateTime.UtcNow < nextUpdateCheck)
{
return;
@@ -100,6 +107,7 @@ namespace mRemoteNG.App
{
return;
}
+
if (e.Error != null)
{
throw e.Error;
diff --git a/mRemoteV1/App/SupportedCultures.cs b/mRemoteV1/App/SupportedCultures.cs
index 37ebc34a..1ee52261 100644
--- a/mRemoteV1/App/SupportedCultures.cs
+++ b/mRemoteV1/App/SupportedCultures.cs
@@ -10,7 +10,7 @@ namespace mRemoteNG.App
{
[Serializable]
public sealed class SupportedCultures : Dictionary
- {
+ {
private static SupportedCultures _Instance;
private static SupportedCultures SingletonInstance
@@ -19,7 +19,7 @@ namespace mRemoteNG.App
}
- private SupportedCultures()
+ private SupportedCultures()
{
foreach (var CultureName in Settings.Default.SupportedUICultures.Split(','))
{
@@ -30,7 +30,8 @@ namespace mRemoteNG.App
}
catch (Exception ex)
{
- Debug.Print($"An exception occurred while adding the culture {CultureName} to the list of supported cultures. {ex.StackTrace}");
+ Debug.Print(
+ $"An exception occurred while adding the culture {CultureName} to the list of supported cultures. {ex.StackTrace}");
}
}
}
@@ -41,51 +42,52 @@ namespace mRemoteNG.App
throw new NotImplementedException();
}
- public static bool IsNameSupported(string CultureName)
- {
- return SingletonInstance.ContainsKey(CultureName);
- }
-
- public static bool IsNativeNameSupported(string CultureNativeName)
- {
- return SingletonInstance.ContainsValue(CultureNativeName);
- }
-
- public static string get_CultureName(string CultureNativeName)
- {
- var Names = new string[SingletonInstance.Count + 1];
- var NativeNames = new string[SingletonInstance.Count + 1];
+ public static bool IsNameSupported(string CultureName)
+ {
+ return SingletonInstance.ContainsKey(CultureName);
+ }
+
+ public static bool IsNativeNameSupported(string CultureNativeName)
+ {
+ return SingletonInstance.ContainsValue(CultureNativeName);
+ }
+
+ public static string get_CultureName(string CultureNativeName)
+ {
+ var Names = new string[SingletonInstance.Count + 1];
+ var NativeNames = new string[SingletonInstance.Count + 1];
SingletonInstance.Keys.CopyTo(Names, 0);
SingletonInstance.Values.CopyTo(NativeNames, 0);
-
- for (var Index = 0; Index <= SingletonInstance.Count; Index++)
- {
- if (NativeNames[Index] == CultureNativeName)
- {
- return Names[Index];
- }
- }
-
- throw (new KeyNotFoundException());
- }
-
- public static string get_CultureNativeName(string CultureName)
- {
- return SingletonInstance[CultureName];
- }
-
+
+ for (var Index = 0; Index <= SingletonInstance.Count; Index++)
+ {
+ if (NativeNames[Index] == CultureNativeName)
+ {
+ return Names[Index];
+ }
+ }
+
+ throw (new KeyNotFoundException());
+ }
+
+ public static string get_CultureNativeName(string CultureName)
+ {
+ return SingletonInstance[CultureName];
+ }
+
public static List CultureNativeNames
- {
- get
- {
- var ValueList = new List();
- foreach (var Value in SingletonInstance.Values)
- {
- ValueList.Add(Value);
- }
- return ValueList;
- }
- }
- }
+ {
+ get
+ {
+ var ValueList = new List();
+ foreach (var Value in SingletonInstance.Values)
+ {
+ ValueList.Add(Value);
+ }
+
+ return ValueList;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Update/AppUpdater.cs b/mRemoteV1/App/Update/AppUpdater.cs
index 2e728291..3532a596 100644
--- a/mRemoteV1/App/Update/AppUpdater.cs
+++ b/mRemoteV1/App/Update/AppUpdater.cs
@@ -10,8 +10,9 @@ using System.Security.Cryptography;
#if !PORTABLE
using mRemoteNG.Tools;
-#else
+#else
using System.Windows.Forms;
+
#endif
// ReSharper disable ArrangeAccessorOwnerBody
@@ -66,7 +67,12 @@ namespace mRemoteNG.App.Update
SetProxySettings(shouldWeUseProxy, proxyAddress, port, useAuthentication, username, password);
}
- public void SetProxySettings(bool useProxy, string address, int port, bool useAuthentication, string username, string password)
+ public void SetProxySettings(bool useProxy,
+ string address,
+ int port,
+ bool useAuthentication,
+ string username,
+ string password)
{
if (useProxy && !string.IsNullOrEmpty(address))
{
@@ -107,7 +113,8 @@ namespace mRemoteNG.App.Update
{
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
{
- throw new InvalidOperationException("CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling GetChangeLogAsync().");
+ throw new InvalidOperationException(
+ "CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling GetChangeLogAsync().");
}
if (IsGetChangeLogRunning)
@@ -131,27 +138,29 @@ namespace mRemoteNG.App.Update
if (CurrentUpdateInfo == null || !CurrentUpdateInfo.IsValid)
{
throw new InvalidOperationException(
- "CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling DownloadUpdateAsync().");
+ "CurrentUpdateInfo is not valid. GetUpdateInfoAsync() must be called before calling DownloadUpdateAsync().");
}
#if !PORTABLE
- CurrentUpdateInfo.UpdateFilePath = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), "msi"));
+ CurrentUpdateInfo.UpdateFilePath =
+ Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), "msi"));
#else
- var sfd = new SaveFileDialog
- {
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
+ var sfd = new SaveFileDialog
+ {
+ InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
FileName = CurrentUpdateInfo.FileName,
- RestoreDirectory = true
- };
- if (sfd.ShowDialog() == DialogResult.OK)
- {
+ RestoreDirectory = true
+ };
+ if (sfd.ShowDialog() == DialogResult.OK)
+ {
CurrentUpdateInfo.UpdateFilePath = sfd.FileName;
}
- else
- {
- return;
- }
+ else
+ {
+ return;
+ }
#endif
- DownloadUpdateWebClient.DownloadFileAsync(CurrentUpdateInfo.DownloadAddress, CurrentUpdateInfo.UpdateFilePath);
+ DownloadUpdateWebClient.DownloadFileAsync(CurrentUpdateInfo.DownloadAddress,
+ CurrentUpdateInfo.UpdateFilePath);
}
#endregion
@@ -191,7 +200,9 @@ namespace mRemoteNG.App.Update
}
private static DownloadStringCompletedEventArgs NewDownloadStringCompletedEventArgs(string result,
- Exception exception, bool cancelled, object userToken)
+ Exception exception,
+ bool cancelled,
+ object userToken)
{
var type = typeof(DownloadStringCompletedEventArgs);
const BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Instance;
@@ -201,7 +212,7 @@ namespace mRemoteNG.App.Update
if (constructor == null)
return null;
- return (DownloadStringCompletedEventArgs) constructor.Invoke(arguments);
+ return (DownloadStringCompletedEventArgs)constructor.Invoke(arguments);
}
private DownloadStringCompletedEventArgs DownloadString(Uri address)
@@ -326,11 +337,13 @@ namespace mRemoteNG.App.Update
{
add
{
- GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(GetUpdateInfoCompletedEventEvent, value);
+ GetUpdateInfoCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Combine(GetUpdateInfoCompletedEventEvent, value);
}
remove
{
- GetUpdateInfoCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(GetUpdateInfoCompletedEventEvent, value);
+ GetUpdateInfoCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Remove(GetUpdateInfoCompletedEventEvent, value);
}
}
@@ -340,11 +353,13 @@ namespace mRemoteNG.App.Update
{
add
{
- GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(GetChangeLogCompletedEventEvent, value);
+ GetChangeLogCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Combine(GetChangeLogCompletedEventEvent, value);
}
remove
{
- GetChangeLogCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(GetChangeLogCompletedEventEvent, value);
+ GetChangeLogCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Remove(GetChangeLogCompletedEventEvent, value);
}
}
@@ -354,11 +369,15 @@ namespace mRemoteNG.App.Update
{
add
{
- DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)Delegate.Combine(DownloadUpdateProgressChangedEventEvent, value);
+ DownloadUpdateProgressChangedEventEvent =
+ (DownloadProgressChangedEventHandler)Delegate.Combine(DownloadUpdateProgressChangedEventEvent,
+ value);
}
remove
{
- DownloadUpdateProgressChangedEventEvent = (DownloadProgressChangedEventHandler)Delegate.Remove(DownloadUpdateProgressChangedEventEvent, value);
+ DownloadUpdateProgressChangedEventEvent =
+ (DownloadProgressChangedEventHandler)Delegate.Remove(DownloadUpdateProgressChangedEventEvent,
+ value);
}
}
@@ -368,11 +387,13 @@ namespace mRemoteNG.App.Update
{
add
{
- DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Combine(DownloadUpdateCompletedEventEvent, value);
+ DownloadUpdateCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Combine(DownloadUpdateCompletedEventEvent, value);
}
remove
{
- DownloadUpdateCompletedEventEvent = (AsyncCompletedEventHandler)Delegate.Remove(DownloadUpdateCompletedEventEvent, value);
+ DownloadUpdateCompletedEventEvent =
+ (AsyncCompletedEventHandler)Delegate.Remove(DownloadUpdateCompletedEventEvent, value);
}
}
diff --git a/mRemoteV1/App/Update/UpdateFile.cs b/mRemoteV1/App/Update/UpdateFile.cs
index b5ea64e6..fae08418 100644
--- a/mRemoteV1/App/Update/UpdateFile.cs
+++ b/mRemoteV1/App/Update/UpdateFile.cs
@@ -7,12 +7,16 @@ namespace mRemoteNG.App.Update
public class UpdateFile
{
#region Public Properties
+
// ReSharper disable MemberCanBePrivate.Local
// ReSharper disable once MemberCanBePrivate.Global
- public Dictionary Items { get; } = new Dictionary(StringComparer.InvariantCultureIgnoreCase);
+ public Dictionary Items { get; } =
+ new Dictionary(StringComparer.InvariantCultureIgnoreCase);
+
#endregion
#region Public Methods
+
public UpdateFile(string content)
{
FromString(content);
@@ -24,8 +28,8 @@ namespace mRemoteNG.App.Update
{
if (string.IsNullOrEmpty(content)) return;
- char[] keyValueSeparators = { ':', '=' };
- char[] commentCharacters = { '#', ';', '\'' };
+ char[] keyValueSeparators = {':', '='};
+ char[] commentCharacters = {'#', ';', '\''};
// no separators means no valid update data...
if (content.Trim().IndexOfAny(keyValueSeparators) == -1) return;
@@ -47,7 +51,7 @@ namespace mRemoteNG.App.Update
continue;
// make sure we have valid data in both parts before adding to the collection. If either part is empty, then it's not valid data.
- if(string.IsNullOrEmpty(parts[0].Trim()) || string.IsNullOrEmpty(parts[1].Trim()))
+ if (string.IsNullOrEmpty(parts[0].Trim()) || string.IsNullOrEmpty(parts[1].Trim()))
continue;
Items.Add(parts[0].Trim(), parts[1].Trim());
@@ -83,13 +87,14 @@ namespace mRemoteNG.App.Update
{
var value = GetString("dURL");
var sv = value.Split('/');
- return sv[sv.Length-1];
+ return sv[sv.Length - 1];
}
public string GetChecksum(string key = "Checksum")
{
return GetString(key).Replace(" ", "").ToUpperInvariant();
}
+
#endregion
}
}
\ No newline at end of file
diff --git a/mRemoteV1/App/Update/UpdateInfo.cs b/mRemoteV1/App/Update/UpdateInfo.cs
index 9255ef16..0d2ad4c6 100644
--- a/mRemoteV1/App/Update/UpdateInfo.cs
+++ b/mRemoteV1/App/Update/UpdateInfo.cs
@@ -1,4 +1,5 @@
using System;
+
// ReSharper disable UnusedAutoPropertyAccessor.Local
namespace mRemoteNG.App.Update
@@ -43,6 +44,7 @@ namespace mRemoteNG.App.Update
newInfo.Checksum = updateFile.GetChecksum();
newInfo.IsValid = newInfo.CheckIfValid();
}
+
return newInfo;
}
@@ -50,11 +52,11 @@ namespace mRemoteNG.App.Update
{
if (string.IsNullOrEmpty(Version.ToString()))
return false;
- if(string.IsNullOrEmpty(DownloadAddress.AbsoluteUri))
+ if (string.IsNullOrEmpty(DownloadAddress.AbsoluteUri))
return false;
if (string.IsNullOrEmpty(ChangeLogAddress.AbsoluteUri))
return false;
-#if false
+#if false
if (string.IsNullOrEmpty(ImageAddress.AbsoluteUri))
return false;
if (string.IsNullOrEmpty(ImageLinkAddress.AbsoluteUri))
diff --git a/mRemoteV1/App/Windows.cs b/mRemoteV1/App/Windows.cs
index 6304b75b..d4ec8c9a 100644
--- a/mRemoteV1/App/Windows.cs
+++ b/mRemoteV1/App/Windows.cs
@@ -31,7 +31,6 @@ namespace mRemoteNG.App
internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow();
-
public static void Show(WindowType windowType)
{
try
@@ -55,6 +54,7 @@ namespace mRemoteNG.App
{
optionsForm.ShowDialog(dockPanel);
}
+
break;
case WindowType.SSHTransfer:
if (SshtransferForm == null || SshtransferForm.IsDisposed)
@@ -90,7 +90,8 @@ namespace mRemoteNG.App
_ultravncscForm.Show(dockPanel);
break;
case WindowType.ComponentsCheck:
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Showing ComponentsCheck window", true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Showing ComponentsCheck window", true);
if (_componentscheckForm == null || _componentscheckForm.IsDisposed)
_componentscheckForm = new ComponentsCheckWindow();
_componentscheckForm.Show(dockPanel);
diff --git a/mRemoteV1/Config/ConfirmCloseEnum.cs b/mRemoteV1/Config/ConfirmCloseEnum.cs
index b990822a..ff4e615e 100644
--- a/mRemoteV1/Config/ConfirmCloseEnum.cs
+++ b/mRemoteV1/Config/ConfirmCloseEnum.cs
@@ -1,11 +1,11 @@
namespace mRemoteNG.Config
{
- public enum ConfirmCloseEnum
- {
- Unspecified = 0,
- Never = 1,
- Exit = 2,
- Multiple = 3,
- All = 4
- }
+ public enum ConfirmCloseEnum
+ {
+ Unspecified = 0,
+ Never = 1,
+ Exit = 2,
+ Multiple = 3,
+ All = 4
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Connections/ConnectionsSavedEventArgs.cs b/mRemoteV1/Config/Connections/ConnectionsSavedEventArgs.cs
index 279adeec..a0067946 100644
--- a/mRemoteV1/Config/Connections/ConnectionsSavedEventArgs.cs
+++ b/mRemoteV1/Config/Connections/ConnectionsSavedEventArgs.cs
@@ -10,7 +10,10 @@ namespace mRemoteNG.Config.Connections
public bool UsingDatabase { get; }
public string ConnectionFileName { get; }
- public ConnectionsSavedEventArgs(IConnectionTreeModel modelThatWasSaved, bool previouslyUsingDatabase, bool usingDatabase, string connectionFileName)
+ public ConnectionsSavedEventArgs(IConnectionTreeModel modelThatWasSaved,
+ bool previouslyUsingDatabase,
+ bool usingDatabase,
+ string connectionFileName)
{
if (modelThatWasSaved == null)
throw new ArgumentNullException(nameof(modelThatWasSaved));
diff --git a/mRemoteV1/Config/Connections/Multiuser/ConnectionsUpdateAvailableEventArgs.cs b/mRemoteV1/Config/Connections/Multiuser/ConnectionsUpdateAvailableEventArgs.cs
index 4440d03c..589bd4db 100644
--- a/mRemoteV1/Config/Connections/Multiuser/ConnectionsUpdateAvailableEventArgs.cs
+++ b/mRemoteV1/Config/Connections/Multiuser/ConnectionsUpdateAvailableEventArgs.cs
@@ -3,7 +3,8 @@ using mRemoteNG.Config.DatabaseConnectors;
namespace mRemoteNG.Config.Connections.Multiuser
{
- public delegate void ConnectionsUpdateAvailableEventHandler(object sender, ConnectionsUpdateAvailableEventArgs args);
+ public delegate void
+ ConnectionsUpdateAvailableEventHandler(object sender, ConnectionsUpdateAvailableEventArgs args);
public class ConnectionsUpdateAvailableEventArgs : EventArgs
{
diff --git a/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs b/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs
index b336ad2d..c2545f98 100644
--- a/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs
+++ b/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs
@@ -27,7 +27,8 @@ namespace mRemoteNG.Config.Connections.Multiuser
{
_updateChecker.UpdateCheckStarted += OnUpdateCheckStarted;
_updateChecker.UpdateCheckFinished += OnUpdateCheckFinished;
- _updateChecker.ConnectionsUpdateAvailable += (sender, args) => ConnectionsUpdateAvailable?.Invoke(sender, args);
+ _updateChecker.ConnectionsUpdateAvailable +=
+ (sender, args) => ConnectionsUpdateAvailable?.Invoke(sender, args);
_updateTimer.Elapsed += (sender, args) => _updateChecker.IsUpdateAvailableAsync();
ConnectionsUpdateAvailable += Load;
}
@@ -81,6 +82,7 @@ namespace mRemoteNG.Config.Connections.Multiuser
Dispose(true);
GC.SuppressFinalize(this);
}
+
private void Dispose(bool itIsSafeToAlsoFreeManagedObjects)
{
if (!itIsSafeToAlsoFreeManagedObjects) return;
diff --git a/mRemoteV1/Config/Connections/Multiuser/SqlConnectionsUpdateChecker.cs b/mRemoteV1/Config/Connections/Multiuser/SqlConnectionsUpdateChecker.cs
index af3ab56f..66d8978e 100644
--- a/mRemoteV1/Config/Connections/Multiuser/SqlConnectionsUpdateChecker.cs
+++ b/mRemoteV1/Config/Connections/Multiuser/SqlConnectionsUpdateChecker.cs
@@ -48,9 +48,11 @@ namespace mRemoteNG.Config.Connections
{
_sqlConnector.Connect();
}
- catch(Exception e)
+ catch (Exception e)
{
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, "Unable to connect to Sql DB to check for updates." + Environment.NewLine + e.Message, true);
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ "Unable to connect to Sql DB to check for updates." +
+ Environment.NewLine + e.Message, true);
}
}
@@ -63,7 +65,9 @@ namespace mRemoteNG.Config.Connections
private bool CheckIfIAmTheLastOneUpdated(DateTime lastUpdateInDb)
{
- DateTime lastSqlUpdateWithoutMilliseconds = new DateTime(LastUpdateTime.Ticks - (LastUpdateTime.Ticks % TimeSpan.TicksPerSecond), LastUpdateTime.Kind);
+ DateTime lastSqlUpdateWithoutMilliseconds =
+ new DateTime(LastUpdateTime.Ticks - (LastUpdateTime.Ticks % TimeSpan.TicksPerSecond),
+ LastUpdateTime.Kind);
return lastUpdateInDb == lastSqlUpdateWithoutMilliseconds;
}
@@ -80,20 +84,25 @@ namespace mRemoteNG.Config.Connections
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, "Error executing Sql query to get updates from the DB." + Environment.NewLine + ex.Message, true);
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ "Error executing Sql query to get updates from the DB." +
+ Environment.NewLine + ex.Message, true);
}
+
_lastDatabaseUpdateTime = lastUpdateInDb;
return lastUpdateInDb;
}
public event EventHandler UpdateCheckStarted;
+
private void RaiseUpdateCheckStartedEvent()
{
UpdateCheckStarted?.Invoke(this, EventArgs.Empty);
}
public event UpdateCheckFinishedEventHandler UpdateCheckFinished;
+
private void RaiseUpdateCheckFinishedEvent(bool updateAvailable)
{
var args = new ConnectionsUpdateCheckFinishedEventArgs {UpdateAvailable = updateAvailable};
@@ -101,6 +110,7 @@ namespace mRemoteNG.Config.Connections
}
public event ConnectionsUpdateAvailableEventHandler ConnectionsUpdateAvailable;
+
private void RaiseConnectionsUpdateAvailableEvent()
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Remote connection update is available");
diff --git a/mRemoteV1/Config/Connections/SaveConnectionsOnEdit.cs b/mRemoteV1/Config/Connections/SaveConnectionsOnEdit.cs
index 58a1a9a0..229759ee 100644
--- a/mRemoteV1/Config/Connections/SaveConnectionsOnEdit.cs
+++ b/mRemoteV1/Config/Connections/SaveConnectionsOnEdit.cs
@@ -23,12 +23,15 @@ namespace mRemoteNG.Config.Connections
_connectionsService = null;
}
- private void ConnectionTreeModelOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
+ private void ConnectionTreeModelOnPropertyChanged(object sender,
+ PropertyChangedEventArgs propertyChangedEventArgs)
{
SaveConnectionOnEdit(propertyChangedEventArgs.PropertyName);
}
- private void ConnectionTreeModelOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
+ private void ConnectionTreeModelOnCollectionChanged(object sender,
+ NotifyCollectionChangedEventArgs
+ notifyCollectionChangedEventArgs)
{
SaveConnectionOnEdit();
}
diff --git a/mRemoteV1/Config/Connections/SaveFormat.cs b/mRemoteV1/Config/Connections/SaveFormat.cs
index 0ca1d9b0..fa577f41 100644
--- a/mRemoteV1/Config/Connections/SaveFormat.cs
+++ b/mRemoteV1/Config/Connections/SaveFormat.cs
@@ -7,4 +7,4 @@
mRCSV,
SQL
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs b/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
index f24442d9..56e36a75 100644
--- a/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
+++ b/mRemoteV1/Config/Connections/SqlConnectionsLoader.cs
@@ -19,17 +19,20 @@ namespace mRemoteNG.Config.Connections
{
public class SqlConnectionsLoader : IConnectionsLoader
{
- private readonly IDeserializer> _localConnectionPropertiesDeserializer;
+ private readonly IDeserializer>
+ _localConnectionPropertiesDeserializer;
+
private readonly IDataProvider _dataProvider;
public Func> AuthenticationRequestor { get; set; } =
() => MiscTools.PasswordDialog("", false);
public SqlConnectionsLoader(
- IDeserializer> localConnectionPropertiesDeserializer,
+ IDeserializer> localConnectionPropertiesDeserializer,
IDataProvider dataProvider)
{
- _localConnectionPropertiesDeserializer = localConnectionPropertiesDeserializer.ThrowIfNull(nameof(localConnectionPropertiesDeserializer));
+ _localConnectionPropertiesDeserializer =
+ localConnectionPropertiesDeserializer.ThrowIfNull(nameof(localConnectionPropertiesDeserializer));
_dataProvider = dataProvider.ThrowIfNull(nameof(dataProvider));
}
@@ -60,7 +63,9 @@ namespace mRemoteNG.Config.Connections
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
var cipherText = metaData.Protected;
var authenticator = new PasswordAuthenticator(cryptographyProvider, cipherText, AuthenticationRequestor);
- var authenticated = authenticator.Authenticate(new RootNodeInfo(RootNodeType.Connection).DefaultPassword.ConvertToSecureString());
+ var authenticated =
+ authenticator.Authenticate(new RootNodeInfo(RootNodeType.Connection).DefaultPassword
+ .ConvertToSecureString());
if (authenticated)
return authenticator.LastAuthenticatedPassword;
@@ -74,10 +79,10 @@ namespace mRemoteNG.Config.Connections
rootNode
.GetRecursiveChildList()
- .Join(localConnectionProperties,
- con => con.ConstantID,
- locals => locals.ConnectionId,
- (con, locals) => new {Connection = con, LocalProperties = locals})
+ .Join(localConnectionProperties,
+ con => con.ConstantID,
+ locals => locals.ConnectionId,
+ (con, locals) => new {Connection = con, LocalProperties = locals})
.ForEach(x =>
{
x.Connection.PleaseConnect = x.LocalProperties.Connected;
diff --git a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs
index 74186b37..ca05a2a1 100644
--- a/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs
+++ b/mRemoteV1/Config/Connections/SqlConnectionsSaver.cs
@@ -29,10 +29,10 @@ namespace mRemoteNG.Config.Connections
private readonly ISerializer, string> _localPropertiesSerializer;
private readonly IDataProvider _dataProvider;
- public SqlConnectionsSaver(
- SaveFilter saveFilter,
- ISerializer, string> localPropertieSerializer,
- IDataProvider localPropertiesDataProvider)
+ public SqlConnectionsSaver(SaveFilter saveFilter,
+ ISerializer, string>
+ localPropertieSerializer,
+ IDataProvider localPropertiesDataProvider)
{
if (saveFilter == null)
throw new ArgumentNullException(nameof(saveFilter));
@@ -49,14 +49,15 @@ namespace mRemoteNG.Config.Connections
if (PropertyIsLocalOnly(propertyNameTrigger))
{
- Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
- $"Property {propertyNameTrigger} is local only. Not saving to database.");
+ Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
+ $"Property {propertyNameTrigger} is local only. Not saving to database.");
return;
}
if (SqlUserIsReadOnly())
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Trying to save connection tree but the SQL read only checkbox is checked, aborting!");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Trying to save connection tree but the SQL read only checkbox is checked, aborting!");
return;
}
@@ -69,7 +70,8 @@ namespace mRemoteNG.Config.Connections
if (!databaseVersionVerifier.VerifyDatabaseVersion(metaData.ConfVersion))
{
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorConnectionListSaveFailed);
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strErrorConnectionListSaveFailed);
return;
}
@@ -137,22 +139,25 @@ namespace mRemoteNG.Config.Connections
{
sqlQuery =
new SqlCommand(
- "INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES(\'" +
- MiscTools.PrepareValueForDB(rootTreeNode.Name) + "\', 0, \'" + strProtected + "\'," +
- ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture) + ")",
- sqlDatabaseConnector.SqlConnection);
+ "INSERT INTO tblRoot (Name, Export, Protected, ConfVersion) VALUES(\'" +
+ MiscTools.PrepareValueForDB(rootTreeNode.Name) + "\', 0, \'" + strProtected + "\'," +
+ ConnectionsFileInfo.ConnectionFileVersion.ToString(CultureInfo.InvariantCulture) +
+ ")",
+ sqlDatabaseConnector.SqlConnection);
sqlQuery.ExecuteNonQuery();
}
else
{
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, $"UpdateRootNodeTable: rootTreeNode was null. Could not insert!");
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ $"UpdateRootNodeTable: rootTreeNode was null. Could not insert!");
}
}
private void UpdateConnectionsTable(RootNodeInfo rootTreeNode, SqlDatabaseConnector sqlDatabaseConnector)
{
var cryptoProvider = new LegacyRijndaelCryptographyProvider();
- var serializer = new DataTableSerializer(_saveFilter, cryptoProvider, rootTreeNode.PasswordString.ConvertToSecureString());
+ var serializer = new DataTableSerializer(_saveFilter, cryptoProvider,
+ rootTreeNode.PasswordString.ConvertToSecureString());
var dataTable = serializer.Serialize(rootTreeNode);
var dataProvider = new SqlDataProvider(sqlDatabaseConnector);
@@ -165,14 +170,16 @@ namespace mRemoteNG.Config.Connections
{
var sqlQuery = new SqlCommand("DELETE FROM tblUpdate", sqlDatabaseConnector.SqlConnection);
sqlQuery.ExecuteNonQuery();
- sqlQuery = new SqlCommand("INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + MiscTools.DBDate(DateTime.Now) + "\')", sqlDatabaseConnector.SqlConnection);
+ sqlQuery = new SqlCommand(
+ "INSERT INTO tblUpdate (LastUpdate) VALUES(\'" + MiscTools.DBDate(DateTime.Now) +
+ "\')",
+ sqlDatabaseConnector.SqlConnection);
sqlQuery.ExecuteNonQuery();
}
private bool SqlUserIsReadOnly()
{
return mRemoteNG.Settings.Default.SQLReadOnly;
-
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs b/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
index 2b064737..5eeedc00 100644
--- a/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
+++ b/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs
@@ -59,4 +59,4 @@ namespace mRemoteNG.Config.Connections
return password;
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Connections/XmlConnectionsSaver.cs b/mRemoteV1/Config/Connections/XmlConnectionsSaver.cs
index 7548f5ce..47aa229d 100644
--- a/mRemoteV1/Config/Connections/XmlConnectionsSaver.cs
+++ b/mRemoteV1/Config/Connections/XmlConnectionsSaver.cs
@@ -33,13 +33,17 @@ namespace mRemoteNG.Config.Connections
{
var cryptographyProvider = new CryptoProviderFactoryFromSettings().Build();
var connectionNodeSerializer = new XmlConnectionNodeSerializer27(
- cryptographyProvider,
- connectionTreeModel.RootNodes.OfType().First().PasswordString.ConvertToSecureString(),
- _saveFilter);
- var xmlConnectionsSerializer = new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer)
- {
- UseFullEncryption = mRemoteNG.Settings.Default.EncryptCompleteConnectionsFile
- };
+ cryptographyProvider,
+ connectionTreeModel
+ .RootNodes.OfType()
+ .First().PasswordString
+ .ConvertToSecureString(),
+ _saveFilter);
+ var xmlConnectionsSerializer =
+ new XmlConnectionsSerializer(cryptographyProvider, connectionNodeSerializer)
+ {
+ UseFullEncryption = mRemoteNG.Settings.Default.EncryptCompleteConnectionsFile
+ };
var xml = xmlConnectionsSerializer.Serialize(connectionTreeModel);
var fileDataProvider = new FileDataProviderWithRollingBackup(_connectionFileName);
@@ -51,4 +55,4 @@ namespace mRemoteNG.Config.Connections
}
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/CredentialRecordLoader.cs b/mRemoteV1/Config/CredentialRecordLoader.cs
index 8fe6d83e..f74525bd 100644
--- a/mRemoteV1/Config/CredentialRecordLoader.cs
+++ b/mRemoteV1/Config/CredentialRecordLoader.cs
@@ -13,7 +13,8 @@ namespace mRemoteNG.Config
private readonly IDataProvider _dataProvider;
private readonly ISecureDeserializer> _deserializer;
- public CredentialRecordLoader(IDataProvider dataProvider, ISecureDeserializer> deserializer)
+ public CredentialRecordLoader(IDataProvider dataProvider,
+ ISecureDeserializer> deserializer)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
diff --git a/mRemoteV1/Config/CredentialRecordSaver.cs b/mRemoteV1/Config/CredentialRecordSaver.cs
index 9a9b52d7..5f7d70ae 100644
--- a/mRemoteV1/Config/CredentialRecordSaver.cs
+++ b/mRemoteV1/Config/CredentialRecordSaver.cs
@@ -13,7 +13,8 @@ namespace mRemoteNG.Config
private readonly IDataProvider _dataProvider;
private readonly ISecureSerializer, string> _serializer;
- public CredentialRecordSaver(IDataProvider dataProvider, ISecureSerializer, string> serializer)
+ public CredentialRecordSaver(IDataProvider dataProvider,
+ ISecureSerializer, string> serializer)
{
if (dataProvider == null)
throw new ArgumentNullException(nameof(dataProvider));
diff --git a/mRemoteV1/Config/DataProviders/FileBackupCreator.cs b/mRemoteV1/Config/DataProviders/FileBackupCreator.cs
index 25b09b98..453eaeaf 100644
--- a/mRemoteV1/Config/DataProviders/FileBackupCreator.cs
+++ b/mRemoteV1/Config/DataProviders/FileBackupCreator.cs
@@ -14,12 +14,14 @@ namespace mRemoteNG.Config.DataProviders
if (WeDontNeedToBackup(fileName))
return;
- var backupFileName = string.Format(mRemoteNG.Settings.Default.BackupFileNameFormat, fileName, DateTime.Now);
+ var backupFileName =
+ string.Format(mRemoteNG.Settings.Default.BackupFileNameFormat, fileName, DateTime.Now);
File.Copy(fileName, backupFileName);
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionMessage(Language.strConnectionsFileBackupFailed, ex, MessageClass.WarningMsg);
+ Runtime.MessageCollector.AddExceptionMessage(Language.strConnectionsFileBackupFailed, ex,
+ MessageClass.WarningMsg);
throw;
}
}
diff --git a/mRemoteV1/Config/DataProviders/FileBackupPruner.cs b/mRemoteV1/Config/DataProviders/FileBackupPruner.cs
index 5572a345..a85ce1f9 100644
--- a/mRemoteV1/Config/DataProviders/FileBackupPruner.cs
+++ b/mRemoteV1/Config/DataProviders/FileBackupPruner.cs
@@ -20,8 +20,8 @@ namespace mRemoteNG.Config.DataProviders
return;
var filesToDelete = files
- .OrderByDescending(s => s)
- .Skip(maxBackupsToKeep);
+ .OrderByDescending(s => s)
+ .Skip(maxBackupsToKeep);
foreach (var file in filesToDelete)
{
diff --git a/mRemoteV1/Config/DataProviders/FileDataProvider.cs b/mRemoteV1/Config/DataProviders/FileDataProvider.cs
index 9a36c7f8..7cc85276 100644
--- a/mRemoteV1/Config/DataProviders/FileDataProvider.cs
+++ b/mRemoteV1/Config/DataProviders/FileDataProvider.cs
@@ -19,14 +19,14 @@ namespace mRemoteNG.Config.DataProviders
var fileContents = "";
try
{
- if (!File.Exists(FilePath))
- {
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, $"Could not load file. File does not exist '{FilePath}'");
- return "";
- }
-
fileContents = File.ReadAllText(FilePath);
}
+ catch (FileNotFoundException ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(
+ $"Could not load file. File does not exist '{FilePath}'",
+ ex);
+ }
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace($"Failed to load file {FilePath}", ex);
diff --git a/mRemoteV1/Config/DataProviders/IDataProvider.cs b/mRemoteV1/Config/DataProviders/IDataProvider.cs
index 1f665f17..b6e52988 100644
--- a/mRemoteV1/Config/DataProviders/IDataProvider.cs
+++ b/mRemoteV1/Config/DataProviders/IDataProvider.cs
@@ -1,5 +1,4 @@
-
-namespace mRemoteNG.Config.DataProviders
+namespace mRemoteNG.Config.DataProviders
{
public interface IDataProvider
{
diff --git a/mRemoteV1/Config/DataProviders/SqlDataProvider.cs b/mRemoteV1/Config/DataProviders/SqlDataProvider.cs
index cb70977c..4b8cbe69 100644
--- a/mRemoteV1/Config/DataProviders/SqlDataProvider.cs
+++ b/mRemoteV1/Config/DataProviders/SqlDataProvider.cs
@@ -34,7 +34,8 @@ namespace mRemoteNG.Config.DataProviders
{
if (SqlUserIsReadOnly())
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Trying to save connections but the SQL read only checkbox is checked, aborting!");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Trying to save connections but the SQL read only checkbox is checked, aborting!");
return;
}
@@ -62,7 +63,6 @@ namespace mRemoteNG.Config.DataProviders
private bool SqlUserIsReadOnly()
{
return mRemoteNG.Settings.Default.SQLReadOnly;
-
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/DatabaseConnectors/ConnectionTestResult.cs b/mRemoteV1/Config/DatabaseConnectors/ConnectionTestResult.cs
index 0426a2cd..23bcbbb5 100644
--- a/mRemoteV1/Config/DatabaseConnectors/ConnectionTestResult.cs
+++ b/mRemoteV1/Config/DatabaseConnectors/ConnectionTestResult.cs
@@ -8,4 +8,4 @@
CredentialsRejected,
UnknownError
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/DatabaseConnectors/DatabaseConnectorFactory.cs b/mRemoteV1/Config/DatabaseConnectors/DatabaseConnectorFactory.cs
index f8e8a149..39d7bcf4 100644
--- a/mRemoteV1/Config/DatabaseConnectors/DatabaseConnectorFactory.cs
+++ b/mRemoteV1/Config/DatabaseConnectors/DatabaseConnectorFactory.cs
@@ -15,4 +15,4 @@ namespace mRemoteNG.Config.DatabaseConnectors
return new SqlDatabaseConnector(sqlHost, sqlCatalog, sqlUsername, sqlPassword);
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnectionTester.cs b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnectionTester.cs
index 69c43375..2100920a 100644
--- a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnectionTester.cs
+++ b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnectionTester.cs
@@ -9,7 +9,10 @@ namespace mRemoteNG.Config.DatabaseConnectors
///
public class SqlDatabaseConnectionTester
{
- public async Task TestConnectivity(string server, string database, string username, string password)
+ public async Task TestConnectivity(string server,
+ string database,
+ string username,
+ string password)
{
using (var sqlConnector = new SqlDatabaseConnector(server, database, username, password))
{
@@ -35,4 +38,4 @@ namespace mRemoteNG.Config.DatabaseConnectors
}
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs
index 6aaeb413..e55bfb0a 100644
--- a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs
+++ b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs
@@ -8,7 +8,7 @@ namespace mRemoteNG.Config.DatabaseConnectors
{
public class SqlDatabaseConnector : IDatabaseConnector
{
- public SqlConnection SqlConnection { get; private set; } = default(SqlConnection);
+ public SqlConnection SqlConnection { get; private set; } = default(SqlConnection);
private string _sqlConnectionString = "";
private readonly string _sqlHost;
private readonly string _sqlCatalog;
@@ -45,7 +45,8 @@ namespace mRemoteNG.Config.DatabaseConnectors
private void BuildSqlConnectionStringWithCustomCredentials()
{
- _sqlConnectionString = $"Data Source={_sqlHost};Initial Catalog={_sqlCatalog};User Id={_sqlUsername};Password={_sqlPassword}";
+ _sqlConnectionString =
+ $"Data Source={_sqlHost};Initial Catalog={_sqlCatalog};User Id={_sqlUsername};Password={_sqlPassword}";
}
private void BuildSqlConnectionStringWithDefaultCredentials()
@@ -77,6 +78,7 @@ namespace mRemoteNG.Config.DatabaseConnectors
{
Dispose(true);
}
+
private void Dispose(bool itIsSafeToFreeManagedObjects)
{
if (!itIsSafeToFreeManagedObjects) return;
diff --git a/mRemoteV1/Config/Import/ActiveDirectoryImporter.cs b/mRemoteV1/Config/Import/ActiveDirectoryImporter.cs
index 9c59b385..32b1e9d9 100644
--- a/mRemoteV1/Config/Import/ActiveDirectoryImporter.cs
+++ b/mRemoteV1/Config/Import/ActiveDirectoryImporter.cs
@@ -7,29 +7,29 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Config.Import
{
- public class ActiveDirectoryImporter : IConnectionImporter
- {
+ public class ActiveDirectoryImporter : IConnectionImporter
+ {
public void Import(string ldapPath, ContainerInfo destinationContainer)
{
Import(ldapPath, destinationContainer, false);
}
- public static void Import(string ldapPath, ContainerInfo destinationContainer, bool importSubOu)
- {
- try
- {
- ldapPath.ThrowIfNullOrEmpty(nameof(ldapPath));
- var deserializer = new ActiveDirectoryDeserializer(ldapPath, importSubOu);
- var connectionTreeModel = deserializer.Deserialize();
+ public static void Import(string ldapPath, ContainerInfo destinationContainer, bool importSubOu)
+ {
+ try
+ {
+ ldapPath.ThrowIfNullOrEmpty(nameof(ldapPath));
+ var deserializer = new ActiveDirectoryDeserializer(ldapPath, importSubOu);
+ var connectionTreeModel = deserializer.Deserialize();
var importedRootNode = connectionTreeModel.RootNodes.First();
if (importedRootNode == null) return;
var childrenToAdd = importedRootNode.Children.ToArray();
destinationContainer.AddChildRange(childrenToAdd);
}
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex);
- }
- }
- }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Import/MRemoteNGCsvImporter.cs b/mRemoteV1/Config/Import/MRemoteNGCsvImporter.cs
index 3fe15c2f..810d0f84 100644
--- a/mRemoteV1/Config/Import/MRemoteNGCsvImporter.cs
+++ b/mRemoteV1/Config/Import/MRemoteNGCsvImporter.cs
@@ -20,7 +20,8 @@ namespace mRemoteNG.Config.Import
}
if (!File.Exists(filePath))
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, $"Unable to import file. File does not exist. Path: {filePath}");
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ $"Unable to import file. File does not exist. Path: {filePath}");
var dataProvider = new FileDataProvider(filePath);
var xmlString = dataProvider.Load();
@@ -34,7 +35,7 @@ namespace mRemoteNG.Config.Import
};
credentialImportForm.ShowDialog();
- var rootImportContainer = new ContainerInfo { Name = Path.GetFileNameWithoutExtension(filePath) };
+ var rootImportContainer = new ContainerInfo {Name = Path.GetFileNameWithoutExtension(filePath)};
rootImportContainer.AddChildRange(serializationResult.ConnectionRecords);
destinationContainer.AddChild(rootImportContainer);
}
diff --git a/mRemoteV1/Config/Import/MRemoteNGXmlImporter.cs b/mRemoteV1/Config/Import/MRemoteNGXmlImporter.cs
index 19a62964..5a014e06 100644
--- a/mRemoteV1/Config/Import/MRemoteNGXmlImporter.cs
+++ b/mRemoteV1/Config/Import/MRemoteNGXmlImporter.cs
@@ -10,28 +10,29 @@ using mRemoteNG.Messages;
namespace mRemoteNG.Config.Import
{
- // ReSharper disable once InconsistentNaming
- public class MRemoteNGXmlImporter : IConnectionImporter
- {
- public void Import(string fileName, ContainerInfo destinationContainer)
- {
- if (fileName == null)
- {
+ // ReSharper disable once InconsistentNaming
+ public class MRemoteNGXmlImporter : IConnectionImporter
+ {
+ public void Import(string fileName, ContainerInfo destinationContainer)
+ {
+ if (fileName == null)
+ {
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "Unable to import file. File path is null.");
return;
}
- if(!File.Exists(fileName))
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, $"Unable to import file. File does not exist. Path: {fileName}");
+ if (!File.Exists(fileName))
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ $"Unable to import file. File does not exist. Path: {fileName}");
- var dataProvider = new FileDataProvider(fileName);
- var xmlString = dataProvider.Load();
- var xmlConnectionsDeserializer = new XmlConnectionsDeserializer();
+ var dataProvider = new FileDataProvider(fileName);
+ var xmlString = dataProvider.Load();
+ var xmlConnectionsDeserializer = new XmlConnectionsDeserializer();
var serializationResult = xmlConnectionsDeserializer.Deserialize(xmlString, true);
- var rootImportContainer = new ContainerInfo { Name = Path.GetFileNameWithoutExtension(fileName) };
+ var rootImportContainer = new ContainerInfo {Name = Path.GetFileNameWithoutExtension(fileName)};
rootImportContainer.AddChildRange(serializationResult.ConnectionRecords);
- destinationContainer.AddChild(rootImportContainer);
+ destinationContainer.AddChild(rootImportContainer);
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Import/PortScanImporter.cs b/mRemoteV1/Config/Import/PortScanImporter.cs
index aa0c9442..738710f1 100644
--- a/mRemoteV1/Config/Import/PortScanImporter.cs
+++ b/mRemoteV1/Config/Import/PortScanImporter.cs
@@ -8,18 +8,18 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Config.Import
{
- public class PortScanImporter : IConnectionImporter>
- {
- private readonly ProtocolType _targetProtocolType;
+ public class PortScanImporter : IConnectionImporter>
+ {
+ private readonly ProtocolType _targetProtocolType;
- public PortScanImporter(ProtocolType targetProtocolType)
- {
- _targetProtocolType = targetProtocolType;
- }
+ public PortScanImporter(ProtocolType targetProtocolType)
+ {
+ _targetProtocolType = targetProtocolType;
+ }
public void Import(IEnumerable hosts, ContainerInfo destinationContainer)
- {
- var deserializer = new PortScanDeserializer(_targetProtocolType);
+ {
+ var deserializer = new PortScanDeserializer(_targetProtocolType);
var connectionTreeModel = deserializer.Deserialize(hosts);
var importedRootNode = connectionTreeModel.RootNodes.First();
@@ -27,5 +27,5 @@ namespace mRemoteNG.Config.Import
var childrenToAdd = importedRootNode.Children.ToArray();
destinationContainer.AddChildRange(childrenToAdd);
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Import/PuttyConnectionManagerImporter.cs b/mRemoteV1/Config/Import/PuttyConnectionManagerImporter.cs
index 3f20f813..b6a9358f 100644
--- a/mRemoteV1/Config/Import/PuttyConnectionManagerImporter.cs
+++ b/mRemoteV1/Config/Import/PuttyConnectionManagerImporter.cs
@@ -5,10 +5,10 @@ using mRemoteNG.Container;
namespace mRemoteNG.Config.Import
{
- public class PuttyConnectionManagerImporter : IConnectionImporter
- {
+ public class PuttyConnectionManagerImporter : IConnectionImporter
+ {
public void Import(string filePath, ContainerInfo destinationContainer)
- {
+ {
var dataProvider = new FileDataProvider(filePath);
var xmlContent = dataProvider.Load();
@@ -17,5 +17,5 @@ namespace mRemoteNG.Config.Import
destinationContainer.AddChildRange(serializationResult.ConnectionRecords);
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Import/RemoteDesktopConnectionImporter.cs b/mRemoteV1/Config/Import/RemoteDesktopConnectionImporter.cs
index fbea3414..a0a763f3 100644
--- a/mRemoteV1/Config/Import/RemoteDesktopConnectionImporter.cs
+++ b/mRemoteV1/Config/Import/RemoteDesktopConnectionImporter.cs
@@ -7,10 +7,10 @@ using mRemoteNG.Container;
namespace mRemoteNG.Config.Import
{
- public class RemoteDesktopConnectionImporter : IConnectionImporter
- {
+ public class RemoteDesktopConnectionImporter : IConnectionImporter
+ {
public void Import(string fileName, ContainerInfo destinationContainer)
- {
+ {
var dataProvider = new FileDataProvider(fileName);
var content = dataProvider.Load();
@@ -18,10 +18,10 @@ namespace mRemoteNG.Config.Import
var serializationResult = deserializer.Deserialize(content);
var importedConnection = serializationResult.ConnectionRecords.FirstOrDefault();
-
+
if (importedConnection == null) return;
importedConnection.Name = Path.GetFileNameWithoutExtension(fileName);
destinationContainer.AddChild(importedConnection);
- }
+ }
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Import/RemoteDesktopConnectionManagerImporter.cs b/mRemoteV1/Config/Import/RemoteDesktopConnectionManagerImporter.cs
index a7f173b2..ab709c84 100644
--- a/mRemoteV1/Config/Import/RemoteDesktopConnectionManagerImporter.cs
+++ b/mRemoteV1/Config/Import/RemoteDesktopConnectionManagerImporter.cs
@@ -5,10 +5,10 @@ using mRemoteNG.Container;
namespace mRemoteNG.Config.Import
{
- public class RemoteDesktopConnectionManagerImporter : IConnectionImporter
- {
- public void Import(string filePath, ContainerInfo destinationContainer)
- {
+ public class RemoteDesktopConnectionManagerImporter : IConnectionImporter
+ {
+ public void Import(string filePath, ContainerInfo destinationContainer)
+ {
var dataProvider = new FileDataProvider(filePath);
var fileContent = dataProvider.Load();
@@ -17,5 +17,5 @@ namespace mRemoteNG.Config.Import
destinationContainer.AddChildRange(serializationResult.ConnectionRecords);
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs
index 2c5d55c6..38da3533 100644
--- a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs
+++ b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs
@@ -5,37 +5,42 @@ using System.Web;
using mRemoteNG.Connection;
using mRemoteNG.Tree.Root;
using System.Text;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Config.Putty
{
public abstract class AbstractPuttySessionsProvider
- {
+ {
public virtual RootPuttySessionsNodeInfo RootInfo { get; } = new RootPuttySessionsNodeInfo();
+
protected virtual List Sessions
{
get { return RootInfo.Children.OfType().ToList(); }
}
- #region Public Methods
+ #region Public Methods
+
public abstract string[] GetSessionNames(bool raw = false);
- public abstract PuttySessionInfo GetSession(string sessionName);
-
- public virtual IEnumerable GetSessions()
- {
- var sessionNamesFromProvider = GetSessionNames(true);
+ public abstract PuttySessionInfo GetSession(string sessionName);
+
+ public virtual IEnumerable GetSessions()
+ {
+ var sessionNamesFromProvider = GetSessionNames(true);
foreach (var sessionName in GetSessionNamesToAdd(sessionNamesFromProvider))
- {
- var sessionInfo = GetSession(sessionName);
- AddSession(sessionInfo);
- }
- foreach (var session in GetSessionToRemove(sessionNamesFromProvider))
- {
- RemoveSession(session);
- }
+ {
+ var sessionInfo = GetSession(sessionName);
+ AddSession(sessionInfo);
+ }
+
+ foreach (var session in GetSessionToRemove(sessionNamesFromProvider))
+ {
+ RemoveSession(session);
+ }
+
RootInfo.SortRecursive();
- return Sessions;
- }
+ return Sessions;
+ }
private IEnumerable GetSessionNamesToAdd(IEnumerable sessionNamesFromProvider)
{
@@ -47,7 +52,9 @@ namespace mRemoteNG.Config.Putty
private IEnumerable GetSessionToRemove(IEnumerable sessionNamesFromProvider)
{
var currentlyKnownSessionNames = Sessions.Select(session => session.Name);
- var normalizedSessionNames = sessionNamesFromProvider.Select(name => HttpUtility.UrlDecode(name, Encoding.GetEncoding("iso-8859-1")));
+ var normalizedSessionNames =
+ sessionNamesFromProvider.Select(name =>
+ HttpUtility.UrlDecode(name, Encoding.GetEncoding("iso-8859-1")));
var sessionNamesToRemove = currentlyKnownSessionNames.Except(normalizedSessionNames);
return Sessions.Where(session => sessionNamesToRemove.Contains(session.Name));
}
@@ -57,29 +64,43 @@ namespace mRemoteNG.Config.Putty
if (string.IsNullOrEmpty(sessionInfo?.Name) || Sessions.Any(child => child.Name == sessionInfo.Name))
return;
RootInfo.AddChild(sessionInfo);
- RaisePuttySessionCollectionChangedEvent(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, sessionInfo));
+ RaisePuttySessionCollectionChangedEvent(
+ new
+ NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add,
+ sessionInfo));
}
protected virtual void RemoveSession(PuttySessionInfo sessionInfo)
{
if (!Sessions.Contains(sessionInfo)) return;
RootInfo.RemoveChild(sessionInfo);
- RaisePuttySessionCollectionChangedEvent(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, sessionInfo));
+ RaisePuttySessionCollectionChangedEvent(
+ new
+ NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove,
+ sessionInfo));
}
-
- public virtual void StartWatcher() { }
-
- public virtual void StopWatcher() { }
+
+ public virtual void StartWatcher()
+ {
+ }
+
+ public virtual void StopWatcher()
+ {
+ }
+
#endregion
-
- public delegate void PuttySessionChangedEventHandler(object sender, PuttySessionChangedEventArgs e);
+
+ public delegate void PuttySessionChangedEventHandler(object sender, PuttySessionChangedEventArgs e);
+
public event PuttySessionChangedEventHandler PuttySessionChanged;
- protected virtual void RaiseSessionChangedEvent(PuttySessionChangedEventArgs args)
- {
+
+ protected virtual void RaiseSessionChangedEvent(PuttySessionChangedEventArgs args)
+ {
PuttySessionChanged?.Invoke(this, args);
- }
+ }
public event NotifyCollectionChangedEventHandler PuttySessionsCollectionChanged;
+
protected void RaisePuttySessionCollectionChangedEvent(NotifyCollectionChangedEventArgs args)
{
PuttySessionsCollectionChanged?.Invoke(this, args);
diff --git a/mRemoteV1/Config/Putty/PuttySessionsManager.cs b/mRemoteV1/Config/Putty/PuttySessionsManager.cs
index 72e9a1ce..4286e60d 100644
--- a/mRemoteV1/Config/Putty/PuttySessionsManager.cs
+++ b/mRemoteV1/Config/Putty/PuttySessionsManager.cs
@@ -3,74 +3,80 @@ using System.Collections.Specialized;
using System.ComponentModel;
using mRemoteNG.Tools;
using mRemoteNG.Tree.Root;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Config.Putty
{
public class PuttySessionsManager
- {
+ {
public static PuttySessionsManager Instance { get; } = new PuttySessionsManager();
private readonly List _providers = new List();
+
public IEnumerable Providers
{
get { return _providers; }
}
- public List RootPuttySessionsNodes { get; } = new List();
+ public List RootPuttySessionsNodes { get; } = new List();
- private PuttySessionsManager()
- {
- AddProvider(new PuttySessionsRegistryProvider());
+ private PuttySessionsManager()
+ {
+ AddProvider(new PuttySessionsRegistryProvider());
AddProvider(new PuttySessionsXmingProvider());
- }
+ }
#region Public Methods
- public void AddSessions()
- {
- foreach (var provider in Providers)
- {
- AddSessionsFromProvider(provider);
- }
- }
- private void AddSessionsFromProvider(AbstractPuttySessionsProvider puttySessionProvider)
- {
- puttySessionProvider.ThrowIfNull(nameof(puttySessionProvider));
+ public void AddSessions()
+ {
+ foreach (var provider in Providers)
+ {
+ AddSessionsFromProvider(provider);
+ }
+ }
+
+ private void AddSessionsFromProvider(AbstractPuttySessionsProvider puttySessionProvider)
+ {
+ puttySessionProvider.ThrowIfNull(nameof(puttySessionProvider));
var rootTreeNode = puttySessionProvider.RootInfo;
- puttySessionProvider.GetSessions();
+ puttySessionProvider.GetSessions();
if (!RootPuttySessionsNodes.Contains(rootTreeNode) && rootTreeNode.HasChildren())
RootPuttySessionsNodes.Add(rootTreeNode);
rootTreeNode.SortRecursive();
}
-
- public void StartWatcher()
- {
- foreach (var provider in Providers)
- {
- provider.StartWatcher();
- provider.PuttySessionChanged += PuttySessionChanged;
- }
- }
-
- public void StopWatcher()
- {
- foreach (var provider in Providers)
- {
- provider.StopWatcher();
- provider.PuttySessionChanged -= PuttySessionChanged;
- }
- }
+
+ public void StartWatcher()
+ {
+ foreach (var provider in Providers)
+ {
+ provider.StartWatcher();
+ provider.PuttySessionChanged += PuttySessionChanged;
+ }
+ }
+
+ public void StopWatcher()
+ {
+ foreach (var provider in Providers)
+ {
+ provider.StopWatcher();
+ provider.PuttySessionChanged -= PuttySessionChanged;
+ }
+ }
public void AddProvider(AbstractPuttySessionsProvider newProvider)
{
if (_providers.Contains(newProvider)) return;
_providers.Add(newProvider);
newProvider.PuttySessionsCollectionChanged += RaisePuttySessionCollectionChangedEvent;
- RaiseSessionProvidersCollectionChangedEvent(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, newProvider));
+ RaiseSessionProvidersCollectionChangedEvent(
+ new
+ NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add,
+ newProvider));
}
public void AddProviders(IEnumerable newProviders)
@@ -84,48 +90,58 @@ namespace mRemoteNG.Config.Putty
if (!_providers.Contains(providerToRemove)) return;
_providers.Remove(providerToRemove);
providerToRemove.PuttySessionsCollectionChanged -= RaisePuttySessionCollectionChangedEvent;
- RaiseSessionProvidersCollectionChangedEvent(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, providerToRemove));
+ RaiseSessionProvidersCollectionChangedEvent(
+ new
+ NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove,
+ providerToRemove));
}
public void PuttySessionChanged(object sender, PuttySessionChangedEventArgs e)
- {
- AddSessions();
- }
+ {
+ AddSessions();
+ }
+
#endregion
#region Private Methods
- private string[] GetSessionNames(bool raw = false)
- {
- var sessionNames = new List();
- foreach (var provider in Providers)
- {
- if (!IsProviderEnabled(provider))
- {
- continue;
- }
- sessionNames.AddRange(provider.GetSessionNames(raw));
- }
- return sessionNames.ToArray();
- }
-
- private bool IsProviderEnabled(AbstractPuttySessionsProvider puttySessionsProvider)
- {
+
+ private string[] GetSessionNames(bool raw = false)
+ {
+ var sessionNames = new List();
+ foreach (var provider in Providers)
+ {
+ if (!IsProviderEnabled(provider))
+ {
+ continue;
+ }
+
+ sessionNames.AddRange(provider.GetSessionNames(raw));
+ }
+
+ return sessionNames.ToArray();
+ }
+
+ private bool IsProviderEnabled(AbstractPuttySessionsProvider puttySessionsProvider)
+ {
var enabled = true;
- if (PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.Xming)
- {
- if (puttySessionsProvider is PuttySessionsRegistryProvider)
- enabled = false;
- }
- else
- {
- if (puttySessionsProvider is PuttySessionsXmingProvider)
- enabled = false;
- }
- return enabled;
- }
+ if (PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.Xming)
+ {
+ if (puttySessionsProvider is PuttySessionsRegistryProvider)
+ enabled = false;
+ }
+ else
+ {
+ if (puttySessionsProvider is PuttySessionsXmingProvider)
+ enabled = false;
+ }
+
+ return enabled;
+ }
+
#endregion
-
+
#region Public Classes
+
public class SessionList : StringConverter
{
public static string[] Names
@@ -134,29 +150,32 @@ namespace mRemoteNG.Config.Putty
}
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- return new StandardValuesCollection(Names);
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return true;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
+ {
+ return new StandardValuesCollection(Names);
+ }
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
}
+
#endregion
public event NotifyCollectionChangedEventHandler PuttySessionsCollectionChanged;
+
protected void RaisePuttySessionCollectionChangedEvent(object sender, NotifyCollectionChangedEventArgs args)
{
PuttySessionsCollectionChanged?.Invoke(sender, args);
}
public event NotifyCollectionChangedEventHandler SessionProvidersCollectionChanged;
+
protected void RaiseSessionProvidersCollectionChangedEvent(NotifyCollectionChangedEventArgs args)
{
SessionProvidersCollectionChanged?.Invoke(this, args);
diff --git a/mRemoteV1/Config/Putty/PuttySessionsRegistryProvider.cs b/mRemoteV1/Config/Putty/PuttySessionsRegistryProvider.cs
index 07c2bf37..3e03c817 100644
--- a/mRemoteV1/Config/Putty/PuttySessionsRegistryProvider.cs
+++ b/mRemoteV1/Config/Putty/PuttySessionsRegistryProvider.cs
@@ -14,30 +14,34 @@ using System.Web;
namespace mRemoteNG.Config.Putty
{
public class PuttySessionsRegistryProvider : AbstractPuttySessionsProvider
- {
+ {
private const string PuttySessionsKey = "Software\\SimonTatham\\PuTTY\\Sessions";
private static ManagementEventWatcher _eventWatcher;
#region Public Methods
- public override string[] GetSessionNames(bool raw = false)
- {
+
+ public override string[] GetSessionNames(bool raw = false)
+ {
var sessionsKey = Registry.CurrentUser.OpenSubKey(PuttySessionsKey);
- if (sessionsKey == null) return new string[] {};
+ if (sessionsKey == null) return new string[] { };
var sessionNames = new List();
- foreach (var sessionName in sessionsKey.GetSubKeyNames())
- {
- sessionNames.Add(raw ? sessionName : HttpUtility.UrlDecode(sessionName.Replace("+", "%2B"), Encoding.GetEncoding("iso-8859-1")));
- }
-
- if (raw && !sessionNames.Contains("Default%20Settings"))
- sessionNames.Insert(0, "Default%20Settings");
- else if (!raw && !sessionNames.Contains("Default Settings"))
- sessionNames.Insert(0, "Default Settings");
-
- return sessionNames.ToArray();
- }
-
+ foreach (var sessionName in sessionsKey.GetSubKeyNames())
+ {
+ sessionNames.Add(raw
+ ? sessionName
+ : HttpUtility.UrlDecode(sessionName.Replace("+", "%2B"),
+ Encoding.GetEncoding("iso-8859-1")));
+ }
+
+ if (raw && !sessionNames.Contains("Default%20Settings"))
+ sessionNames.Insert(0, "Default%20Settings");
+ else if (!raw && !sessionNames.Contains("Default Settings"))
+ sessionNames.Insert(0, "Default Settings");
+
+ return sessionNames.ToArray();
+ }
+
public override PuttySessionInfo GetSession(string sessionName)
{
if (string.IsNullOrEmpty(sessionName))
@@ -45,36 +49,36 @@ namespace mRemoteNG.Config.Putty
var sessionsKey = Registry.CurrentUser.OpenSubKey(PuttySessionsKey);
var sessionKey = sessionsKey?.OpenSubKey(sessionName);
- if (sessionKey == null) return null;
+ if (sessionKey == null) return null;
sessionName = HttpUtility.UrlDecode(sessionName.Replace("+", "%2B"), Encoding.GetEncoding("iso-8859-1"));
-
- var sessionInfo = new PuttySessionInfo
- {
- PuttySession = sessionName,
- Name = sessionName,
- Hostname = sessionKey.GetValue("HostName")?.ToString() ?? "",
+
+ var sessionInfo = new PuttySessionInfo
+ {
+ PuttySession = sessionName,
+ Name = sessionName,
+ Hostname = sessionKey.GetValue("HostName")?.ToString() ?? "",
// TODO: this should create a temp putty credential
- Username = sessionKey.GetValue("UserName")?.ToString() ?? ""
- };
+ Username = sessionKey.GetValue("UserName")?.ToString() ?? ""
+ };
- var protocol = string.IsNullOrEmpty(sessionKey.GetValue("Protocol")?.ToString())
- ? "ssh"
+ var protocol = string.IsNullOrEmpty(sessionKey.GetValue("Protocol")?.ToString())
+ ? "ssh"
: sessionKey.GetValue("Protocol").ToString();
- switch (protocol.ToLowerInvariant())
- {
- case "raw":
- sessionInfo.Protocol = ProtocolType.RAW;
- break;
- case "rlogin":
- sessionInfo.Protocol = ProtocolType.Rlogin;
- break;
- case "serial":
- return null;
- case "ssh":
- int.TryParse(sessionKey.GetValue("SshProt")?.ToString(), out var sshVersion);
+ switch (protocol.ToLowerInvariant())
+ {
+ case "raw":
+ sessionInfo.Protocol = ProtocolType.RAW;
+ break;
+ case "rlogin":
+ sessionInfo.Protocol = ProtocolType.Rlogin;
+ break;
+ case "serial":
+ return null;
+ case "ssh":
+ int.TryParse(sessionKey.GetValue("SshProt")?.ToString(), out var sshVersion);
/* Per PUTTY.H in PuTTYNG & PuTTYNG Upstream (PuTTY proper currently)
* expect 0 for SSH1, 3 for SSH2 ONLY
* 1 for SSH1 with a 2 fallback
@@ -83,53 +87,56 @@ namespace mRemoteNG.Config.Putty
* default to SSH2 if any other value is received
*/
sessionInfo.Protocol = sshVersion == 1 || sshVersion == 0 ? ProtocolType.SSH1 : ProtocolType.SSH2;
- break;
- case "telnet":
- sessionInfo.Protocol = ProtocolType.Telnet;
- break;
- default:
- return null;
- }
+ break;
+ case "telnet":
+ sessionInfo.Protocol = ProtocolType.Telnet;
+ break;
+ default:
+ return null;
+ }
int.TryParse(sessionKey.GetValue("PortNumber")?.ToString(), out var portNumber);
if (portNumber == default(int))
sessionInfo.SetDefaultPort();
else
sessionInfo.Port = portNumber;
-
- return sessionInfo;
- }
-
- public override void StartWatcher()
- {
- if (_eventWatcher != null) return;
-
- try
- {
+
+ return sessionInfo;
+ }
+
+ public override void StartWatcher()
+ {
+ if (_eventWatcher != null) return;
+
+ try
+ {
var currentUserSid = WindowsIdentity.GetCurrent().User?.Value;
var key = string.Join("\\", currentUserSid, PuttySessionsKey).Replace("\\", "\\\\");
- var query = new WqlEventQuery($"SELECT * FROM RegistryTreeChangeEvent WHERE Hive = \'HKEY_USERS\' AND RootPath = \'{key}\'");
- _eventWatcher = new ManagementEventWatcher(query);
- _eventWatcher.EventArrived += OnManagementEventArrived;
- _eventWatcher.Start();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage("PuttySessions.Watcher.StartWatching() failed.", ex, MessageClass.WarningMsg);
- }
- }
-
- public override void StopWatcher()
- {
- if (_eventWatcher == null) return;
- _eventWatcher.Stop();
- _eventWatcher.Dispose();
- }
+ var query = new WqlEventQuery(
+ $"SELECT * FROM RegistryTreeChangeEvent WHERE Hive = \'HKEY_USERS\' AND RootPath = \'{key}\'");
+ _eventWatcher = new ManagementEventWatcher(query);
+ _eventWatcher.EventArrived += OnManagementEventArrived;
+ _eventWatcher.Start();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage("PuttySessions.Watcher.StartWatching() failed.", ex,
+ MessageClass.WarningMsg);
+ }
+ }
+
+ public override void StopWatcher()
+ {
+ if (_eventWatcher == null) return;
+ _eventWatcher.Stop();
+ _eventWatcher.Dispose();
+ }
+
#endregion
-
- private void OnManagementEventArrived(object sender, EventArrivedEventArgs e)
- {
- RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
- }
+
+ private void OnManagementEventArrived(object sender, EventArrivedEventArgs e)
+ {
+ RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
+ }
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs b/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs
index 32557cf4..a55551f5 100644
--- a/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs
+++ b/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs
@@ -13,339 +13,374 @@ using System.Text.RegularExpressions;
namespace mRemoteNG.Config.Putty
{
public class PuttySessionsXmingProvider : AbstractPuttySessionsProvider
- {
- public override RootPuttySessionsNodeInfo RootInfo { get; } = new RootPuttySessionsNodeInfo { Name = "Xming Putty Sessions" };
+ {
+ public override RootPuttySessionsNodeInfo RootInfo { get; } =
+ new RootPuttySessionsNodeInfo {Name = "Xming Putty Sessions"};
+
private const string RegistrySessionNameFormat = "{0} [registry]";
private const string RegistrySessionNamePattern = "(.*)\\ \\[registry\\]";
- private static readonly PuttySessionsRegistryProvider PuttySessionsRegistryProvider = new PuttySessionsRegistryProvider();
+
+ private static readonly PuttySessionsRegistryProvider PuttySessionsRegistryProvider =
+ new PuttySessionsRegistryProvider();
+
private static FileSystemWatcher _eventWatcher;
#region Public Methods
- public override string[] GetSessionNames(bool raw = false)
- {
- var sessionsFolderPath = GetSessionsFolderPath();
- if (!Directory.Exists(sessionsFolderPath))
- {
- return new string[] {};
- }
+
+ public override string[] GetSessionNames(bool raw = false)
+ {
+ var sessionsFolderPath = GetSessionsFolderPath();
+ if (!Directory.Exists(sessionsFolderPath))
+ {
+ return new string[] { };
+ }
var sessionNames = new List();
- foreach (var sessionName in Directory.GetFiles(sessionsFolderPath))
- {
- var sessionFileName = Path.GetFileName(sessionName);
- // ReSharper disable once ConstantConditionalAccessQualifier
- sessionNames.Add(raw ? sessionFileName : System.Web.HttpUtility.UrlDecode(sessionFileName?.Replace("+", "%2B")));
- }
+ foreach (var sessionName in Directory.GetFiles(sessionsFolderPath))
+ {
+ var sessionFileName = Path.GetFileName(sessionName);
+ // ReSharper disable once ConstantConditionalAccessQualifier
+ sessionNames.Add(raw
+ ? sessionFileName
+ : System.Web.HttpUtility.UrlDecode(sessionFileName?.Replace("+", "%2B")));
+ }
- if (raw)
- {
- if (!sessionNames.Contains("Default%20Settings")) // Do not localize
- {
- sessionNames.Insert(0, "Default%20Settings");
- }
- }
- else
- {
- if (!sessionNames.Contains("Default Settings"))
- {
- sessionNames.Insert(0, "Default Settings");
- }
- }
+ if (raw)
+ {
+ if (!sessionNames.Contains("Default%20Settings")) // Do not localize
+ {
+ sessionNames.Insert(0, "Default%20Settings");
+ }
+ }
+ else
+ {
+ if (!sessionNames.Contains("Default Settings"))
+ {
+ sessionNames.Insert(0, "Default Settings");
+ }
+ }
- var registrySessionNames = PuttySessionsRegistryProvider.GetSessionNames(raw).Select(sessionName => string.Format(RegistrySessionNameFormat, sessionName)).ToList();
+ var registrySessionNames = PuttySessionsRegistryProvider.GetSessionNames(raw)
+ .Select(sessionName =>
+ string
+ .Format(RegistrySessionNameFormat,
+ sessionName)).ToList();
- sessionNames.AddRange(registrySessionNames);
- sessionNames.Sort();
-
- return sessionNames.ToArray();
- }
-
- public override PuttySessionInfo GetSession(string sessionName)
- {
+ sessionNames.AddRange(registrySessionNames);
+ sessionNames.Sort();
+
+ return sessionNames.ToArray();
+ }
+
+ public override PuttySessionInfo GetSession(string sessionName)
+ {
var registrySessionName = GetRegistrySessionName(sessionName);
- if (!string.IsNullOrEmpty(registrySessionName))
- {
- return ModifyRegistrySessionInfo(PuttySessionsRegistryProvider.GetSession(registrySessionName));
- }
+ if (!string.IsNullOrEmpty(registrySessionName))
+ {
+ return ModifyRegistrySessionInfo(PuttySessionsRegistryProvider.GetSession(registrySessionName));
+ }
var sessionsFolderPath = GetSessionsFolderPath();
- if (!Directory.Exists(sessionsFolderPath))
- {
- return null;
- }
+ if (!Directory.Exists(sessionsFolderPath))
+ {
+ return null;
+ }
var sessionFile = Path.Combine(sessionsFolderPath, sessionName);
- if (!File.Exists(sessionFile))
- {
- return null;
- }
-
- sessionName = System.Web.HttpUtility.UrlDecode(sessionName.Replace("+", "%2B"));
+ if (!File.Exists(sessionFile))
+ {
+ return null;
+ }
+
+ sessionName = System.Web.HttpUtility.UrlDecode(sessionName.Replace("+", "%2B"));
var sessionFileReader = new SessionFileReader(sessionFile);
- var sessionInfo = new PuttySessionInfo
- {
- PuttySession = sessionName,
- Name = sessionName,
- Hostname = sessionFileReader.GetValue("HostName"),
+ var sessionInfo = new PuttySessionInfo
+ {
+ PuttySession = sessionName,
+ Name = sessionName,
+ Hostname = sessionFileReader.GetValue("HostName"),
// TODO: this should create a temp putty credential
Username = sessionFileReader.GetValue("UserName")
- };
- var protocol = sessionFileReader.GetValue("Protocol") ?? "ssh";
- switch (protocol.ToLowerInvariant())
- {
- case "raw":
- sessionInfo.Protocol = ProtocolType.RAW;
- break;
- case "rlogin":
- sessionInfo.Protocol = ProtocolType.Rlogin;
- break;
- case "serial":
- return null;
- case "ssh":
- object sshVersionObject = sessionFileReader.GetValue("SshProt");
- if (sshVersionObject != null)
- {
- var sshVersion = Convert.ToInt32(sshVersionObject);
- sessionInfo.Protocol = sshVersion >= 2 ? ProtocolType.SSH2 : ProtocolType.SSH1;
- }
- else
- {
- sessionInfo.Protocol = ProtocolType.SSH2;
- }
- break;
- case "telnet":
- sessionInfo.Protocol = ProtocolType.Telnet;
- break;
- default:
- return null;
- }
- sessionInfo.Port = Convert.ToInt32(sessionFileReader.GetValue("PortNumber"));
-
- return sessionInfo;
- }
-
- public override void StartWatcher()
- {
- if (_eventWatcher != null)
- {
- return;
- }
-
- try
- {
+ };
+ var protocol = sessionFileReader.GetValue("Protocol") ?? "ssh";
+ switch (protocol.ToLowerInvariant())
+ {
+ case "raw":
+ sessionInfo.Protocol = ProtocolType.RAW;
+ break;
+ case "rlogin":
+ sessionInfo.Protocol = ProtocolType.Rlogin;
+ break;
+ case "serial":
+ return null;
+ case "ssh":
+ object sshVersionObject = sessionFileReader.GetValue("SshProt");
+ if (sshVersionObject != null)
+ {
+ var sshVersion = Convert.ToInt32(sshVersionObject);
+ sessionInfo.Protocol = sshVersion >= 2 ? ProtocolType.SSH2 : ProtocolType.SSH1;
+ }
+ else
+ {
+ sessionInfo.Protocol = ProtocolType.SSH2;
+ }
+
+ break;
+ case "telnet":
+ sessionInfo.Protocol = ProtocolType.Telnet;
+ break;
+ default:
+ return null;
+ }
+
+ sessionInfo.Port = Convert.ToInt32(sessionFileReader.GetValue("PortNumber"));
+
+ return sessionInfo;
+ }
+
+ public override void StartWatcher()
+ {
+ if (_eventWatcher != null)
+ {
+ return;
+ }
+
+ try
+ {
var sessionsFolderPath = GetSessionsFolderPath();
- if (!Directory.Exists(sessionsFolderPath))
- {
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, $"XmingPortablePuttySessions.Watcher.StartWatching() failed: '{sessionsFolderPath}' does not exist.", true);
- return;
- }
+ if (!Directory.Exists(sessionsFolderPath))
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ $"XmingPortablePuttySessions.Watcher.StartWatching() failed: '{sessionsFolderPath}' does not exist.",
+ true);
+ return;
+ }
+
+ _eventWatcher = new FileSystemWatcher(sessionsFolderPath)
+ {
+ NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite
+ };
+ _eventWatcher.Changed += OnFileSystemEventArrived;
+ _eventWatcher.Created += OnFileSystemEventArrived;
+ _eventWatcher.Deleted += OnFileSystemEventArrived;
+ _eventWatcher.Renamed += OnFileSystemEventArrived;
+ _eventWatcher.EnableRaisingEvents = true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(
+ "XmingPortablePuttySessions.Watcher.StartWatching() failed.",
+ ex, MessageClass.WarningMsg);
+ }
+ }
+
+ public override void StopWatcher()
+ {
+ PuttySessionsRegistryProvider.StopWatcher();
+ PuttySessionsRegistryProvider.PuttySessionChanged -= OnRegistrySessionChanged;
+
+ if (_eventWatcher == null)
+ {
+ return;
+ }
+
+ _eventWatcher.EnableRaisingEvents = false;
+ _eventWatcher.Dispose();
+ }
- _eventWatcher = new FileSystemWatcher(sessionsFolderPath)
- {
- NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite
- };
- _eventWatcher.Changed += OnFileSystemEventArrived;
- _eventWatcher.Created += OnFileSystemEventArrived;
- _eventWatcher.Deleted += OnFileSystemEventArrived;
- _eventWatcher.Renamed += OnFileSystemEventArrived;
- _eventWatcher.EnableRaisingEvents = true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage("XmingPortablePuttySessions.Watcher.StartWatching() failed.", ex, MessageClass.WarningMsg);
- }
- }
-
- public override void StopWatcher()
- {
- PuttySessionsRegistryProvider.StopWatcher();
- PuttySessionsRegistryProvider.PuttySessionChanged -= OnRegistrySessionChanged;
-
- if (_eventWatcher == null)
- {
- return;
- }
- _eventWatcher.EnableRaisingEvents = false;
- _eventWatcher.Dispose();
- }
#endregion
-
+
#region Private Methods
- private static string GetPuttyConfPath()
- {
- var puttyPath = mRemoteNG.Settings.Default.UseCustomPuttyPath ? mRemoteNG.Settings.Default.CustomPuttyPath : App.Info.GeneralAppInfo.PuttyPath;
- puttyPath = Path.GetDirectoryName(puttyPath);
+
+ private static string GetPuttyConfPath()
+ {
+ var puttyPath = mRemoteNG.Settings.Default.UseCustomPuttyPath
+ ? mRemoteNG.Settings.Default.CustomPuttyPath
+ : App.Info.GeneralAppInfo.PuttyPath;
+ puttyPath = Path.GetDirectoryName(puttyPath);
return string.IsNullOrEmpty(puttyPath) ? null : Path.Combine(puttyPath, "putty.conf");
- }
-
- private static string GetSessionsFolderPath()
- {
+ }
+
+ private static string GetSessionsFolderPath()
+ {
var puttyConfPath = GetPuttyConfPath();
var sessionFileReader = new PuttyConfFileReader(puttyConfPath);
var basePath = Environment.ExpandEnvironmentVariables(sessionFileReader.GetValue("sshk&sess"));
- return Path.Combine(basePath, "sessions");
- }
-
- private static string GetRegistrySessionName(string sessionName)
- {
+ return Path.Combine(basePath, "sessions");
+ }
+
+ private static string GetRegistrySessionName(string sessionName)
+ {
var regex = new Regex(RegistrySessionNamePattern);
var matches = regex.Matches(sessionName);
- if (matches.Count < 1)
- {
- return string.Empty;
- }
+ if (matches.Count < 1)
+ {
+ return string.Empty;
+ }
var groups = matches[0].Groups;
- return groups.Count < 1 ? string.Empty : groups[1].Value;
- }
-
- private static PuttySessionInfo ModifyRegistrySessionInfo(PuttySessionInfo sessionInfo)
- {
- if (sessionInfo == null)
- return null;
+ return groups.Count < 1 ? string.Empty : groups[1].Value;
+ }
+
+ private static PuttySessionInfo ModifyRegistrySessionInfo(PuttySessionInfo sessionInfo)
+ {
+ if (sessionInfo == null)
+ return null;
+
+ sessionInfo.Name = string.Format(RegistrySessionNameFormat, sessionInfo.Name);
+ sessionInfo.PuttySession = string.Format(RegistrySessionNameFormat, sessionInfo.PuttySession);
+ return sessionInfo;
+ }
+
+ private void OnFileSystemEventArrived(object sender, FileSystemEventArgs e)
+ {
+ RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
+ }
+
+ private void OnRegistrySessionChanged(object sender, PuttySessionChangedEventArgs e)
+ {
+ RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
+ }
- sessionInfo.Name = string.Format(RegistrySessionNameFormat, sessionInfo.Name);
- sessionInfo.PuttySession = string.Format(RegistrySessionNameFormat, sessionInfo.PuttySession);
- return sessionInfo;
- }
-
- private void OnFileSystemEventArrived(object sender, FileSystemEventArgs e)
- {
- RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
- }
-
- private void OnRegistrySessionChanged(object sender, PuttySessionChangedEventArgs e)
- {
- RaiseSessionChangedEvent(new PuttySessionChangedEventArgs());
- }
#endregion
-
+
#region Private Classes
- private class PuttyConfFileReader
- {
- public PuttyConfFileReader(string puttyConfFile)
- {
- _puttyConfFile = puttyConfFile;
- }
-
- private string _puttyConfFile;
- private bool _configurationLoaded;
- private Dictionary _configuration = new Dictionary();
-
- private void LoadConfiguration()
- {
- _configurationLoaded = true;
- try
- {
- if (!File.Exists(_puttyConfFile))
- {
- return;
- }
- using (var streamReader = new StreamReader(_puttyConfFile))
- {
- do
- {
- var line = streamReader.ReadLine();
- if (line == null)
- {
- break;
- }
- line = line.Trim();
- if (line == string.Empty)
- {
- continue; // Blank line
- }
- if (line.Substring(0, 1) == ";")
- {
- continue; // Comment
- }
+
+ private class PuttyConfFileReader
+ {
+ public PuttyConfFileReader(string puttyConfFile)
+ {
+ _puttyConfFile = puttyConfFile;
+ }
+
+ private string _puttyConfFile;
+ private bool _configurationLoaded;
+ private Dictionary _configuration = new Dictionary();
+
+ private void LoadConfiguration()
+ {
+ _configurationLoaded = true;
+ try
+ {
+ if (!File.Exists(_puttyConfFile))
+ {
+ return;
+ }
+
+ using (var streamReader = new StreamReader(_puttyConfFile))
+ {
+ do
+ {
+ var line = streamReader.ReadLine();
+ if (line == null)
+ {
+ break;
+ }
+
+ line = line.Trim();
+ if (line == string.Empty)
+ {
+ continue; // Blank line
+ }
+
+ if (line.Substring(0, 1) == ";")
+ {
+ continue; // Comment
+ }
+
var parts = line.Split(new[] {'='}, 2);
- if (parts.Length < 2)
- {
- continue;
- }
- if (_configuration.ContainsKey(parts[0]))
- {
- continue; // As per http://www.straightrunning.com/XmingNotes/portableputty.php only first entry is used
- }
- _configuration.Add(parts[0], parts[1]);
- } while (true);
- }
-
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage("PuttyConfFileReader.LoadConfiguration() failed.", ex);
- }
- }
-
- public string GetValue(string setting)
- {
- if (!_configurationLoaded)
- {
- LoadConfiguration();
- }
- return !_configuration.ContainsKey(setting) ? string.Empty : _configuration[setting];
- }
- }
-
- private class SessionFileReader
- {
- public SessionFileReader(string sessionFile)
- {
- _sessionFile = sessionFile;
- }
-
- private string _sessionFile;
- private bool _sessionInfoLoaded;
- private Dictionary _sessionInfo = new Dictionary();
-
- private void LoadSessionInfo()
- {
- _sessionInfoLoaded = true;
- try
- {
- if (!File.Exists(_sessionFile))
- {
- return;
- }
- using (var streamReader = new StreamReader(_sessionFile))
- {
- do
- {
- var line = streamReader.ReadLine();
- if (line == null)
- {
- break;
- }
+ if (parts.Length < 2)
+ {
+ continue;
+ }
+
+ if (_configuration.ContainsKey(parts[0]))
+ {
+ continue; // As per http://www.straightrunning.com/XmingNotes/portableputty.php only first entry is used
+ }
+
+ _configuration.Add(parts[0], parts[1]);
+ } while (true);
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage("PuttyConfFileReader.LoadConfiguration() failed.", ex);
+ }
+ }
+
+ public string GetValue(string setting)
+ {
+ if (!_configurationLoaded)
+ {
+ LoadConfiguration();
+ }
+
+ return !_configuration.ContainsKey(setting) ? string.Empty : _configuration[setting];
+ }
+ }
+
+ private class SessionFileReader
+ {
+ public SessionFileReader(string sessionFile)
+ {
+ _sessionFile = sessionFile;
+ }
+
+ private string _sessionFile;
+ private bool _sessionInfoLoaded;
+ private Dictionary _sessionInfo = new Dictionary();
+
+ private void LoadSessionInfo()
+ {
+ _sessionInfoLoaded = true;
+ try
+ {
+ if (!File.Exists(_sessionFile))
+ {
+ return;
+ }
+
+ using (var streamReader = new StreamReader(_sessionFile))
+ {
+ do
+ {
+ var line = streamReader.ReadLine();
+ if (line == null)
+ {
+ break;
+ }
+
var parts = line.Split('\\');
- if (parts.Length < 2)
- {
- continue;
- }
- _sessionInfo.Add(parts[0], parts[1]);
- } while (true);
- }
-
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage("SessionFileReader.LoadSessionInfo() failed.", ex);
- }
- }
-
- public string GetValue(string setting)
- {
- if (!_sessionInfoLoaded)
- {
- LoadSessionInfo();
- }
- return !_sessionInfo.ContainsKey(setting) ? string.Empty : _sessionInfo[setting];
- }
- }
+ if (parts.Length < 2)
+ {
+ continue;
+ }
+
+ _sessionInfo.Add(parts[0], parts[1]);
+ } while (true);
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage("SessionFileReader.LoadSessionInfo() failed.", ex);
+ }
+ }
+
+ public string GetValue(string setting)
+ {
+ if (!_sessionInfoLoaded)
+ {
+ LoadSessionInfo();
+ }
+
+ return !_sessionInfo.ContainsKey(setting) ? string.Empty : _sessionInfo[setting];
+ }
+ }
+
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs
index 42275d29..6bb924b8 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsDeserializerMremotengFormat.cs
@@ -21,7 +21,7 @@ namespace mRemoteNG.Config.Serializers.Csv
{
public SerializationResult Deserialize(string serializedData)
{
- var lines = serializedData.Split(new []{"\r\n", "\r", "\n"}, StringSplitOptions.RemoveEmptyEntries);
+ var lines = serializedData.Split(new[] {"\r\n", "\r", "\n"}, StringSplitOptions.RemoveEmptyEntries);
var csvHeaders = new List();
// used to map a connectioninfo to it's parent's GUID
var parentMapping = new Dictionary();
@@ -72,9 +72,9 @@ namespace mRemoteNG.Config.Serializers.Csv
// search for parent in the list by GUID
var parent = parentMapping
- .Keys
- .OfType()
- .FirstOrDefault(info => info.ConstantID == node.Value);
+ .Keys
+ .OfType()
+ .FirstOrDefault(info => info.ConstantID == node.Value);
if (parent != null)
{
@@ -92,7 +92,7 @@ namespace mRemoteNG.Config.Serializers.Csv
private ConnectionInfo ParseConnectionInfo(IList headers, string[] connectionCsv)
{
var nodeType = headers.Contains("NodeType")
- ? (TreeNodeType)Enum.Parse(typeof(TreeNodeType), connectionCsv[headers.IndexOf("NodeType")], true)
+ ? (TreeNodeType)Enum.Parse(typeof(TreeNodeType), connectionCsv[headers.IndexOf("NodeType")], true)
: TreeNodeType.Connection;
var nodeId = headers.Contains("Id")
@@ -104,7 +104,8 @@ namespace mRemoteNG.Config.Serializers.Csv
: new ContainerInfo(nodeId);
connectionRecord.Name = headers.Contains("Name") ? connectionCsv[headers.IndexOf("Name")] : "";
- connectionRecord.Description = headers.Contains("Description") ? connectionCsv[headers.IndexOf("Description")] : "";
+ connectionRecord.Description =
+ headers.Contains("Description") ? connectionCsv[headers.IndexOf("Description")] : "";
connectionRecord.Icon = headers.Contains("Icon") ? connectionCsv[headers.IndexOf("Icon")] : "";
connectionRecord.Panel = headers.Contains("Panel") ? connectionCsv[headers.IndexOf("Panel")] : "";
@@ -119,20 +120,40 @@ namespace mRemoteNG.Config.Serializers.Csv
connectionRecord.Domain = headers.Contains("Domain") ? connectionCsv[headers.IndexOf("Domain")] : "";
connectionRecord.Hostname = headers.Contains("Hostname") ? connectionCsv[headers.IndexOf("Hostname")] : "";
- connectionRecord.PuttySession = headers.Contains("PuttySession") ? connectionCsv[headers.IndexOf("PuttySession")] : "";
- connectionRecord.LoadBalanceInfo = headers.Contains("LoadBalanceInfo") ? connectionCsv[headers.IndexOf("LoadBalanceInfo")] : "";
- connectionRecord.PreExtApp = headers.Contains("PreExtApp") ? connectionCsv[headers.IndexOf("PreExtApp")] : "";
- connectionRecord.PostExtApp = headers.Contains("PostExtApp") ? connectionCsv[headers.IndexOf("PostExtApp")] : "";
- connectionRecord.MacAddress = headers.Contains("MacAddress") ? connectionCsv[headers.IndexOf("MacAddress")] : "";
- connectionRecord.UserField = headers.Contains("UserField") ? connectionCsv[headers.IndexOf("UserField")] : "";
+ connectionRecord.PuttySession =
+ headers.Contains("PuttySession") ? connectionCsv[headers.IndexOf("PuttySession")] : "";
+ connectionRecord.LoadBalanceInfo = headers.Contains("LoadBalanceInfo")
+ ? connectionCsv[headers.IndexOf("LoadBalanceInfo")]
+ : "";
+ connectionRecord.PreExtApp =
+ headers.Contains("PreExtApp") ? connectionCsv[headers.IndexOf("PreExtApp")] : "";
+ connectionRecord.PostExtApp =
+ headers.Contains("PostExtApp") ? connectionCsv[headers.IndexOf("PostExtApp")] : "";
+ connectionRecord.MacAddress =
+ headers.Contains("MacAddress") ? connectionCsv[headers.IndexOf("MacAddress")] : "";
+ connectionRecord.UserField =
+ headers.Contains("UserField") ? connectionCsv[headers.IndexOf("UserField")] : "";
connectionRecord.ExtApp = headers.Contains("ExtApp") ? connectionCsv[headers.IndexOf("ExtApp")] : "";
- connectionRecord.VNCProxyUsername = headers.Contains("VNCProxyUsername") ? connectionCsv[headers.IndexOf("VNCProxyUsername")] : "";
- connectionRecord.VNCProxyPassword = headers.Contains("VNCProxyPassword") ? connectionCsv[headers.IndexOf("VNCProxyPassword")] : "";
- connectionRecord.RDGatewayUsername = headers.Contains("RDGatewayUsername") ? connectionCsv[headers.IndexOf("RDGatewayUsername")] : "";
- connectionRecord.RDGatewayPassword = headers.Contains("RDGatewayPassword") ? connectionCsv[headers.IndexOf("RDGatewayPassword")] : "";
- connectionRecord.RDGatewayDomain = headers.Contains("RDGatewayDomain") ? connectionCsv[headers.IndexOf("RDGatewayDomain")] : "";
- connectionRecord.VNCProxyIP = headers.Contains("VNCProxyIP") ? connectionCsv[headers.IndexOf("VNCProxyIP")] : "";
- connectionRecord.RDGatewayHostname = headers.Contains("RDGatewayHostname") ? connectionCsv[headers.IndexOf("RDGatewayHostname")] : "";
+ connectionRecord.VNCProxyUsername = headers.Contains("VNCProxyUsername")
+ ? connectionCsv[headers.IndexOf("VNCProxyUsername")]
+ : "";
+ connectionRecord.VNCProxyPassword = headers.Contains("VNCProxyPassword")
+ ? connectionCsv[headers.IndexOf("VNCProxyPassword")]
+ : "";
+ connectionRecord.RDGatewayUsername = headers.Contains("RDGatewayUsername")
+ ? connectionCsv[headers.IndexOf("RDGatewayUsername")]
+ : "";
+ connectionRecord.RDGatewayPassword = headers.Contains("RDGatewayPassword")
+ ? connectionCsv[headers.IndexOf("RDGatewayPassword")]
+ : "";
+ connectionRecord.RDGatewayDomain = headers.Contains("RDGatewayDomain")
+ ? connectionCsv[headers.IndexOf("RDGatewayDomain")]
+ : "";
+ connectionRecord.VNCProxyIP =
+ headers.Contains("VNCProxyIP") ? connectionCsv[headers.IndexOf("VNCProxyIP")] : "";
+ connectionRecord.RDGatewayHostname = headers.Contains("RDGatewayHostname")
+ ? connectionCsv[headers.IndexOf("RDGatewayHostname")]
+ : "";
if (headers.Contains("CredentialId"))
{
@@ -247,6 +268,7 @@ namespace mRemoteNG.Config.Serializers.Csv
if (bool.TryParse(connectionCsv[headers.IndexOf("RedirectPrinters")], out bool value))
connectionRecord.RedirectPrinters = value;
}
+
if (headers.Contains("RedirectClipboard"))
{
if (bool.TryParse(connectionCsv[headers.IndexOf("RedirectClipboard")], out bool value))
@@ -332,6 +354,7 @@ namespace mRemoteNG.Config.Serializers.Csv
}
#region Inheritance
+
if (headers.Contains("InheritCacheBitmaps"))
{
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritCacheBitmaps")], out bool value))
@@ -622,7 +645,8 @@ namespace mRemoteNG.Config.Serializers.Csv
if (headers.Contains("InheritRDGatewayUseConnectionCredentials"))
{
- if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRDGatewayUseConnectionCredentials")], out bool value))
+ if (bool.TryParse(connectionCsv[headers.IndexOf("InheritRDGatewayUseConnectionCredentials")],
+ out var value))
connectionRecord.Inheritance.RDGatewayUseConnectionCredentials = value;
}
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs
index 069a1214..aa5a1641 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Csv/CsvConnectionsSerializerMremotengFormat.cs
@@ -11,14 +11,15 @@ using System.Text;
namespace mRemoteNG.Config.Serializers.Csv
{
- public class CsvConnectionsSerializerMremotengFormat : ISerializer
+ public class CsvConnectionsSerializerMremotengFormat : ISerializer
{
private readonly SaveFilter _saveFilter;
private readonly ICredentialRepositoryList _credentialRepositoryList;
public Version Version { get; } = new Version(2, 7);
- public CsvConnectionsSerializerMremotengFormat(SaveFilter saveFilter, ICredentialRepositoryList credentialRepositoryList)
+ public CsvConnectionsSerializerMremotengFormat(SaveFilter saveFilter,
+ ICredentialRepositoryList credentialRepositoryList)
{
saveFilter.ThrowIfNull(nameof(saveFilter));
credentialRepositoryList.ThrowIfNull(nameof(credentialRepositoryList));
@@ -106,52 +107,52 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.CredentialRecordId));
sb.Append(FormatForCsv(con.Hostname))
- .Append(FormatForCsv(con.Protocol))
- .Append(FormatForCsv(con.PuttySession))
- .Append(FormatForCsv(con.Port))
- .Append(FormatForCsv(con.UseConsoleSession))
- .Append(FormatForCsv(con.UseCredSsp))
- .Append(FormatForCsv(con.RenderingEngine))
- .Append(FormatForCsv(con.ICAEncryptionStrength))
- .Append(FormatForCsv(con.RDPAuthenticationLevel))
- .Append(FormatForCsv(con.LoadBalanceInfo))
- .Append(FormatForCsv(con.Colors))
- .Append(FormatForCsv(con.Resolution))
- .Append(FormatForCsv(con.AutomaticResize))
- .Append(FormatForCsv(con.DisplayWallpaper))
- .Append(FormatForCsv(con.DisplayThemes))
- .Append(FormatForCsv(con.EnableFontSmoothing))
- .Append(FormatForCsv(con.EnableDesktopComposition))
- .Append(FormatForCsv(con.CacheBitmaps))
- .Append(FormatForCsv(con.RedirectDiskDrives))
- .Append(FormatForCsv(con.RedirectPorts))
- .Append(FormatForCsv(con.RedirectPrinters))
- .Append(FormatForCsv(con.RedirectClipboard))
- .Append(FormatForCsv(con.RedirectSmartCards))
- .Append(FormatForCsv(con.RedirectSound))
- .Append(FormatForCsv(con.RedirectKeys))
- .Append(FormatForCsv(con.PreExtApp))
- .Append(FormatForCsv(con.PostExtApp))
- .Append(FormatForCsv(con.MacAddress))
- .Append(FormatForCsv(con.UserField))
- .Append(FormatForCsv(con.ExtApp))
- .Append(FormatForCsv(con.VNCCompression))
- .Append(FormatForCsv(con.VNCEncoding))
- .Append(FormatForCsv(con.VNCAuthMode))
- .Append(FormatForCsv(con.VNCProxyType))
- .Append(FormatForCsv(con.VNCProxyIP))
- .Append(FormatForCsv(con.VNCProxyPort))
- .Append(FormatForCsv(con.VNCProxyUsername))
- .Append(FormatForCsv(con.VNCProxyPassword))
- .Append(FormatForCsv(con.VNCColors))
- .Append(FormatForCsv(con.VNCSmartSizeMode))
- .Append(FormatForCsv(con.VNCViewOnly))
- .Append(FormatForCsv(con.RDGatewayUsageMethod))
- .Append(FormatForCsv(con.RDGatewayHostname))
- .Append(FormatForCsv(con.RDGatewayUseConnectionCredentials))
- .Append(FormatForCsv(con.RDGatewayUsername))
- .Append(FormatForCsv(con.RDGatewayPassword))
- .Append(FormatForCsv(con.RDGatewayDomain));
+ .Append(FormatForCsv(con.Protocol))
+ .Append(FormatForCsv(con.PuttySession))
+ .Append(FormatForCsv(con.Port))
+ .Append(FormatForCsv(con.UseConsoleSession))
+ .Append(FormatForCsv(con.UseCredSsp))
+ .Append(FormatForCsv(con.RenderingEngine))
+ .Append(FormatForCsv(con.ICAEncryptionStrength))
+ .Append(FormatForCsv(con.RDPAuthenticationLevel))
+ .Append(FormatForCsv(con.LoadBalanceInfo))
+ .Append(FormatForCsv(con.Colors))
+ .Append(FormatForCsv(con.Resolution))
+ .Append(FormatForCsv(con.AutomaticResize))
+ .Append(FormatForCsv(con.DisplayWallpaper))
+ .Append(FormatForCsv(con.DisplayThemes))
+ .Append(FormatForCsv(con.EnableFontSmoothing))
+ .Append(FormatForCsv(con.EnableDesktopComposition))
+ .Append(FormatForCsv(con.CacheBitmaps))
+ .Append(FormatForCsv(con.RedirectDiskDrives))
+ .Append(FormatForCsv(con.RedirectPorts))
+ .Append(FormatForCsv(con.RedirectPrinters))
+ .Append(FormatForCsv(con.RedirectClipboard))
+ .Append(FormatForCsv(con.RedirectSmartCards))
+ .Append(FormatForCsv(con.RedirectSound))
+ .Append(FormatForCsv(con.RedirectKeys))
+ .Append(FormatForCsv(con.PreExtApp))
+ .Append(FormatForCsv(con.PostExtApp))
+ .Append(FormatForCsv(con.MacAddress))
+ .Append(FormatForCsv(con.UserField))
+ .Append(FormatForCsv(con.ExtApp))
+ .Append(FormatForCsv(con.VNCCompression))
+ .Append(FormatForCsv(con.VNCEncoding))
+ .Append(FormatForCsv(con.VNCAuthMode))
+ .Append(FormatForCsv(con.VNCProxyType))
+ .Append(FormatForCsv(con.VNCProxyIP))
+ .Append(FormatForCsv(con.VNCProxyPort))
+ .Append(FormatForCsv(con.VNCProxyUsername))
+ .Append(FormatForCsv(con.VNCProxyPassword))
+ .Append(FormatForCsv(con.VNCColors))
+ .Append(FormatForCsv(con.VNCSmartSizeMode))
+ .Append(FormatForCsv(con.VNCViewOnly))
+ .Append(FormatForCsv(con.RDGatewayUsageMethod))
+ .Append(FormatForCsv(con.RDGatewayHostname))
+ .Append(FormatForCsv(con.RDGatewayUseConnectionCredentials))
+ .Append(FormatForCsv(con.RDGatewayUsername))
+ .Append(FormatForCsv(con.RDGatewayPassword))
+ .Append(FormatForCsv(con.RDGatewayDomain));
if (!_saveFilter.SaveInheritance)
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs
index 0129d72e..c7949cb3 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs
@@ -51,20 +51,21 @@ namespace mRemoteNG.Config.Serializers.MsSql
break;
}
}
+
return nodeList;
}
private ConnectionInfo DeserializeConnectionInfo(DataRow row)
{
- var connectionId = row["ConstantID"] as string ?? Guid.NewGuid().ToString();
- var connectionInfo = new ConnectionInfo(connectionId);
+ var connectionId = row["ConstantID"] as string ?? Guid.NewGuid().ToString();
+ var connectionInfo = new ConnectionInfo(connectionId);
PopulateConnectionInfoFromDataRow(row, connectionInfo);
return connectionInfo;
}
private ContainerInfo DeserializeContainerInfo(DataRow row)
{
- var containerId = row["ConstantID"] as string ?? Guid.NewGuid().ToString();
+ var containerId = row["ConstantID"] as string ?? Guid.NewGuid().ToString();
var containerInfo = new ContainerInfo(containerId);
PopulateConnectionInfoFromDataRow(row, containerInfo);
return containerInfo;
@@ -96,14 +97,22 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.Port = (int)dataRow["Port"];
connectionInfo.UseConsoleSession = (bool)dataRow["ConnectToConsole"];
connectionInfo.UseCredSsp = (bool)dataRow["UseCredSsp"];
- connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Enum.Parse(typeof(HTTPBase.RenderingEngine), (string)dataRow["RenderingEngine"]);
- connectionInfo.ICAEncryptionStrength = (IcaProtocol.EncryptionStrength)Enum.Parse(typeof(IcaProtocol.EncryptionStrength), (string)dataRow["ICAEncryptionStrength"]);
- connectionInfo.RDPAuthenticationLevel = (RdpProtocol.AuthenticationLevel)Enum.Parse(typeof(RdpProtocol.AuthenticationLevel), (string)dataRow["RDPAuthenticationLevel"]);
+ connectionInfo.RenderingEngine = (HTTPBase.RenderingEngine)Enum.Parse(typeof(HTTPBase.RenderingEngine),
+ (string)dataRow["RenderingEngine"]);
+ connectionInfo.ICAEncryptionStrength =
+ (IcaProtocol.EncryptionStrength)Enum.Parse(typeof(IcaProtocol.EncryptionStrength),
+ (string)dataRow["ICAEncryptionStrength"]);
+ connectionInfo.RDPAuthenticationLevel =
+ (RdpProtocol.AuthenticationLevel)Enum.Parse(typeof(RdpProtocol.AuthenticationLevel),
+ (string)dataRow["RDPAuthenticationLevel"]);
connectionInfo.RDPMinutesToIdleTimeout = (int)dataRow["RDPMinutesToIdleTimeout"];
connectionInfo.RDPAlertIdleTimeout = (bool)dataRow["RDPAlertIdleTimeout"];
connectionInfo.LoadBalanceInfo = (string)dataRow["LoadBalanceInfo"];
- connectionInfo.Colors = (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors) ,(string)dataRow["Colors"]);
- connectionInfo.Resolution = (RdpProtocol.RDPResolutions)Enum.Parse(typeof(RdpProtocol.RDPResolutions), (string)dataRow["Resolution"]);
+ connectionInfo.Colors =
+ (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors), (string)dataRow["Colors"]);
+ connectionInfo.Resolution =
+ (RdpProtocol.RDPResolutions)Enum.Parse(typeof(RdpProtocol.RDPResolutions),
+ (string)dataRow["Resolution"]);
connectionInfo.AutomaticResize = (bool)dataRow["AutomaticResize"];
connectionInfo.DisplayWallpaper = (bool)dataRow["DisplayWallpaper"];
connectionInfo.DisplayThemes = (bool)dataRow["DisplayThemes"];
@@ -115,28 +124,44 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.RedirectPrinters = (bool)dataRow["RedirectPrinters"];
connectionInfo.RedirectClipboard = (bool)dataRow["RedirectClipboard"];
connectionInfo.RedirectSmartCards = (bool)dataRow["RedirectSmartCards"];
- connectionInfo.RedirectSound = (RdpProtocol.RDPSounds)Enum.Parse(typeof(RdpProtocol.RDPSounds), (string)dataRow["RedirectSound"]);
- connectionInfo.SoundQuality = (RdpProtocol.RDPSoundQuality)Enum.Parse(typeof(RdpProtocol.RDPSoundQuality), (string)dataRow["SoundQuality"]);
+ connectionInfo.RedirectSound =
+ (RdpProtocol.RDPSounds)Enum.Parse(typeof(RdpProtocol.RDPSounds), (string)dataRow["RedirectSound"]);
+ connectionInfo.SoundQuality = (RdpProtocol.RDPSoundQuality)Enum.Parse(typeof(RdpProtocol.RDPSoundQuality),
+ (string)dataRow["SoundQuality"]);
connectionInfo.RedirectKeys = (bool)dataRow["RedirectKeys"];
connectionInfo.PreExtApp = (string)dataRow["PreExtApp"];
connectionInfo.PostExtApp = (string)dataRow["PostExtApp"];
connectionInfo.MacAddress = (string)dataRow["MacAddress"];
connectionInfo.UserField = (string)dataRow["UserField"];
connectionInfo.ExtApp = (string)dataRow["ExtApp"];
- connectionInfo.VNCCompression = (ProtocolVNC.Compression)Enum.Parse(typeof(ProtocolVNC.Compression), (string)dataRow["VNCCompression"]);
- connectionInfo.VNCEncoding = (ProtocolVNC.Encoding)Enum.Parse(typeof(ProtocolVNC.Encoding) ,(string)dataRow["VNCEncoding"]);
- connectionInfo.VNCAuthMode = (ProtocolVNC.AuthMode)Enum.Parse(typeof(ProtocolVNC.AuthMode), (string)dataRow["VNCAuthMode"]);
- connectionInfo.VNCProxyType = (ProtocolVNC.ProxyType)Enum.Parse(typeof(ProtocolVNC.ProxyType), (string)dataRow["VNCProxyType"]);
+ connectionInfo.VNCCompression = (ProtocolVNC.Compression)Enum.Parse(typeof(ProtocolVNC.Compression),
+ (string)dataRow["VNCCompression"]);
+ connectionInfo.VNCEncoding =
+ (ProtocolVNC.Encoding)Enum.Parse(typeof(ProtocolVNC.Encoding), (string)dataRow["VNCEncoding"]);
+ connectionInfo.VNCAuthMode =
+ (ProtocolVNC.AuthMode)Enum.Parse(typeof(ProtocolVNC.AuthMode), (string)dataRow["VNCAuthMode"]);
+ connectionInfo.VNCProxyType =
+ (ProtocolVNC.ProxyType)Enum.Parse(typeof(ProtocolVNC.ProxyType), (string)dataRow["VNCProxyType"]);
connectionInfo.VNCProxyIP = (string)dataRow["VNCProxyIP"];
connectionInfo.VNCProxyPort = (int)dataRow["VNCProxyPort"];
connectionInfo.VNCProxyUsername = (string)dataRow["VNCProxyUsername"];
connectionInfo.VNCProxyPassword = DecryptValue((string)dataRow["VNCProxyPassword"]);
- connectionInfo.VNCColors = (ProtocolVNC.Colors)Enum.Parse(typeof(ProtocolVNC.Colors), (string)dataRow["VNCColors"]);
- connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Enum.Parse(typeof(ProtocolVNC.SmartSizeMode), (string)dataRow["VNCSmartSizeMode"]);
+ connectionInfo.VNCColors =
+ (ProtocolVNC.Colors)Enum.Parse(typeof(ProtocolVNC.Colors), (string)dataRow["VNCColors"]);
+ connectionInfo.VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Enum.Parse(typeof(ProtocolVNC.SmartSizeMode),
+ (string)dataRow
+ ["VNCSmartSizeMode"]);
connectionInfo.VNCViewOnly = (bool)dataRow["VNCViewOnly"];
- connectionInfo.RDGatewayUsageMethod = (RdpProtocol.RDGatewayUsageMethod)Enum.Parse(typeof(RdpProtocol.RDGatewayUsageMethod), (string)dataRow["RDGatewayUsageMethod"]);
+ connectionInfo.RDGatewayUsageMethod =
+ (RdpProtocol.RDGatewayUsageMethod)Enum.Parse(typeof(RdpProtocol.RDGatewayUsageMethod),
+ (string)dataRow["RDGatewayUsageMethod"]);
connectionInfo.RDGatewayHostname = (string)dataRow["RDGatewayHostname"];
- connectionInfo.RDGatewayUseConnectionCredentials = (RdpProtocol.RDGatewayUseConnectionCredentials)Enum.Parse(typeof(RdpProtocol.RDGatewayUseConnectionCredentials), (string)dataRow["RDGatewayUseConnectionCredentials"]);
+ connectionInfo.RDGatewayUseConnectionCredentials =
+ (RdpProtocol.RDGatewayUseConnectionCredentials)Enum.Parse(
+ typeof(RdpProtocol.
+ RDGatewayUseConnectionCredentials),
+ (string)dataRow
+ ["RDGatewayUseConnectionCredentials"]);
connectionInfo.RDGatewayUsername = (string)dataRow["RDGatewayUsername"];
connectionInfo.RDGatewayPassword = DecryptValue((string)dataRow["RDGatewayPassword"]);
connectionInfo.RDGatewayDomain = (string)dataRow["RDGatewayDomain"];
@@ -189,7 +214,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.Inheritance.VNCViewOnly = (bool)dataRow["InheritVNCViewOnly"];
connectionInfo.Inheritance.RDGatewayUsageMethod = (bool)dataRow["InheritRDGatewayUsageMethod"];
connectionInfo.Inheritance.RDGatewayHostname = (bool)dataRow["InheritRDGatewayHostname"];
- connectionInfo.Inheritance.RDGatewayUseConnectionCredentials = (bool)dataRow["InheritRDGatewayUseConnectionCredentials"];
+ connectionInfo.Inheritance.RDGatewayUseConnectionCredentials =
+ (bool)dataRow["InheritRDGatewayUseConnectionCredentials"];
connectionInfo.Inheritance.RDGatewayUsername = (bool)dataRow["InheritRDGatewayUsername"];
connectionInfo.Inheritance.RDGatewayPassword = (bool)dataRow["InheritRDGatewayPassword"];
connectionInfo.Inheritance.RDGatewayDomain = (bool)dataRow["InheritRDGatewayDomain"];
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableSerializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableSerializer.cs
index eb38e6c0..be249173 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableSerializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableSerializer.cs
@@ -12,7 +12,7 @@ using System.Security;
namespace mRemoteNG.Config.Serializers.MsSql
{
- public class DataTableSerializer : ISerializer
+ public class DataTableSerializer : ISerializer
{
private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey;
@@ -23,7 +23,9 @@ namespace mRemoteNG.Config.Serializers.MsSql
public Version Version { get; } = new Version(2, 7);
- public DataTableSerializer(SaveFilter saveFilter, ICryptographyProvider cryptographyProvider, SecureString encryptionKey)
+ public DataTableSerializer(SaveFilter saveFilter,
+ ICryptographyProvider cryptographyProvider,
+ SecureString encryptionKey)
{
_saveFilter = saveFilter.ThrowIfNull(nameof(saveFilter));
_cryptographyProvider = cryptographyProvider.ThrowIfNull(nameof(cryptographyProvider));
@@ -187,7 +189,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
private void SetPrimaryKey(DataTable dataTable)
{
- dataTable.PrimaryKey = new[] { dataTable.Columns["ConstantID"] };
+ dataTable.PrimaryKey = new[] {dataTable.Columns["ConstantID"]};
}
private void SerializeNodesRecursive(ConnectionInfo connectionInfo)
@@ -255,14 +257,16 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["VNCProxyIP"] = connectionInfo.VNCProxyIP;
dataRow["VNCProxyPort"] = connectionInfo.VNCProxyPort;
dataRow["VNCProxyUsername"] = connectionInfo.VNCProxyUsername;
- dataRow["VNCProxyPassword"] = _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey);
+ dataRow["VNCProxyPassword"] =
+ _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey);
dataRow["VNCColors"] = connectionInfo.VNCColors;
dataRow["VNCSmartSizeMode"] = connectionInfo.VNCSmartSizeMode;
dataRow["VNCViewOnly"] = connectionInfo.VNCViewOnly;
dataRow["RDGatewayUsageMethod"] = connectionInfo.RDGatewayUsageMethod;
dataRow["RDGatewayHostname"] = connectionInfo.RDGatewayHostname;
dataRow["RDGatewayUseConnectionCredentials"] = connectionInfo.RDGatewayUseConnectionCredentials;
- dataRow["RDGatewayUsername"] = _cryptographyProvider.Encrypt(connectionInfo.RDGatewayUsername, _encryptionKey);
+ dataRow["RDGatewayUsername"] =
+ _cryptographyProvider.Encrypt(connectionInfo.RDGatewayUsername, _encryptionKey);
dataRow["RDGatewayPassword"] = connectionInfo.RDGatewayPassword;
dataRow["RDGatewayDomain"] = connectionInfo.RDGatewayDomain;
if (_saveFilter.SaveInheritance)
@@ -315,7 +319,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritVNCViewOnly"] = connectionInfo.Inheritance.VNCViewOnly;
dataRow["InheritRDGatewayUsageMethod"] = connectionInfo.Inheritance.RDGatewayUsageMethod;
dataRow["InheritRDGatewayHostname"] = connectionInfo.Inheritance.RDGatewayHostname;
- dataRow["InheritRDGatewayUseConnectionCredentials"] = connectionInfo.Inheritance.RDGatewayUseConnectionCredentials;
+ dataRow["InheritRDGatewayUseConnectionCredentials"] =
+ connectionInfo.Inheritance.RDGatewayUseConnectionCredentials;
dataRow["InheritRDGatewayUsername"] = connectionInfo.Inheritance.RDGatewayUsername;
dataRow["InheritRDGatewayPassword"] = connectionInfo.Inheritance.RDGatewayPassword;
dataRow["InheritRDGatewayDomain"] = connectionInfo.Inheritance.RDGatewayDomain;
@@ -375,6 +380,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritRDGatewayPassword"] = false;
dataRow["InheritRDGatewayDomain"] = false;
}
+
_dataTable.Rows.Add(dataRow);
}
}
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs
index f8cdb35f..696c6070 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesModel.cs
@@ -17,4 +17,4 @@
///
public bool Expanded { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesXmlSerializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesXmlSerializer.cs
index da76a8dc..3af6108d 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesXmlSerializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/LocalConnectionPropertiesXmlSerializer.cs
@@ -8,8 +8,8 @@ using System.Xml.Linq;
namespace mRemoteNG.Config.Serializers.MsSql
{
- public class LocalConnectionPropertiesXmlSerializer :
- ISerializer, string>,
+ public class LocalConnectionPropertiesXmlSerializer :
+ ISerializer, string>,
IDeserializer>
{
public Version Version { get; } = new Version(1, 0);
@@ -17,10 +17,10 @@ namespace mRemoteNG.Config.Serializers.MsSql
public string Serialize(IEnumerable models)
{
var localConnections = models
- .Select(m => new XElement("Node",
- new XAttribute("ConnectionId", m.ConnectionId),
- new XAttribute("Connected", m.Connected),
- new XAttribute("Expanded", m.Expanded)));
+ .Select(m => new XElement("Node",
+ new XAttribute("ConnectionId", m.ConnectionId),
+ new XAttribute("Connected", m.Connected),
+ new XAttribute("Expanded", m.Expanded)));
var root = new XElement("LocalConnections", localConnections);
var xdoc = new XDocument(new XDeclaration("1.0", "utf-8", null), root);
@@ -34,20 +34,21 @@ namespace mRemoteNG.Config.Serializers.MsSql
var xdoc = XDocument.Parse(serializedData);
return xdoc
- .Descendants("Node")
- .Where(e => e.Attribute("ConnectionId") != null)
- .Select(e => new LocalConnectionPropertiesModel
- {
- ConnectionId = e.Attribute("ConnectionId")?.Value,
- Connected = bool.Parse(e.Attribute("Connected")?.Value ?? "False"),
- Expanded = bool.Parse(e.Attribute("Expanded")?.Value ?? "False")
- });
+ .Descendants("Node")
+ .Where(e => e.Attribute("ConnectionId") != null)
+ .Select(e => new LocalConnectionPropertiesModel
+ {
+ ConnectionId = e.Attribute("ConnectionId")?.Value,
+ Connected = bool.Parse(e.Attribute("Connected")?.Value ?? "False"),
+ Expanded = bool.Parse(e.Attribute("Expanded")?.Value ?? "False")
+ });
}
private static string WriteXmlToString(XNode xmlDocument)
{
string xmlString;
- var xmlWriterSettings = new XmlWriterSettings { Indent = true, IndentChars = " ", Encoding = Encoding.UTF8 };
+ var xmlWriterSettings = new XmlWriterSettings
+ {Indent = true, IndentChars = " ", Encoding = Encoding.UTF8};
var memoryStream = new MemoryStream();
using (var xmlTextWriter = XmlWriter.Create(memoryStream, xmlWriterSettings))
{
@@ -57,7 +58,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
memoryStream.Seek(0, SeekOrigin.Begin);
xmlString = streamReader.ReadToEnd();
}
+
return xmlString;
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlConnectionListMetaData.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlConnectionListMetaData.cs
index 12e8ce86..98d61ae4 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlConnectionListMetaData.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlConnectionListMetaData.cs
@@ -10,4 +10,4 @@ namespace mRemoteNG.Config.Serializers.MsSql
public bool Export { get; set; }
public Version ConfVersion { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlDatabaseMetaDataRetriever.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlDatabaseMetaDataRetriever.cs
index 8c97292d..2bfa7ef6 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlDatabaseMetaDataRetriever.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/SqlDatabaseMetaDataRetriever.cs
@@ -29,7 +29,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
Name = sqlDataReader["Name"] as string ?? "",
Protected = sqlDataReader["Protected"] as string ?? "",
Export = (bool)sqlDataReader["Export"],
- ConfVersion = new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture))
+ ConfVersion =
+ new Version(Convert.ToString(sqlDataReader["confVersion"], CultureInfo.InvariantCulture))
};
}
catch (Exception ex)
@@ -42,6 +43,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
if (sqlDataReader != null && !sqlDataReader.IsClosed)
sqlDataReader.Close();
}
+
return metaData;
}
}
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer26.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer26.cs
index 591f1291..7ccaa95f 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer26.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer26.cs
@@ -8,7 +8,7 @@ using System.Xml.Linq;
namespace mRemoteNG.Config.Serializers.Xml
{
// ReSharper disable once InconsistentNaming
- public class XmlConnectionNodeSerializer26 : ISerializer
+ public class XmlConnectionNodeSerializer26 : ISerializer
{
private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey;
@@ -16,7 +16,9 @@ namespace mRemoteNG.Config.Serializers.Xml
public Version Version { get; } = new Version(2, 6);
- public XmlConnectionNodeSerializer26(ICryptographyProvider cryptographyProvider, SecureString encryptionKey, SaveFilter saveFilter)
+ public XmlConnectionNodeSerializer26(ICryptographyProvider cryptographyProvider,
+ SecureString encryptionKey,
+ SaveFilter saveFilter)
{
if (cryptographyProvider == null)
throw new ArgumentNullException(nameof(cryptographyProvider));
@@ -52,15 +54,16 @@ namespace mRemoteNG.Config.Serializers.Xml
// TODO: remove
element.Add(_saveFilter.SaveUsername
- ? new XAttribute("Username", connectionInfo.Username)
- : new XAttribute("Username", ""));
+ ? new XAttribute("Username", connectionInfo.Username)
+ : new XAttribute("Username", ""));
element.Add(_saveFilter.SaveDomain
- ? new XAttribute("Domain", connectionInfo.Domain)
- : new XAttribute("Domain", ""));
+ ? new XAttribute("Domain", connectionInfo.Domain)
+ : new XAttribute("Domain", ""));
if (_saveFilter.SavePassword && !connectionInfo.Inheritance.Password)
- element.Add(new XAttribute("Password", _cryptographyProvider.Encrypt(connectionInfo.Password, _encryptionKey)));
+ element.Add(new XAttribute("Password",
+ _cryptographyProvider.Encrypt(connectionInfo.Password, _encryptionKey)));
else
element.Add(new XAttribute("Password", ""));
@@ -68,31 +71,42 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
element.Add(new XAttribute("Port", connectionInfo.Port));
- element.Add(new XAttribute("ConnectToConsole", connectionInfo.UseConsoleSession.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("ConnectToConsole",
+ connectionInfo.UseConsoleSession.ToString().ToLowerInvariant()));
element.Add(new XAttribute("UseCredSsp", connectionInfo.UseCredSsp.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RenderingEngine", connectionInfo.RenderingEngine));
element.Add(new XAttribute("ICAEncryptionStrength", connectionInfo.ICAEncryptionStrength));
element.Add(new XAttribute("RDPAuthenticationLevel", connectionInfo.RDPAuthenticationLevel));
element.Add(new XAttribute("RDPMinutesToIdleTimeout", connectionInfo.RDPMinutesToIdleTimeout));
- element.Add(new XAttribute("RDPAlertIdleTimeout", connectionInfo.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RDPAlertIdleTimeout",
+ connectionInfo.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
element.Add(new XAttribute("LoadBalanceInfo", connectionInfo.LoadBalanceInfo));
element.Add(new XAttribute("Colors", connectionInfo.Colors));
element.Add(new XAttribute("Resolution", connectionInfo.Resolution));
- element.Add(new XAttribute("AutomaticResize", connectionInfo.AutomaticResize.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("DisplayWallpaper", connectionInfo.DisplayWallpaper.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("AutomaticResize",
+ connectionInfo.AutomaticResize.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("DisplayWallpaper",
+ connectionInfo.DisplayWallpaper.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisplayThemes", connectionInfo.DisplayThemes.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("EnableFontSmoothing", connectionInfo.EnableFontSmoothing.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("EnableDesktopComposition", connectionInfo.EnableDesktopComposition.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("EnableFontSmoothing",
+ connectionInfo.EnableFontSmoothing.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("EnableDesktopComposition",
+ connectionInfo.EnableDesktopComposition.ToString().ToLowerInvariant()));
element.Add(new XAttribute("CacheBitmaps", connectionInfo.CacheBitmaps.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectDiskDrives", connectionInfo.RedirectDiskDrives.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectDiskDrives",
+ connectionInfo.RedirectDiskDrives.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectPorts", connectionInfo.RedirectPorts.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectPrinters", connectionInfo.RedirectPrinters.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectClipboard", connectionInfo.RedirectClipboard.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectSmartCards", connectionInfo.RedirectSmartCards.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectPrinters",
+ connectionInfo.RedirectPrinters.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectClipboard",
+ connectionInfo.RedirectClipboard.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectSmartCards",
+ connectionInfo.RedirectSmartCards.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectSound", connectionInfo.RedirectSound.ToString()));
element.Add(new XAttribute("SoundQuality", connectionInfo.SoundQuality.ToString()));
element.Add(new XAttribute("RedirectKeys", connectionInfo.RedirectKeys.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("Connected", (connectionInfo.OpenConnections.Count > 0).ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("Connected",
+ (connectionInfo.OpenConnections.Count > 0).ToString().ToLowerInvariant()));
element.Add(new XAttribute("PreExtApp", connectionInfo.PreExtApp));
element.Add(new XAttribute("PostExtApp", connectionInfo.PostExtApp));
element.Add(new XAttribute("MacAddress", connectionInfo.MacAddress));
@@ -106,93 +120,163 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("VNCProxyPort", connectionInfo.VNCProxyPort));
element.Add(_saveFilter.SaveUsername
- ? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
- : new XAttribute("VNCProxyUsername", ""));
+ ? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
+ : new XAttribute("VNCProxyUsername", ""));
element.Add(_saveFilter.SavePassword
- ? new XAttribute("VNCProxyPassword",
- _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey))
- : new XAttribute("VNCProxyPassword", ""));
+ ? new XAttribute("VNCProxyPassword",
+ _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword,
+ _encryptionKey))
+ : new XAttribute("VNCProxyPassword", ""));
element.Add(new XAttribute("VNCColors", connectionInfo.VNCColors));
element.Add(new XAttribute("VNCSmartSizeMode", connectionInfo.VNCSmartSizeMode));
element.Add(new XAttribute("VNCViewOnly", connectionInfo.VNCViewOnly.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RDGatewayUsageMethod", connectionInfo.RDGatewayUsageMethod));
element.Add(new XAttribute("RDGatewayHostname", connectionInfo.RDGatewayHostname));
- element.Add(new XAttribute("RDGatewayUseConnectionCredentials", connectionInfo.RDGatewayUseConnectionCredentials));
+ element.Add(new XAttribute("RDGatewayUseConnectionCredentials",
+ connectionInfo.RDGatewayUseConnectionCredentials));
element.Add(_saveFilter.SaveUsername
- ? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
- : new XAttribute("RDGatewayUsername", ""));
+ ? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
+ : new XAttribute("RDGatewayUsername", ""));
element.Add(_saveFilter.SavePassword
- ? new XAttribute("RDGatewayPassword",
- _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey))
- : new XAttribute("RDGatewayPassword", ""));
+ ? new XAttribute("RDGatewayPassword",
+ _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword,
+ _encryptionKey))
+ : new XAttribute("RDGatewayPassword", ""));
element.Add(_saveFilter.SaveDomain
- ? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
- : new XAttribute("RDGatewayDomain", ""));
+ ? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
+ : new XAttribute("RDGatewayDomain", ""));
}
private void SetInheritanceAttributes(XContainer element, IInheritable connectionInfo)
{
if (_saveFilter.SaveInheritance)
{
- element.Add(new XAttribute("InheritCacheBitmaps", connectionInfo.Inheritance.CacheBitmaps.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritColors", connectionInfo.Inheritance.Colors.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritDescription", connectionInfo.Inheritance.Description.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritDisplayThemes", connectionInfo.Inheritance.DisplayThemes.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritDisplayWallpaper", connectionInfo.Inheritance.DisplayWallpaper.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritEnableFontSmoothing", connectionInfo.Inheritance.EnableFontSmoothing.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritEnableDesktopComposition", connectionInfo.Inheritance.EnableDesktopComposition.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritDomain", connectionInfo.Inheritance.Domain.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritIcon", connectionInfo.Inheritance.Icon.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPanel", connectionInfo.Inheritance.Panel.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPassword", connectionInfo.Inheritance.Password.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPort", connectionInfo.Inheritance.Port.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritProtocol", connectionInfo.Inheritance.Protocol.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPuttySession", connectionInfo.Inheritance.PuttySession.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectDiskDrives", connectionInfo.Inheritance.RedirectDiskDrives.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectKeys", connectionInfo.Inheritance.RedirectKeys.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectPorts", connectionInfo.Inheritance.RedirectPorts.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectPrinters", connectionInfo.Inheritance.RedirectPrinters.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectSmartCards", connectionInfo.Inheritance.RedirectSmartCards.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRedirectSound", connectionInfo.Inheritance.RedirectSound.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritSoundQuality", connectionInfo.Inheritance.SoundQuality.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritResolution", connectionInfo.Inheritance.Resolution.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritAutomaticResize", connectionInfo.Inheritance.AutomaticResize.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritUseConsoleSession", connectionInfo.Inheritance.UseConsoleSession.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritUseCredSsp", connectionInfo.Inheritance.UseCredSsp.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRenderingEngine", connectionInfo.Inheritance.RenderingEngine.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritUsername", connectionInfo.Inheritance.Username.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritICAEncryptionStrength", connectionInfo.Inheritance.ICAEncryptionStrength.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDPAuthenticationLevel", connectionInfo.Inheritance.RDPAuthenticationLevel.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDPMinutesToIdleTimeout", connectionInfo.Inheritance.RDPMinutesToIdleTimeout.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDPAlertIdleTimeout", connectionInfo.Inheritance.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritLoadBalanceInfo", connectionInfo.Inheritance.LoadBalanceInfo.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPreExtApp", connectionInfo.Inheritance.PreExtApp.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritPostExtApp", connectionInfo.Inheritance.PostExtApp.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritMacAddress", connectionInfo.Inheritance.MacAddress.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritUserField", connectionInfo.Inheritance.UserField.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritExtApp", connectionInfo.Inheritance.ExtApp.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCCompression", connectionInfo.Inheritance.VNCCompression.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCEncoding", connectionInfo.Inheritance.VNCEncoding.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCAuthMode", connectionInfo.Inheritance.VNCAuthMode.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCProxyType", connectionInfo.Inheritance.VNCProxyType.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCProxyIP", connectionInfo.Inheritance.VNCProxyIP.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCProxyPort", connectionInfo.Inheritance.VNCProxyPort.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCProxyUsername", connectionInfo.Inheritance.VNCProxyUsername.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCProxyPassword", connectionInfo.Inheritance.VNCProxyPassword.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCColors", connectionInfo.Inheritance.VNCColors.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCSmartSizeMode", connectionInfo.Inheritance.VNCSmartSizeMode.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritVNCViewOnly", connectionInfo.Inheritance.VNCViewOnly.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayUsageMethod", connectionInfo.Inheritance.RDGatewayUsageMethod.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayHostname", connectionInfo.Inheritance.RDGatewayHostname.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", connectionInfo.Inheritance.RDGatewayUseConnectionCredentials.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayUsername", connectionInfo.Inheritance.RDGatewayUsername.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayPassword", connectionInfo.Inheritance.RDGatewayPassword.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("InheritRDGatewayDomain", connectionInfo.Inheritance.RDGatewayDomain.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritCacheBitmaps",
+ connectionInfo.Inheritance.CacheBitmaps.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritColors",
+ connectionInfo.Inheritance.Colors.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritDescription",
+ connectionInfo.Inheritance.Description.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritDisplayThemes",
+ connectionInfo.Inheritance.DisplayThemes.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritDisplayWallpaper",
+ connectionInfo.Inheritance.DisplayWallpaper.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritEnableFontSmoothing",
+ connectionInfo
+ .Inheritance.EnableFontSmoothing.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritEnableDesktopComposition",
+ connectionInfo
+ .Inheritance.EnableDesktopComposition.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritDomain",
+ connectionInfo.Inheritance.Domain.ToString().ToLowerInvariant()));
+ element.Add(
+ new XAttribute("InheritIcon",
+ connectionInfo.Inheritance.Icon.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritPanel",
+ connectionInfo.Inheritance.Panel.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritPassword",
+ connectionInfo.Inheritance.Password.ToString().ToLowerInvariant()));
+ element.Add(
+ new XAttribute("InheritPort",
+ connectionInfo.Inheritance.Port.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritProtocol",
+ connectionInfo.Inheritance.Protocol.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritPuttySession",
+ connectionInfo.Inheritance.PuttySession.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectDiskDrives",
+ connectionInfo
+ .Inheritance.RedirectDiskDrives.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectKeys",
+ connectionInfo.Inheritance.RedirectKeys.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectPorts",
+ connectionInfo.Inheritance.RedirectPorts.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectPrinters",
+ connectionInfo.Inheritance.RedirectPrinters.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectSmartCards",
+ connectionInfo
+ .Inheritance.RedirectSmartCards.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRedirectSound",
+ connectionInfo.Inheritance.RedirectSound.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritSoundQuality",
+ connectionInfo.Inheritance.SoundQuality.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritResolution",
+ connectionInfo.Inheritance.Resolution.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritAutomaticResize",
+ connectionInfo.Inheritance.AutomaticResize.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritUseConsoleSession",
+ connectionInfo.Inheritance.UseConsoleSession.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritUseCredSsp",
+ connectionInfo.Inheritance.UseCredSsp.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRenderingEngine",
+ connectionInfo.Inheritance.RenderingEngine.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritUsername",
+ connectionInfo.Inheritance.Username.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritICAEncryptionStrength",
+ connectionInfo
+ .Inheritance.ICAEncryptionStrength.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDPAuthenticationLevel",
+ connectionInfo
+ .Inheritance.RDPAuthenticationLevel.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDPMinutesToIdleTimeout",
+ connectionInfo
+ .Inheritance.RDPMinutesToIdleTimeout.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDPAlertIdleTimeout",
+ connectionInfo
+ .Inheritance.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritLoadBalanceInfo",
+ connectionInfo.Inheritance.LoadBalanceInfo.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritPreExtApp",
+ connectionInfo.Inheritance.PreExtApp.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritPostExtApp",
+ connectionInfo.Inheritance.PostExtApp.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritMacAddress",
+ connectionInfo.Inheritance.MacAddress.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritUserField",
+ connectionInfo.Inheritance.UserField.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritExtApp",
+ connectionInfo.Inheritance.ExtApp.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCCompression",
+ connectionInfo.Inheritance.VNCCompression.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCEncoding",
+ connectionInfo.Inheritance.VNCEncoding.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCAuthMode",
+ connectionInfo.Inheritance.VNCAuthMode.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCProxyType",
+ connectionInfo.Inheritance.VNCProxyType.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCProxyIP",
+ connectionInfo.Inheritance.VNCProxyIP.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCProxyPort",
+ connectionInfo.Inheritance.VNCProxyPort.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCProxyUsername",
+ connectionInfo.Inheritance.VNCProxyUsername.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCProxyPassword",
+ connectionInfo.Inheritance.VNCProxyPassword.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCColors",
+ connectionInfo.Inheritance.VNCColors.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCSmartSizeMode",
+ connectionInfo.Inheritance.VNCSmartSizeMode.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritVNCViewOnly",
+ connectionInfo.Inheritance.VNCViewOnly.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayUsageMethod",
+ connectionInfo
+ .Inheritance.RDGatewayUsageMethod.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayHostname",
+ connectionInfo.Inheritance.RDGatewayHostname.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials",
+ connectionInfo
+ .Inheritance.RDGatewayUseConnectionCredentials.ToString()
+ .ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayUsername",
+ connectionInfo.Inheritance.RDGatewayUsername.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayPassword",
+ connectionInfo.Inheritance.RDGatewayPassword.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("InheritRDGatewayDomain",
+ connectionInfo.Inheritance.RDGatewayDomain.ToString().ToLowerInvariant()));
}
else
{
@@ -214,7 +298,7 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("InheritRedirectDiskDrives", falseString));
element.Add(new XAttribute("InheritRedirectKeys", falseString));
element.Add(new XAttribute("InheritRedirectPorts", falseString));
- element.Add(new XAttribute("InheritRedirectPrinters", falseString));
+ element.Add(new XAttribute("InheritRedirectPrinters", falseString));
element.Add(new XAttribute("InheritRedirectSmartCards", falseString));
element.Add(new XAttribute("InheritRedirectSound", falseString));
element.Add(new XAttribute("InheritSoundQuality", falseString));
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs
index 10b231d1..c86d3a45 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionNodeSerializer27.cs
@@ -10,7 +10,7 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Config.Serializers.Xml
{
// ReSharper disable once InconsistentNaming
- public class XmlConnectionNodeSerializer27 : ISerializer
+ public class XmlConnectionNodeSerializer27 : ISerializer
{
private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey;
@@ -18,7 +18,9 @@ namespace mRemoteNG.Config.Serializers.Xml
public Version Version { get; } = new Version(2, 7);
- public XmlConnectionNodeSerializer27(ICryptographyProvider cryptographyProvider, SecureString encryptionKey, SaveFilter saveFilter)
+ public XmlConnectionNodeSerializer27(ICryptographyProvider cryptographyProvider,
+ SecureString encryptionKey,
+ SaveFilter saveFilter)
{
_cryptographyProvider = cryptographyProvider.ThrowIfNull(nameof(cryptographyProvider));
_encryptionKey = encryptionKey.ThrowIfNull(nameof(encryptionKey));
@@ -50,31 +52,42 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
element.Add(new XAttribute("Port", connectionInfo.Port));
- element.Add(new XAttribute("ConnectToConsole", connectionInfo.UseConsoleSession.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("ConnectToConsole",
+ connectionInfo.UseConsoleSession.ToString().ToLowerInvariant()));
element.Add(new XAttribute("UseCredSsp", connectionInfo.UseCredSsp.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RenderingEngine", connectionInfo.RenderingEngine));
element.Add(new XAttribute("ICAEncryptionStrength", connectionInfo.ICAEncryptionStrength));
element.Add(new XAttribute("RDPAuthenticationLevel", connectionInfo.RDPAuthenticationLevel));
element.Add(new XAttribute("RDPMinutesToIdleTimeout", connectionInfo.RDPMinutesToIdleTimeout));
- element.Add(new XAttribute("RDPAlertIdleTimeout", connectionInfo.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RDPAlertIdleTimeout",
+ connectionInfo.RDPAlertIdleTimeout.ToString().ToLowerInvariant()));
element.Add(new XAttribute("LoadBalanceInfo", connectionInfo.LoadBalanceInfo));
element.Add(new XAttribute("Colors", connectionInfo.Colors));
element.Add(new XAttribute("Resolution", connectionInfo.Resolution));
- element.Add(new XAttribute("AutomaticResize", connectionInfo.AutomaticResize.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("DisplayWallpaper", connectionInfo.DisplayWallpaper.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("AutomaticResize",
+ connectionInfo.AutomaticResize.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("DisplayWallpaper",
+ connectionInfo.DisplayWallpaper.ToString().ToLowerInvariant()));
element.Add(new XAttribute("DisplayThemes", connectionInfo.DisplayThemes.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("EnableFontSmoothing", connectionInfo.EnableFontSmoothing.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("EnableDesktopComposition", connectionInfo.EnableDesktopComposition.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("EnableFontSmoothing",
+ connectionInfo.EnableFontSmoothing.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("EnableDesktopComposition",
+ connectionInfo.EnableDesktopComposition.ToString().ToLowerInvariant()));
element.Add(new XAttribute("CacheBitmaps", connectionInfo.CacheBitmaps.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectDiskDrives", connectionInfo.RedirectDiskDrives.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectDiskDrives",
+ connectionInfo.RedirectDiskDrives.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectPorts", connectionInfo.RedirectPorts.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectPrinters", connectionInfo.RedirectPrinters.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectClipboard", connectionInfo.RedirectClipboard.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("RedirectSmartCards", connectionInfo.RedirectSmartCards.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectPrinters",
+ connectionInfo.RedirectPrinters.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectClipboard",
+ connectionInfo.RedirectClipboard.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("RedirectSmartCards",
+ connectionInfo.RedirectSmartCards.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RedirectSound", connectionInfo.RedirectSound.ToString()));
element.Add(new XAttribute("SoundQuality", connectionInfo.SoundQuality.ToString()));
element.Add(new XAttribute("RedirectKeys", connectionInfo.RedirectKeys.ToString().ToLowerInvariant()));
- element.Add(new XAttribute("Connected", (connectionInfo.OpenConnections.Count > 0).ToString().ToLowerInvariant()));
+ element.Add(new XAttribute("Connected",
+ (connectionInfo.OpenConnections.Count > 0).ToString().ToLowerInvariant()));
element.Add(new XAttribute("PreExtApp", connectionInfo.PreExtApp));
element.Add(new XAttribute("PostExtApp", connectionInfo.PostExtApp));
element.Add(new XAttribute("MacAddress", connectionInfo.MacAddress));
@@ -88,33 +101,36 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("VNCProxyPort", connectionInfo.VNCProxyPort));
element.Add(_saveFilter.SaveUsername
- ? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
- : new XAttribute("VNCProxyUsername", ""));
+ ? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
+ : new XAttribute("VNCProxyUsername", ""));
element.Add(_saveFilter.SavePassword
- ? new XAttribute("VNCProxyPassword",
- _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey))
- : new XAttribute("VNCProxyPassword", ""));
+ ? new XAttribute("VNCProxyPassword",
+ _cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword,
+ _encryptionKey))
+ : new XAttribute("VNCProxyPassword", ""));
element.Add(new XAttribute("VNCColors", connectionInfo.VNCColors));
element.Add(new XAttribute("VNCSmartSizeMode", connectionInfo.VNCSmartSizeMode));
element.Add(new XAttribute("VNCViewOnly", connectionInfo.VNCViewOnly.ToString().ToLowerInvariant()));
element.Add(new XAttribute("RDGatewayUsageMethod", connectionInfo.RDGatewayUsageMethod));
element.Add(new XAttribute("RDGatewayHostname", connectionInfo.RDGatewayHostname));
- element.Add(new XAttribute("RDGatewayUseConnectionCredentials", connectionInfo.RDGatewayUseConnectionCredentials));
+ element.Add(new XAttribute("RDGatewayUseConnectionCredentials",
+ connectionInfo.RDGatewayUseConnectionCredentials));
element.Add(_saveFilter.SaveUsername
- ? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
- : new XAttribute("RDGatewayUsername", ""));
+ ? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
+ : new XAttribute("RDGatewayUsername", ""));
element.Add(_saveFilter.SavePassword
- ? new XAttribute("RDGatewayPassword",
- _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey))
- : new XAttribute("RDGatewayPassword", ""));
+ ? new XAttribute("RDGatewayPassword",
+ _cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword,
+ _encryptionKey))
+ : new XAttribute("RDGatewayPassword", ""));
element.Add(_saveFilter.SaveDomain
- ? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
- : new XAttribute("RDGatewayDomain", ""));
+ ? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
+ : new XAttribute("RDGatewayDomain", ""));
}
private void SetInheritanceAttributes(XContainer element, IInheritable connectionInfo)
@@ -194,8 +210,8 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("InheritRedirectDiskDrives", falseString));
element.Add(new XAttribute("InheritRedirectKeys", falseString));
element.Add(new XAttribute("InheritRedirectPorts", falseString));
- element.Add(new XAttribute("InheritRedirectPrinters", falseString));
- element.Add(new XAttribute("InheritRedirectClipboard", falseString));
+ element.Add(new XAttribute("InheritRedirectPrinters", falseString));
+ element.Add(new XAttribute("InheritRedirectClipboard", falseString));
element.Add(new XAttribute("InheritRedirectSmartCards", falseString));
element.Add(new XAttribute("InheritRedirectSound", falseString));
element.Add(new XAttribute("InheritSoundQuality", falseString));
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs
index a9b7cebd..a59e97fc 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs
@@ -101,7 +101,9 @@ namespace mRemoteNG.Config.Serializers.Xml
private void ValidateConnectionFileVersion()
{
if (_xmlDocument.DocumentElement != null && _xmlDocument.DocumentElement.HasAttribute("ConfVersion"))
- _confVersion = Convert.ToDouble(_xmlDocument.DocumentElement.Attributes["ConfVersion"].Value.Replace(",", "."), CultureInfo.InvariantCulture);
+ _confVersion =
+ Convert.ToDouble(_xmlDocument.DocumentElement.Attributes["ConfVersion"].Value.Replace(",", "."),
+ CultureInfo.InvariantCulture);
else
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strOldConffile);
@@ -113,19 +115,22 @@ namespace mRemoteNG.Config.Serializers.Xml
private void ShowIncompatibleVersionDialogBox()
{
CTaskDialog.ShowTaskDialogBox(
- FrmMain.Default,
- Application.ProductName,
- "Incompatible connection file format",
- $"The format of this connection file is not supported. Please upgrade to a newer version of {Application.ProductName}.",
- string.Format("{1}{0}File Format Version: {2}{0}Highest Supported Version: {3}", Environment.NewLine, ConnectionFileName, _confVersion, MaxSupportedConfVersion),
- "",
- "",
- "",
- "",
- ETaskDialogButtons.Ok,
- ESysIcons.Error,
- ESysIcons.Error
- );
+ FrmMain.Default,
+ Application.ProductName,
+ "Incompatible connection file format",
+ $"The format of this connection file is not supported. Please upgrade to a newer version of {Application.ProductName}.",
+ string
+ .Format("{1}{0}File Format Version: {2}{0}Highest Supported Version: {3}",
+ Environment.NewLine,
+ ConnectionFileName, _confVersion, MaxSupportedConfVersion),
+ "",
+ "",
+ "",
+ "",
+ ETaskDialogButtons.Ok,
+ ESysIcons.Error,
+ ESysIcons.Error
+ );
}
private RootNodeInfo InitializeRootNode(XmlElement connectionsRootElement)
@@ -179,7 +184,7 @@ namespace mRemoteNG.Config.Serializers.Xml
break;
case TreeNodeType.Container:
var containerInfo = new ContainerInfo();
-
+
if (_confVersion >= 0.9)
containerInfo.CopyFrom(GetConnectionInfoFromXml(xmlNode, credentialMap));
if (_confVersion >= 0.8)
@@ -208,10 +213,10 @@ namespace mRemoteNG.Config.Serializers.Xml
if (xmlnode?.Attributes == null)
return null;
- var connectionId = xmlnode.GetAttributeAsString("Id");
+ var connectionId = xmlnode.GetAttributeAsString("Id");
if (string.IsNullOrWhiteSpace(connectionId))
connectionId = Guid.NewGuid().ToString();
- var connectionInfo = new ConnectionInfo(connectionId);
+ var connectionInfo = new ConnectionInfo(connectionId);
try
{
@@ -274,7 +279,7 @@ namespace mRemoteNG.Config.Serializers.Xml
{
if (_confVersion < 0.7)
{
- connectionInfo.Port = xmlnode.GetAttributeAsBool("UseVNC")
+ connectionInfo.Port = xmlnode.GetAttributeAsBool("UseVNC")
? xmlnode.GetAttributeAsInt("VNCPort")
: xmlnode.GetAttributeAsInt("RDPPort");
}
@@ -290,6 +295,7 @@ namespace mRemoteNG.Config.Serializers.Xml
else
connectionInfo.Port = (int)RdpProtocol.Defaults.Port;
}
+
connectionInfo.UseConsoleSession = false;
}
@@ -303,7 +309,7 @@ namespace mRemoteNG.Config.Serializers.Xml
else
{
connectionInfo.RedirectDiskDrives = false;
- connectionInfo.RedirectPrinters = false;
+ connectionInfo.RedirectPrinters = false;
connectionInfo.RedirectPorts = false;
connectionInfo.RedirectSmartCards = false;
}
@@ -368,14 +374,17 @@ namespace mRemoteNG.Config.Serializers.Xml
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.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.RedirectSmartCards =
+ xmlnode.GetAttributeAsBool("InheritRedirectSmartCards");
connectionInfo.Inheritance.RedirectSound = xmlnode.GetAttributeAsBool("InheritRedirectSound");
connectionInfo.Inheritance.Resolution = xmlnode.GetAttributeAsBool("InheritResolution");
- connectionInfo.Inheritance.UseConsoleSession = xmlnode.GetAttributeAsBool("InheritUseConsoleSession");
+ connectionInfo.Inheritance.UseConsoleSession =
+ xmlnode.GetAttributeAsBool("InheritUseConsoleSession");
if (!Runtime.UseCredentialManager || _confVersion <= 2.6) // 1.3 - 2.6
{
@@ -383,6 +392,7 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.Inheritance.Password = xmlnode.GetAttributeAsBool("InheritPassword");
connectionInfo.Inheritance.Username = xmlnode.GetAttributeAsBool("InheritUsername");
}
+
connectionInfo.Icon = xmlnode.GetAttributeAsString("Icon");
connectionInfo.Panel = xmlnode.GetAttributeAsString("Panel");
}
@@ -401,8 +411,10 @@ namespace mRemoteNG.Config.Serializers.Xml
if (_confVersion >= 1.6)
{
- connectionInfo.ICAEncryptionStrength = xmlnode.GetAttributeAsEnum("ICAEncryptionStrength");
- connectionInfo.Inheritance.ICAEncryptionStrength = xmlnode.GetAttributeAsBool("InheritICAEncryptionStrength");
+ 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");
@@ -411,16 +423,19 @@ namespace mRemoteNG.Config.Serializers.Xml
if (_confVersion >= 1.7)
{
- connectionInfo.VNCCompression = xmlnode.GetAttributeAsEnum("VNCCompression");
+ 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.VNCProxyPassword =
+ _decryptor.Decrypt(xmlnode.GetAttributeAsString("VNCProxyPassword"));
connectionInfo.VNCColors = xmlnode.GetAttributeAsEnum("VNCColors");
- connectionInfo.VNCSmartSizeMode = xmlnode.GetAttributeAsEnum("VNCSmartSizeMode");
+ connectionInfo.VNCSmartSizeMode =
+ xmlnode.GetAttributeAsEnum("VNCSmartSizeMode");
connectionInfo.VNCViewOnly = xmlnode.GetAttributeAsBool("VNCViewOnly");
connectionInfo.Inheritance.VNCCompression = xmlnode.GetAttributeAsBool("InheritVNCCompression");
connectionInfo.Inheritance.VNCEncoding = xmlnode.GetAttributeAsBool("InheritVNCEncoding");
@@ -437,13 +452,16 @@ namespace mRemoteNG.Config.Serializers.Xml
if (_confVersion >= 1.8)
{
- connectionInfo.RDPAuthenticationLevel = xmlnode.GetAttributeAsEnum("RDPAuthenticationLevel");
- connectionInfo.Inheritance.RDPAuthenticationLevel = xmlnode.GetAttributeAsBool("InheritRDPAuthenticationLevel");
+ connectionInfo.RDPAuthenticationLevel =
+ xmlnode.GetAttributeAsEnum("RDPAuthenticationLevel");
+ connectionInfo.Inheritance.RDPAuthenticationLevel =
+ xmlnode.GetAttributeAsBool("InheritRDPAuthenticationLevel");
}
if (_confVersion >= 1.9)
{
- connectionInfo.RenderingEngine = xmlnode.GetAttributeAsEnum("RenderingEngine");
+ connectionInfo.RenderingEngine =
+ xmlnode.GetAttributeAsEnum("RenderingEngine");
connectionInfo.MacAddress = xmlnode.GetAttributeAsString("MacAddress");
connectionInfo.Inheritance.RenderingEngine = xmlnode.GetAttributeAsBool("InheritRenderingEngine");
connectionInfo.Inheritance.MacAddress = xmlnode.GetAttributeAsBool("InheritMacAddress");
@@ -464,19 +482,28 @@ namespace mRemoteNG.Config.Serializers.Xml
if (_confVersion >= 2.2)
{
// Get settings
- connectionInfo.RDGatewayUsageMethod = xmlnode.GetAttributeAsEnum("RDGatewayUsageMethod");
+ connectionInfo.RDGatewayUsageMethod =
+ xmlnode.GetAttributeAsEnum("RDGatewayUsageMethod");
connectionInfo.RDGatewayHostname = xmlnode.GetAttributeAsString("RDGatewayHostname");
- connectionInfo.RDGatewayUseConnectionCredentials = xmlnode.GetAttributeAsEnum("RDGatewayUseConnectionCredentials");
+ connectionInfo.RDGatewayUseConnectionCredentials =
+ xmlnode.GetAttributeAsEnum(
+ "RDGatewayUseConnectionCredentials");
connectionInfo.RDGatewayUsername = xmlnode.GetAttributeAsString("RDGatewayUsername");
- connectionInfo.RDGatewayPassword = _decryptor.Decrypt(xmlnode.GetAttributeAsString("RDGatewayPassword"));
+ connectionInfo.RDGatewayPassword =
+ _decryptor.Decrypt(xmlnode.GetAttributeAsString("RDGatewayPassword"));
connectionInfo.RDGatewayDomain = xmlnode.GetAttributeAsString("RDGatewayDomain");
// Get inheritance settings
- 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.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");
}
@@ -487,8 +514,10 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.EnableDesktopComposition = xmlnode.GetAttributeAsBool("EnableDesktopComposition");
// Get inheritance settings
- connectionInfo.Inheritance.EnableFontSmoothing = xmlnode.GetAttributeAsBool("InheritEnableFontSmoothing");
- connectionInfo.Inheritance.EnableDesktopComposition = xmlnode.GetAttributeAsBool("InheritEnableDesktopComposition");
+ connectionInfo.Inheritance.EnableFontSmoothing =
+ xmlnode.GetAttributeAsBool("InheritEnableFontSmoothing");
+ connectionInfo.Inheritance.EnableDesktopComposition =
+ xmlnode.GetAttributeAsBool("InheritEnableDesktopComposition");
}
if (_confVersion >= 2.4)
@@ -507,14 +536,18 @@ namespace mRemoteNG.Config.Serializers.Xml
if (_confVersion >= 2.6)
{
- connectionInfo.SoundQuality = xmlnode.GetAttributeAsEnum("SoundQuality");
+ connectionInfo.SoundQuality =
+ xmlnode.GetAttributeAsEnum("SoundQuality");
connectionInfo.Inheritance.SoundQuality = xmlnode.GetAttributeAsBool("InheritSoundQuality");
connectionInfo.RDPMinutesToIdleTimeout = xmlnode.GetAttributeAsInt("RDPMinutesToIdleTimeout");
- connectionInfo.Inheritance.RDPMinutesToIdleTimeout = xmlnode.GetAttributeAsBool("InheritRDPMinutesToIdleTimeout");
+ connectionInfo.Inheritance.RDPMinutesToIdleTimeout =
+ xmlnode.GetAttributeAsBool("InheritRDPMinutesToIdleTimeout");
connectionInfo.RDPAlertIdleTimeout = xmlnode.GetAttributeAsBool("RDPAlertIdleTimeout");
- connectionInfo.Inheritance.RDPAlertIdleTimeout = xmlnode.GetAttributeAsBool("InheritRDPAlertIdleTimeout");
+ connectionInfo.Inheritance.RDPAlertIdleTimeout =
+ xmlnode.GetAttributeAsBool("InheritRDPAlertIdleTimeout");
}
- if(_confVersion >= 2.7)
+
+ if (_confVersion >= 2.7)
{
connectionInfo.RedirectClipboard = xmlnode.GetAttributeAsBool("RedirectClipboard");
connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard");
@@ -528,7 +561,10 @@ namespace mRemoteNG.Config.Serializers.Xml
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strGetConnectionInfoFromXmlFailed, connectionInfo.Name, ConnectionFileName, ex.Message));
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ string.Format(Language.strGetConnectionInfoFromXmlFailed,
+ connectionInfo.Name, ConnectionFileName,
+ ex.Message));
}
return connectionInfo;
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDocumentCompiler.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDocumentCompiler.cs
index 95c35d4b..acdde98c 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDocumentCompiler.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDocumentCompiler.cs
@@ -16,7 +16,8 @@ namespace mRemoteNG.Config.Serializers.Xml
private SecureString _encryptionKey;
private readonly ISerializer _connectionNodeSerializer;
- public XmlConnectionsDocumentCompiler(ICryptographyProvider cryptographyProvider, ISerializer connectionNodeSerializer)
+ public XmlConnectionsDocumentCompiler(ICryptographyProvider cryptographyProvider,
+ ISerializer connectionNodeSerializer)
{
if (cryptographyProvider == null)
throw new ArgumentNullException(nameof(cryptographyProvider));
@@ -43,7 +44,9 @@ namespace mRemoteNG.Config.Serializers.Xml
var xmlDeclaration = new XDeclaration("1.0", "utf-8", null);
var xmlDocument = new XDocument(xmlDeclaration, rootElement);
if (fullFileEncryption)
- xmlDocument = new XmlConnectionsDocumentEncryptor(_cryptographyProvider).EncryptDocument(xmlDocument, _encryptionKey);
+ xmlDocument =
+ new XmlConnectionsDocumentEncryptor(_cryptographyProvider).EncryptDocument(xmlDocument,
+ _encryptionKey);
return xmlDocument;
}
@@ -55,6 +58,7 @@ namespace mRemoteNG.Config.Serializers.Xml
newElement = CompileConnectionInfoNode(serializationTarget);
parentElement.Add(newElement);
}
+
var serializationTargetAsContainer = serializationTarget as ContainerInfo;
if (serializationTargetAsContainer == null) return;
foreach (var child in serializationTargetAsContainer.Children)
@@ -79,7 +83,8 @@ namespace mRemoteNG.Config.Serializers.Xml
private XElement CompileRootNode(RootNodeInfo rootNodeInfo, bool fullFileEncryption)
{
var rootNodeSerializer = new XmlRootNodeSerializer();
- return rootNodeSerializer.SerializeRootNodeInfo(rootNodeInfo, _cryptographyProvider, _connectionNodeSerializer.Version, fullFileEncryption);
+ return rootNodeSerializer.SerializeRootNodeInfo(rootNodeInfo, _cryptographyProvider,
+ _connectionNodeSerializer.Version, fullFileEncryption);
}
private XElement CompileConnectionInfoNode(ConnectionInfo connectionInfo)
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsSerializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsSerializer.cs
index 4ad97746..ee372c79 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsSerializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsSerializer.cs
@@ -20,7 +20,8 @@ namespace mRemoteNG.Config.Serializers.Xml
public Version Version => _connectionNodeSerializer.Version;
public bool UseFullEncryption { get; set; }
- public XmlConnectionsSerializer(ICryptographyProvider cryptographyProvider, ISerializer connectionNodeSerializer)
+ public XmlConnectionsSerializer(ICryptographyProvider cryptographyProvider,
+ ISerializer connectionNodeSerializer)
{
_cryptographyProvider = cryptographyProvider;
_connectionNodeSerializer = connectionNodeSerializer;
@@ -42,7 +43,8 @@ namespace mRemoteNG.Config.Serializers.Xml
var xml = "";
try
{
- var documentCompiler = new XmlConnectionsDocumentCompiler(_cryptographyProvider, _connectionNodeSerializer);
+ var documentCompiler =
+ new XmlConnectionsDocumentCompiler(_cryptographyProvider, _connectionNodeSerializer);
var xmlDocument = documentCompiler.CompileDocument(serializationTarget, UseFullEncryption);
xml = WriteXmlToString(xmlDocument);
}
@@ -50,13 +52,15 @@ namespace mRemoteNG.Config.Serializers.Xml
{
Runtime.MessageCollector.AddExceptionStackTrace("SaveToXml failed", ex);
}
+
return xml;
}
private static string WriteXmlToString(XNode xmlDocument)
{
string xmlString;
- var xmlWriterSettings = new XmlWriterSettings { Indent = true, IndentChars = " ", Encoding = Encoding.UTF8 };
+ var xmlWriterSettings = new XmlWriterSettings
+ {Indent = true, IndentChars = " ", Encoding = Encoding.UTF8};
var memoryStream = new MemoryStream();
using (var xmlTextWriter = XmlWriter.Create(memoryStream, xmlWriterSettings))
{
@@ -66,6 +70,7 @@ namespace mRemoteNG.Config.Serializers.Xml
memoryStream.Seek(0, SeekOrigin.Begin);
xmlString = streamReader.ReadToEnd();
}
+
return xmlString;
}
}
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs
index 71ecbff7..06520b1c 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlExtensions.cs
@@ -17,7 +17,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
if (string.IsNullOrWhiteSpace(value))
return defaultValue;
- return bool.TryParse(value, out var valueAsBool)
+ return bool.TryParse(value, out var valueAsBool)
? valueAsBool
: defaultValue;
}
@@ -28,8 +28,8 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
if (string.IsNullOrWhiteSpace(value))
return defaultValue;
- return int.TryParse(value, out var valueAsBool)
- ? valueAsBool
+ return int.TryParse(value, out var valueAsBool)
+ ? valueAsBool
: defaultValue;
}
@@ -45,4 +45,4 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
: defaultValue;
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlRootNodeSerializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlRootNodeSerializer.cs
index 9a9f9af9..75a4391e 100644
--- a/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlRootNodeSerializer.cs
+++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/Xml/XmlRootNodeSerializer.cs
@@ -7,27 +7,28 @@ namespace mRemoteNG.Config.Serializers.Xml
{
public class XmlRootNodeSerializer
{
- public XElement SerializeRootNodeInfo(
- RootNodeInfo rootNodeInfo,
- ICryptographyProvider cryptographyProvider,
- Version version,
- bool fullFileEncryption = false)
+ public XElement SerializeRootNodeInfo(RootNodeInfo rootNodeInfo,
+ ICryptographyProvider cryptographyProvider,
+ Version version,
+ bool fullFileEncryption = false)
{
XNamespace xmlNamespace = "http://mremoteng.org";
var element = new XElement(xmlNamespace + "Connections");
- element.Add(new XAttribute(XNamespace.Xmlns+"mrng", xmlNamespace));
+ element.Add(new XAttribute(XNamespace.Xmlns + "mrng", xmlNamespace));
element.Add(new XAttribute(XName.Get("Name"), rootNodeInfo.Name));
- element.Add(new XAttribute(XName.Get("Export"), "false"));
- element.Add(new XAttribute(XName.Get("EncryptionEngine"), cryptographyProvider.CipherEngine));
+ element.Add(new XAttribute(XName.Get("Export"), "false"));
+ element.Add(new XAttribute(XName.Get("EncryptionEngine"), cryptographyProvider.CipherEngine));
element.Add(new XAttribute(XName.Get("BlockCipherMode"), cryptographyProvider.CipherMode));
element.Add(new XAttribute(XName.Get("KdfIterations"), cryptographyProvider.KeyDerivationIterations));
- element.Add(new XAttribute(XName.Get("FullFileEncryption"), fullFileEncryption.ToString().ToLowerInvariant()));
+ element.Add(new XAttribute(XName.Get("FullFileEncryption"),
+ fullFileEncryption.ToString().ToLowerInvariant()));
element.Add(CreateProtectedAttribute(rootNodeInfo, cryptographyProvider));
element.Add(new XAttribute(XName.Get("ConfVersion"), version.ToString(2)));
return element;
}
- private XAttribute CreateProtectedAttribute(RootNodeInfo rootNodeInfo, ICryptographyProvider cryptographyProvider)
+ private XAttribute CreateProtectedAttribute(RootNodeInfo rootNodeInfo,
+ ICryptographyProvider cryptographyProvider)
{
var attribute = new XAttribute(XName.Get("Protected"), "");
var plainText = rootNodeInfo.Password ? "ThisIsProtected" : "ThisIsNotProtected";
diff --git a/mRemoteV1/Config/Serializers/CredentialProviderSerializer/CredentialRepositoryListSerializer.cs b/mRemoteV1/Config/Serializers/CredentialProviderSerializer/CredentialRepositoryListSerializer.cs
index 79365228..ea755999 100644
--- a/mRemoteV1/Config/Serializers/CredentialProviderSerializer/CredentialRepositoryListSerializer.cs
+++ b/mRemoteV1/Config/Serializers/CredentialProviderSerializer/CredentialRepositoryListSerializer.cs
@@ -13,14 +13,14 @@ namespace mRemoteNG.Config.Serializers.CredentialProviderSerializer
{
var xmlDocument = new XDocument(new XDeclaration("1.0", "utf-8", null));
var rootElement = new XElement("CredentialRepositories",
- from provider in credentialProviderCatalog
- select new XElement("CredentialRepository",
- new XAttribute("Id", provider.Config.Id),
- new XAttribute("TypeName", provider.Config.TypeName),
- new XAttribute("Title", provider.Config.Title),
- new XAttribute("Source", provider.Config.Source)
- )
- );
+ from provider in credentialProviderCatalog
+ select new XElement("CredentialRepository",
+ new XAttribute("Id", provider.Config.Id),
+ new XAttribute("TypeName", provider.Config.TypeName),
+ new XAttribute("Title", provider.Config.Title),
+ new XAttribute("Source", provider.Config.Source)
+ )
+ );
xmlDocument.Add(rootElement);
var declaration = xmlDocument.Declaration.ToString();
var documentBody = xmlDocument.ToString();
diff --git a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordDecryptorDecorator.cs b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordDecryptorDecorator.cs
index 3e6d5854..a89ea755 100644
--- a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordDecryptorDecorator.cs
+++ b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordDecryptorDecorator.cs
@@ -12,7 +12,8 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
{
private readonly IDeserializer> _baseDeserializer;
- public XmlCredentialPasswordDecryptorDecorator(IDeserializer> baseDeserializer)
+ public XmlCredentialPasswordDecryptorDecorator(
+ IDeserializer> baseDeserializer)
{
if (baseDeserializer == null)
throw new ArgumentNullException(nameof(baseDeserializer));
@@ -39,10 +40,13 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
var decryptedPassword = cryptoProvider.Decrypt(passwordAttribute.Value, key);
passwordAttribute.SetValue(decryptedPassword);
}
+
return xdoc.ToString();
}
- private void DecryptAuthHeader(XElement rootElement, ICryptographyProvider cryptographyProvider, SecureString key)
+ private void DecryptAuthHeader(XElement rootElement,
+ ICryptographyProvider cryptographyProvider,
+ SecureString key)
{
var authAttribute = rootElement.Attribute("Auth");
if (authAttribute == null)
diff --git a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordEncryptorDecorator.cs b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordEncryptorDecorator.cs
index 8fc38ed8..6b3db03c 100644
--- a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordEncryptorDecorator.cs
+++ b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialPasswordEncryptorDecorator.cs
@@ -12,7 +12,9 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
private readonly ISerializer, string> _baseSerializer;
private readonly ICryptographyProvider _cryptographyProvider;
- public XmlCredentialPasswordEncryptorDecorator(ICryptographyProvider cryptographyProvider, ISerializer, string> baseSerializer)
+ public XmlCredentialPasswordEncryptorDecorator(ICryptographyProvider cryptographyProvider,
+ ISerializer, string>
+ baseSerializer)
{
if (baseSerializer == null)
throw new ArgumentNullException(nameof(baseSerializer));
@@ -45,6 +47,7 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
var encryptedPassword = _cryptographyProvider.Encrypt(passwordAttribute.Value, encryptionKey);
passwordAttribute.Value = encryptedPassword;
}
+
return xdoc.Declaration + Environment.NewLine + xdoc;
}
@@ -53,7 +56,9 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
xdoc.Root?.SetAttributeValue("EncryptionEngine", _cryptographyProvider.CipherEngine);
xdoc.Root?.SetAttributeValue("BlockCipherMode", _cryptographyProvider.CipherMode);
xdoc.Root?.SetAttributeValue("KdfIterations", _cryptographyProvider.KeyDerivationIterations);
- xdoc.Root?.SetAttributeValue("Auth", _cryptographyProvider.Encrypt(RandomGenerator.RandomString(20), encryptionKey));
+ xdoc.Root?.SetAttributeValue("Auth",
+ _cryptographyProvider.Encrypt(RandomGenerator.RandomString(20),
+ encryptionKey));
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordDeserializer.cs b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordDeserializer.cs
index 7a7fe0d9..3f071a9d 100644
--- a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordDeserializer.cs
@@ -19,13 +19,14 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
ValidateSchemaVersion(rootElement);
var credentials = from element in xdoc.Descendants("Credential")
- select new CredentialRecord(Guid.Parse(element.Attribute("Id")?.Value ?? Guid.NewGuid().ToString()))
- {
- Title = element.Attribute("Title")?.Value ?? "",
- Username = element.Attribute("Username")?.Value ?? "",
- Password = element.Attribute("Password")?.Value.ConvertToSecureString(),
- Domain = element.Attribute("Domain")?.Value ?? ""
- };
+ select new CredentialRecord(Guid.Parse(element.Attribute("Id")?.Value ??
+ Guid.NewGuid().ToString()))
+ {
+ Title = element.Attribute("Title")?.Value ?? "",
+ Username = element.Attribute("Username")?.Value ?? "",
+ Password = element.Attribute("Password")?.Value.ConvertToSecureString(),
+ Domain = element.Attribute("Domain")?.Value ?? ""
+ };
return credentials.ToArray();
}
@@ -33,7 +34,8 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
{
var docSchemaVersion = rootElement?.Attribute("SchemaVersion")?.Value;
if (docSchemaVersion != SchemaVersion)
- throw new Exception($"The schema version of this document is not supported by this class. Document Version: {docSchemaVersion} Supported Version: {SchemaVersion}");
+ throw new Exception(
+ $"The schema version of this document is not supported by this class. Document Version: {docSchemaVersion} Supported Version: {SchemaVersion}");
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordSerializer.cs b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordSerializer.cs
index 01d2e0e1..eb421b27 100644
--- a/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordSerializer.cs
+++ b/mRemoteV1/Config/Serializers/CredentialSerializer/XmlCredentialRecordSerializer.cs
@@ -14,18 +14,20 @@ namespace mRemoteNG.Config.Serializers.CredentialSerializer
public string Serialize(IEnumerable credentialRecords)
{
var xdoc = new XDocument(
- new XElement("Credentials",
- new XAttribute("SchemaVersion", Version.ToString(2)),
- from r in credentialRecords
- select new XElement("Credential",
- new XAttribute("Id", r.Id),
- new XAttribute("Title", r.Title),
- new XAttribute("Username", r.Username),
- new XAttribute("Domain", r.Domain),
- new XAttribute("Password", r.Password.ConvertToUnsecureString())
- )
- )
- )
+ new XElement("Credentials",
+ new XAttribute("SchemaVersion", Version.ToString(2)),
+ from r in credentialRecords
+ select new XElement("Credential",
+ new XAttribute("Id", r.Id),
+ new XAttribute("Title", r.Title),
+ new XAttribute("Username", r.Username),
+ new XAttribute("Domain", r.Domain),
+ new XAttribute("Password",
+ r.Password
+ .ConvertToUnsecureString())
+ )
+ )
+ )
{
Declaration = new XDeclaration("1.0", "utf-8", null)
};
diff --git a/mRemoteV1/Config/Serializers/MiscSerializers/ActiveDirectoryDeserializer.cs b/mRemoteV1/Config/Serializers/MiscSerializers/ActiveDirectoryDeserializer.cs
index d9789f0f..a042aa21 100644
--- a/mRemoteV1/Config/Serializers/MiscSerializers/ActiveDirectoryDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/MiscSerializers/ActiveDirectoryDeserializer.cs
@@ -55,7 +55,7 @@ namespace mRemoteNG.Config.Serializers
ldapSearcher.SearchRoot = new DirectoryEntry(ldapPath);
ldapSearcher.Filter = ldapFilter;
ldapSearcher.SearchScope = SearchScope.OneLevel;
- ldapSearcher.PropertiesToLoad.AddRange(new[] { "securityEquals", "cn", "objectClass" });
+ ldapSearcher.PropertiesToLoad.AddRange(new[] {"securityEquals", "cn", "objectClass"});
var ldapResults = ldapSearcher.FindAll();
foreach (SearchResult ldapResult in ldapResults)
@@ -65,7 +65,7 @@ namespace mRemoteNG.Config.Serializers
if (directoryEntry.Properties["objectClass"].Contains("organizationalUnit"))
{
// check/continue here so we don't create empty connection objects
- if(!_importSubOu) continue;
+ if (!_importSubOu) continue;
// TODO - this is a circular call. A deserializer should not call an importer
ActiveDirectoryImporter.Import(ldapResult.Path, parentContainer, _importSubOu);
@@ -79,7 +79,8 @@ namespace mRemoteNG.Config.Serializers
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", ex);
+ Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.",
+ ex);
}
}
diff --git a/mRemoteV1/Config/Serializers/MiscSerializers/PuttyConnectionManagerDeserializer.cs b/mRemoteV1/Config/Serializers/MiscSerializers/PuttyConnectionManagerDeserializer.cs
index 81e3ac25..43d65b25 100644
--- a/mRemoteV1/Config/Serializers/MiscSerializers/PuttyConnectionManagerDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/MiscSerializers/PuttyConnectionManagerDeserializer.cs
@@ -75,16 +75,19 @@ namespace mRemoteNG.Config.Serializers
{
throw (new FileFormatException($"Unrecognized root node type ({xmlNodeType})."));
}
+
break;
case "container":
if (string.Compare(xmlNodeType, "folder", StringComparison.OrdinalIgnoreCase) != 0)
{
throw (new FileFormatException($"Unrecognized root node type ({xmlNodeType})."));
}
+
break;
default:
// ReSharper disable once LocalizableElement
- throw (new ArgumentException("Argument must be either a root or a container node.", nameof(xmlNode)));
+ throw (new ArgumentException("Argument must be either a root or a container node.",
+ nameof(xmlNode)));
}
}
diff --git a/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionDeserializer.cs b/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionDeserializer.cs
index b2d25ca9..20ad5b25 100644
--- a/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionDeserializer.cs
@@ -18,7 +18,7 @@ namespace mRemoteNG.Config.Serializers
foreach (var line in rdcFileContent.Split(Environment.NewLine.ToCharArray()))
{
- var parts = line.Split(new[] { ':' }, 3);
+ var parts = line.Split(new[] {':'}, 3);
if (parts.Length < 3)
{
continue;
@@ -90,12 +90,15 @@ namespace mRemoteNG.Config.Serializers
connectionInfo.Colors = RdpProtocol.RDPColors.Colors32Bit;
break;
}
+
break;
case "bitmapcachepersistenable":
connectionInfo.CacheBitmaps = value == "1";
break;
case "screen mode id":
- connectionInfo.Resolution = value == "2" ? RdpProtocol.RDPResolutions.Fullscreen : RdpProtocol.RDPResolutions.FitToWindow;
+ connectionInfo.Resolution = value == "2"
+ ? RdpProtocol.RDPResolutions.Fullscreen
+ : RdpProtocol.RDPResolutions.FitToWindow;
break;
case "connect to console":
connectionInfo.UseConsoleSession = value == "1";
@@ -140,6 +143,7 @@ namespace mRemoteNG.Config.Serializers
connectionInfo.RedirectSound = RdpProtocol.RDPSounds.DoNotPlay;
break;
}
+
break;
case "loadbalanceinfo":
connectionInfo.LoadBalanceInfo = value;
diff --git a/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs b/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs
index 21274f2e..856c67d5 100644
--- a/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs
+++ b/mRemoteV1/Config/Serializers/MiscSerializers/RemoteDesktopConnectionManagerDeserializer.cs
@@ -125,6 +125,7 @@ namespace mRemoteNG.Config.Serializers
// Program Version 2.2 wraps all setting inside the Properties tags
containerPropertiesNode = containerPropertiesNode.SelectSingleNode("./properties");
}
+
var newContainer = new ContainerInfo();
var connectionInfo = ConnectionInfoFromXml(containerPropertiesNode);
newContainer.CopyFrom(connectionInfo);
@@ -134,8 +135,10 @@ namespace mRemoteNG.Config.Serializers
// Program Version 2.7 wraps these properties
containerPropertiesNode = containerPropertiesNode.SelectSingleNode("./properties");
}
+
newContainer.Name = containerPropertiesNode?.SelectSingleNode("./name")?.InnerText ?? Language.strNewFolder;
- newContainer.IsExpanded = bool.Parse(containerPropertiesNode?.SelectSingleNode("./expanded")?.InnerText ?? "false");
+ newContainer.IsExpanded =
+ bool.Parse(containerPropertiesNode?.SelectSingleNode("./expanded")?.InnerText ?? "false");
return newContainer;
}
@@ -145,9 +148,11 @@ namespace mRemoteNG.Config.Serializers
var propertiesNode = xmlNode.SelectSingleNode("./properties");
- if (_schemaVersion == 1) propertiesNode = xmlNode; // Version 2.2 defines the container name at the root instead
+ if (_schemaVersion == 1)
+ propertiesNode = xmlNode; // Version 2.2 defines the container name at the root instead
connectionInfo.Hostname = propertiesNode?.SelectSingleNode("./name")?.InnerText ?? "";
- connectionInfo.Name = propertiesNode?.SelectSingleNode("./displayName")?.InnerText ?? connectionInfo.Hostname;
+ connectionInfo.Name =
+ propertiesNode?.SelectSingleNode("./displayName")?.InnerText ?? connectionInfo.Hostname;
connectionInfo.Description = propertiesNode?.SelectSingleNode("./comment")?.InnerText ?? string.Empty;
var logonCredentialsNode = xmlNode.SelectSingleNode("./logonCredentials");
@@ -161,7 +166,8 @@ namespace mRemoteNG.Config.Serializers
var connectionSettingsNode = xmlNode.SelectSingleNode("./connectionSettings");
if (connectionSettingsNode?.Attributes?["inherit"]?.Value == "None")
{
- connectionInfo.UseConsoleSession = bool.Parse(connectionSettingsNode.SelectSingleNode("./connectToConsole")?.InnerText ?? "false");
+ connectionInfo.UseConsoleSession =
+ bool.Parse(connectionSettingsNode.SelectSingleNode("./connectToConsole")?.InnerText ?? "false");
// ./startProgram
// ./workingDir
connectionInfo.Port = Convert.ToInt32(connectionSettingsNode.SelectSingleNode("./port")?.InnerText);
@@ -175,7 +181,10 @@ namespace mRemoteNG.Config.Serializers
var gatewaySettingsNode = xmlNode.SelectSingleNode("./gatewaySettings");
if (gatewaySettingsNode?.Attributes?["inherit"]?.Value == "None")
{
- connectionInfo.RDGatewayUsageMethod = gatewaySettingsNode.SelectSingleNode("./enabled")?.InnerText == "True" ? RdpProtocol.RDGatewayUsageMethod.Always : RdpProtocol.RDGatewayUsageMethod.Never;
+ connectionInfo.RDGatewayUsageMethod =
+ gatewaySettingsNode.SelectSingleNode("./enabled")?.InnerText == "True"
+ ? RdpProtocol.RDGatewayUsageMethod.Always
+ : RdpProtocol.RDGatewayUsageMethod.Never;
connectionInfo.RDGatewayHostname = gatewaySettingsNode.SelectSingleNode("./hostName")?.InnerText;
connectionInfo.RDGatewayUsername = gatewaySettingsNode.SelectSingleNode("./userName")?.InnerText;
@@ -225,7 +234,8 @@ namespace mRemoteNG.Config.Serializers
var colorDepth = remoteDesktopNode.SelectSingleNode("./colorDepth")?.InnerText;
if (colorDepth != null)
- connectionInfo.Colors = (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors), colorDepth);
+ connectionInfo.Colors =
+ (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors), colorDepth);
}
else
{
@@ -274,11 +284,16 @@ namespace mRemoteNG.Config.Serializers
}
// ./redirectClipboard
- connectionInfo.RedirectDiskDrives = bool.Parse(localResourcesNode?.SelectSingleNode("./redirectDrives")?.InnerText ?? "false");
- connectionInfo.RedirectPorts = bool.Parse(localResourcesNode?.SelectSingleNode("./redirectPorts")?.InnerText ?? "false");
- connectionInfo.RedirectPrinters = bool.Parse(localResourcesNode?.SelectSingleNode("./redirectPrinters")?.InnerText ?? "false");
- connectionInfo.RedirectSmartCards = bool.Parse(localResourcesNode?.SelectSingleNode("./redirectSmartCards")?.InnerText ?? "false");
- connectionInfo.RedirectClipboard = bool.Parse(localResourcesNode?.SelectSingleNode("./redirectClipboard")?.InnerText ?? "false");
+ connectionInfo.RedirectDiskDrives =
+ bool.Parse(localResourcesNode?.SelectSingleNode("./redirectDrives")?.InnerText ?? "false");
+ connectionInfo.RedirectPorts =
+ bool.Parse(localResourcesNode?.SelectSingleNode("./redirectPorts")?.InnerText ?? "false");
+ connectionInfo.RedirectPrinters =
+ bool.Parse(localResourcesNode?.SelectSingleNode("./redirectPrinters")?.InnerText ?? "false");
+ connectionInfo.RedirectSmartCards =
+ bool.Parse(localResourcesNode?.SelectSingleNode("./redirectSmartCards")?.InnerText ?? "false");
+ connectionInfo.RedirectClipboard =
+ bool.Parse(localResourcesNode?.SelectSingleNode("./redirectClipboard")?.InnerText ?? "false");
}
else
{
@@ -354,7 +369,8 @@ namespace mRemoteNG.Config.Serializers
try
{
- var plaintextData = ProtectedData.Unprotect(Convert.FromBase64String(ciphertext), new byte[] { }, DataProtectionScope.LocalMachine);
+ var plaintextData = ProtectedData.Unprotect(Convert.FromBase64String(ciphertext), new byte[] { },
+ DataProtectionScope.LocalMachine);
return Encoding.Unicode.GetString(plaintextData).ConvertToSecureString();
}
catch (Exception /*ex*/)
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlDatabaseVersionVerifier.cs b/mRemoteV1/Config/Serializers/Versioning/SqlDatabaseVersionVerifier.cs
index 232914b0..607512c8 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlDatabaseVersionVerifier.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlDatabaseVersionVerifier.cs
@@ -36,7 +36,7 @@ namespace mRemoteNG.Config.Serializers.Versioning
new SqlVersion23To24Upgrader(_sqlDatabaseConnector),
new SqlVersion24To25Upgrader(_sqlDatabaseConnector),
new SqlVersion25To26Upgrader(_sqlDatabaseConnector),
- new SqlVersion26To27Upgrader(_sqlDatabaseConnector),
+ new SqlVersion26To27Upgrader(_sqlDatabaseConnector),
};
foreach (var upgrader in dbUpgraders)
@@ -52,11 +52,16 @@ namespace mRemoteNG.Config.Serializers.Versioning
isVerified = true;
if (isVerified == false)
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, string.Format(Language.strErrorBadDatabaseVersion, databaseVersion, GeneralAppInfo.ProductName));
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ string.Format(Language.strErrorBadDatabaseVersion,
+ databaseVersion,
+ GeneralAppInfo.ProductName));
}
catch (Exception ex)
{
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, string.Format(Language.strErrorVerifyDatabaseVersionFailed, ex.Message));
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ string.Format(Language.strErrorVerifyDatabaseVersionFailed,
+ ex.Message));
}
return isVerified;
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlVersion22To23Upgrader.cs b/mRemoteV1/Config/Serializers/Versioning/SqlVersion22To23Upgrader.cs
index cf0e8865..5f8cbbad 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlVersion22To23Upgrader.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlVersion22To23Upgrader.cs
@@ -25,7 +25,8 @@ namespace mRemoteNG.Config.Serializers.Versioning
public Version Upgrade()
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Upgrading database from version 2.2 to version 2.3.");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Upgrading database from version 2.2 to version 2.3.");
const string sqlText = @"
ALTER TABLE tblCons
ADD EnableFontSmoothing bit NOT NULL DEFAULT 0,
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlVersion23To24Upgrader.cs b/mRemoteV1/Config/Serializers/Versioning/SqlVersion23To24Upgrader.cs
index 03085c8a..535dad23 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlVersion23To24Upgrader.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlVersion23To24Upgrader.cs
@@ -25,7 +25,8 @@ namespace mRemoteNG.Config.Serializers.Versioning
public Version Upgrade()
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Upgrading database from version 2.3 to version 2.4.");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Upgrading database from version 2.3 to version 2.4.");
const string sqlText = @"
ALTER TABLE tblCons
ADD UseCredSsp bit NOT NULL DEFAULT 1,
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlVersion24To25Upgrader.cs b/mRemoteV1/Config/Serializers/Versioning/SqlVersion24To25Upgrader.cs
index 704fd8cf..b51615db 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlVersion24To25Upgrader.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlVersion24To25Upgrader.cs
@@ -25,7 +25,8 @@ namespace mRemoteNG.Config.Serializers.Versioning
public Version Upgrade()
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Upgrading database from version 2.4 to version 2.5.");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Upgrading database from version 2.4 to version 2.5.");
const string sqlText = @"
ALTER TABLE tblCons
ADD LoadBalanceInfo varchar (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlVersion25To26Upgrader.cs b/mRemoteV1/Config/Serializers/Versioning/SqlVersion25To26Upgrader.cs
index 7e6e232c..cfde93f0 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlVersion25To26Upgrader.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlVersion25To26Upgrader.cs
@@ -25,7 +25,8 @@ namespace mRemoteNG.Config.Serializers.Versioning
public Version Upgrade()
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Upgrading database from version 2.5 to version 2.6.");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Upgrading database from version 2.5 to version 2.6.");
const string sqlText = @"
ALTER TABLE tblCons
ADD RDPMinutesToIdleTimeout int NOT NULL DEFAULT 0,
diff --git a/mRemoteV1/Config/Serializers/Versioning/SqlVersion26To27Upgrader.cs b/mRemoteV1/Config/Serializers/Versioning/SqlVersion26To27Upgrader.cs
index e0022589..431bc65a 100644
--- a/mRemoteV1/Config/Serializers/Versioning/SqlVersion26To27Upgrader.cs
+++ b/mRemoteV1/Config/Serializers/Versioning/SqlVersion26To27Upgrader.cs
@@ -25,7 +25,8 @@ namespace mRemoteNG.Config.Serializers.Versioning
public Version Upgrade()
{
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Upgrading database from version 2.6 to version 2.7.");
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ "Upgrading database from version 2.6 to version 2.7.");
const string sqlText = @"
ALTER TABLE tblCons
ADD RedirectClipboard bit NOT NULL DEFAULT 0,
@@ -39,4 +40,4 @@ UPDATE tblRoot
return new Version(2, 7);
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Serializers/XmlConnectionsDecryptor.cs b/mRemoteV1/Config/Serializers/XmlConnectionsDecryptor.cs
index efa0683a..80332729 100644
--- a/mRemoteV1/Config/Serializers/XmlConnectionsDecryptor.cs
+++ b/mRemoteV1/Config/Serializers/XmlConnectionsDecryptor.cs
@@ -29,7 +29,9 @@ namespace mRemoteNG.Config.Serializers
_rootNodeInfo = rootNodeInfo;
}
- public XmlConnectionsDecryptor(BlockCipherEngines blockCipherEngine, BlockCipherModes blockCipherMode, RootNodeInfo rootNodeInfo)
+ public XmlConnectionsDecryptor(BlockCipherEngines blockCipherEngine,
+ BlockCipherModes blockCipherMode,
+ RootNodeInfo rootNodeInfo)
{
_cryptographyProvider = new CryptoProviderFactory(blockCipherEngine, blockCipherMode).Build();
_rootNodeInfo = rootNodeInfo;
@@ -37,7 +39,9 @@ namespace mRemoteNG.Config.Serializers
public string Decrypt(string plainText)
{
- return plainText == "" ? "" : _cryptographyProvider.Decrypt(plainText, _rootNodeInfo.PasswordString.ConvertToSecureString());
+ return plainText == ""
+ ? ""
+ : _cryptographyProvider.Decrypt(plainText, _rootNodeInfo.PasswordString.ConvertToSecureString());
}
public string LegacyFullFileDecrypt(string xml)
@@ -50,7 +54,8 @@ namespace mRemoteNG.Config.Serializers
try
{
- decryptedContent = _cryptographyProvider.Decrypt(xml, _rootNodeInfo.PasswordString.ConvertToSecureString());
+ decryptedContent =
+ _cryptographyProvider.Decrypt(xml, _rootNodeInfo.PasswordString.ConvertToSecureString());
notDecr = decryptedContent == xml;
}
catch (Exception)
@@ -62,7 +67,8 @@ namespace mRemoteNG.Config.Serializers
{
if (Authenticate(xml, _rootNodeInfo.PasswordString.ConvertToSecureString()))
{
- decryptedContent = _cryptographyProvider.Decrypt(xml, _rootNodeInfo.PasswordString.ConvertToSecureString());
+ decryptedContent =
+ _cryptographyProvider.Decrypt(xml, _rootNodeInfo.PasswordString.ConvertToSecureString());
notDecr = false;
}
@@ -82,12 +88,17 @@ namespace mRemoteNG.Config.Serializers
var connectionsFileIsNotEncrypted = false;
try
{
- connectionsFileIsNotEncrypted = _cryptographyProvider.Decrypt(protectedString, _rootNodeInfo.PasswordString.ConvertToSecureString()) == "ThisIsNotProtected";
+ connectionsFileIsNotEncrypted =
+ _cryptographyProvider.Decrypt(protectedString,
+ _rootNodeInfo.PasswordString.ConvertToSecureString()) ==
+ "ThisIsNotProtected";
}
catch (EncryptionException)
{
}
- return connectionsFileIsNotEncrypted || Authenticate(protectedString, _rootNodeInfo.PasswordString.ConvertToSecureString());
+
+ return connectionsFileIsNotEncrypted ||
+ Authenticate(protectedString, _rootNodeInfo.PasswordString.ConvertToSecureString());
}
private bool Authenticate(string cipherText, SecureString password)
diff --git a/mRemoteV1/Config/Settings/DockPanelLayoutLoader.cs b/mRemoteV1/Config/Settings/DockPanelLayoutLoader.cs
index d431a3d1..4995384d 100644
--- a/mRemoteV1/Config/Settings/DockPanelLayoutLoader.cs
+++ b/mRemoteV1/Config/Settings/DockPanelLayoutLoader.cs
@@ -36,7 +36,8 @@ namespace mRemoteNG.Config.Settings
}
#if !PORTABLE
- var oldPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProductName + "\\" + SettingsFileInfo.LayoutFileName;
+ var oldPath =
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\" + GeneralAppInfo.ProductName + "\\" + SettingsFileInfo.LayoutFileName;
#endif
var newPath = SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.LayoutFileName;
if (File.Exists(newPath))
diff --git a/mRemoteV1/Config/Settings/DockPanelLayoutSaver.cs b/mRemoteV1/Config/Settings/DockPanelLayoutSaver.cs
index 9779a7bd..f5e2aae0 100644
--- a/mRemoteV1/Config/Settings/DockPanelLayoutSaver.cs
+++ b/mRemoteV1/Config/Settings/DockPanelLayoutSaver.cs
@@ -14,7 +14,8 @@ namespace mRemoteNG.Config.Settings
private readonly ISerializer _dockPanelSerializer;
private readonly IDataProvider _dataProvider;
- public DockPanelLayoutSaver(ISerializer dockPanelSerializer, IDataProvider dataProvider)
+ public DockPanelLayoutSaver(ISerializer dockPanelSerializer,
+ IDataProvider dataProvider)
{
if (dockPanelSerializer == null)
throw new ArgumentNullException(nameof(dockPanelSerializer));
diff --git a/mRemoteV1/Config/Settings/DockPanelLayoutSerializer.cs b/mRemoteV1/Config/Settings/DockPanelLayoutSerializer.cs
index 0ee7d3c3..e8e4be84 100644
--- a/mRemoteV1/Config/Settings/DockPanelLayoutSerializer.cs
+++ b/mRemoteV1/Config/Settings/DockPanelLayoutSerializer.cs
@@ -23,6 +23,7 @@ namespace mRemoteNG.Config.Settings
memoryStream.Position = 0;
xdoc = XDocument.Load(memoryStream, LoadOptions.SetBaseUri);
}
+
return $"{xdoc.Declaration}{Environment.NewLine}{xdoc}";
}
}
diff --git a/mRemoteV1/Config/Settings/ExternalAppsLoader.cs b/mRemoteV1/Config/Settings/ExternalAppsLoader.cs
index ee064507..a81d4b09 100644
--- a/mRemoteV1/Config/Settings/ExternalAppsLoader.cs
+++ b/mRemoteV1/Config/Settings/ExternalAppsLoader.cs
@@ -16,7 +16,9 @@ namespace mRemoteNG.Config.Settings
private readonly MessageCollector _messageCollector;
private readonly ExternalToolsToolStrip _externalToolsToolStrip;
- public ExternalAppsLoader(FrmMain mainForm, MessageCollector messageCollector, ExternalToolsToolStrip externalToolsToolStrip)
+ public ExternalAppsLoader(FrmMain mainForm,
+ MessageCollector messageCollector,
+ ExternalToolsToolStrip externalToolsToolStrip)
{
if (mainForm == null)
throw new ArgumentNullException(nameof(mainForm));
@@ -34,13 +36,15 @@ namespace mRemoteNG.Config.Settings
public void LoadExternalAppsFromXML()
{
#if !PORTABLE
- var oldPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), GeneralAppInfo.ProductName, SettingsFileInfo.ExtAppsFilesName);
+ var oldPath =
+ Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), GeneralAppInfo.ProductName, SettingsFileInfo.ExtAppsFilesName);
#endif
var newPath = Path.Combine(SettingsFileInfo.SettingsPath, SettingsFileInfo.ExtAppsFilesName);
var xDom = new XmlDocument();
if (File.Exists(newPath))
{
- _messageCollector.AddMessage(MessageClass.InformationMsg, $"Loading External Apps from: {newPath}", true);
+ _messageCollector.AddMessage(MessageClass.InformationMsg, $"Loading External Apps from: {newPath}",
+ true);
xDom.Load(newPath);
}
#if !PORTABLE
@@ -53,13 +57,15 @@ namespace mRemoteNG.Config.Settings
#endif
else
{
- _messageCollector.AddMessage(MessageClass.WarningMsg, "Loading External Apps failed: Could not FIND file!");
+ _messageCollector.AddMessage(MessageClass.WarningMsg,
+ "Loading External Apps failed: Could not FIND file!");
return;
}
if (xDom.DocumentElement == null)
{
- _messageCollector.AddMessage(MessageClass.WarningMsg, "Loading External Apps failed: Could not LOAD file!");
+ _messageCollector.AddMessage(MessageClass.WarningMsg,
+ "Loading External Apps failed: Could not LOAD file!");
return;
}
@@ -93,7 +99,9 @@ namespace mRemoteNG.Config.Settings
extA.ShowOnToolbar = bool.Parse(xEl.Attributes["ShowOnToolbar"].Value);
}
- _messageCollector.AddMessage(MessageClass.InformationMsg, $"Adding External App: {extA.DisplayName} {extA.FileName} {extA.Arguments}", true);
+ _messageCollector.AddMessage(MessageClass.InformationMsg,
+ $"Adding External App: {extA.DisplayName} {extA.FileName} {extA.Arguments}",
+ true);
Runtime.ExternalToolsService.ExternalTools.Add(extA);
}
diff --git a/mRemoteV1/Config/Settings/ExternalAppsSaver.cs b/mRemoteV1/Config/Settings/ExternalAppsSaver.cs
index 243f330a..000cc4c2 100644
--- a/mRemoteV1/Config/Settings/ExternalAppsSaver.cs
+++ b/mRemoteV1/Config/Settings/ExternalAppsSaver.cs
@@ -22,7 +22,7 @@ namespace mRemoteNG.Config.Settings
var xmlTextWriter =
new XmlTextWriter(SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.ExtAppsFilesName,
- Encoding.UTF8)
+ Encoding.UTF8)
{
Formatting = Formatting.Indented,
Indentation = 4
diff --git a/mRemoteV1/Config/Settings/Providers/ChooseProvider.cs b/mRemoteV1/Config/Settings/Providers/ChooseProvider.cs
index 10a1a342..8a58cf8d 100644
--- a/mRemoteV1/Config/Settings/Providers/ChooseProvider.cs
+++ b/mRemoteV1/Config/Settings/Providers/ChooseProvider.cs
@@ -9,5 +9,6 @@ namespace mRemoteNG.Config.Settings.Providers
#else
public class ChooseProvider : LocalFileSettingsProvider
#endif
- { }
+ {
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Settings/Providers/PortableSettingsProvider.cs b/mRemoteV1/Config/Settings/Providers/PortableSettingsProvider.cs
index 51349b26..fa79921f 100644
--- a/mRemoteV1/Config/Settings/Providers/PortableSettingsProvider.cs
+++ b/mRemoteV1/Config/Settings/Providers/PortableSettingsProvider.cs
@@ -21,7 +21,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// https://raw.githubusercontent.com/crdx/PortableSettingsProvider
+// https://github.com/crdx/PortableSettingsProvider
//
using System;
@@ -31,6 +31,7 @@ using System.Windows.Forms;
using System.Collections.Specialized;
using System.Xml;
using System.IO;
+
//using mRemoteNG.App;
namespace mRemoteNG.Config.Settings.Providers
@@ -43,7 +44,9 @@ namespace mRemoteNG.Config.Settings.Providers
private const string _className = "PortableSettingsProvider";
private XmlDocument _xmlDocument;
- private string _filePath => Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? throw new InvalidOperationException(), $"{ApplicationName}.settings");
+ private string _filePath =>
+ Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? throw new InvalidOperationException(),
+ $"{ApplicationName}.settings");
private XmlNode _localSettingsNode => GetSettingsNode(_localSettingsNodeName);
@@ -63,7 +66,7 @@ namespace mRemoteNG.Config.Settings.Providers
}
catch (Exception /*ex*/)
{
- // This casues hundreds of unit tests to fail for some reason...
+ // This causes hundreds of unit tests to fail for some reason...
//Runtime.MessageCollector.AddExceptionStackTrace("PortableSettingsProvider: Error getting XML", ex);
}
@@ -109,7 +112,8 @@ namespace mRemoteNG.Config.Settings.Providers
}
}
- public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection)
+ public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context,
+ SettingsPropertyCollection collection)
{
var values = new SettingsPropertyValueCollection();
diff --git a/mRemoteV1/Config/Settings/SettingsLoader.cs b/mRemoteV1/Config/Settings/SettingsLoader.cs
index a730dac6..6e250a5b 100644
--- a/mRemoteV1/Config/Settings/SettingsLoader.cs
+++ b/mRemoteV1/Config/Settings/SettingsLoader.cs
@@ -16,25 +16,24 @@ using mRemoteNG.UI.Forms;
namespace mRemoteNG.Config.Settings
{
public class SettingsLoader
- {
+ {
private readonly ExternalAppsLoader _externalAppsLoader;
private readonly MessageCollector _messageCollector;
- private readonly MenuStrip _mainMenu;
+ private readonly MenuStrip _mainMenu;
private readonly QuickConnectToolStrip _quickConnectToolStrip;
private readonly ExternalToolsToolStrip _externalToolsToolStrip;
- private readonly MultiSshToolStrip _multiSshToolStrip;
+ private readonly MultiSshToolStrip _multiSshToolStrip;
private FrmMain MainForm { get; }
- public SettingsLoader(
- FrmMain mainForm,
- MessageCollector messageCollector,
- QuickConnectToolStrip quickConnectToolStrip,
- ExternalToolsToolStrip externalToolsToolStrip,
- MultiSshToolStrip multiSshToolStrip,
- MenuStrip mainMenu)
- {
+ public SettingsLoader(FrmMain mainForm,
+ MessageCollector messageCollector,
+ QuickConnectToolStrip quickConnectToolStrip,
+ ExternalToolsToolStrip externalToolsToolStrip,
+ MultiSshToolStrip multiSshToolStrip,
+ MenuStrip mainMenu)
+ {
if (mainForm == null)
throw new ArgumentNullException(nameof(mainForm));
if (messageCollector == null)
@@ -45,45 +44,46 @@ namespace mRemoteNG.Config.Settings
throw new ArgumentNullException(nameof(externalToolsToolStrip));
if (multiSshToolStrip == null)
throw new ArgumentNullException(nameof(multiSshToolStrip));
- if (mainMenu == null)
- throw new ArgumentNullException(nameof(mainMenu));
+ if (mainMenu == null)
+ throw new ArgumentNullException(nameof(mainMenu));
MainForm = mainForm;
- _messageCollector = messageCollector;
- _quickConnectToolStrip = quickConnectToolStrip;
- _externalToolsToolStrip = externalToolsToolStrip;
- _multiSshToolStrip = multiSshToolStrip;
- _mainMenu = mainMenu;
- _externalAppsLoader = new ExternalAppsLoader(MainForm, messageCollector, _externalToolsToolStrip);
+ _messageCollector = messageCollector;
+ _quickConnectToolStrip = quickConnectToolStrip;
+ _externalToolsToolStrip = externalToolsToolStrip;
+ _multiSshToolStrip = multiSshToolStrip;
+ _mainMenu = mainMenu;
+ _externalAppsLoader = new ExternalAppsLoader(MainForm, messageCollector, _externalToolsToolStrip);
}
-
+
#region Public Methods
+
public void LoadSettings()
- {
- try
- {
+ {
+ try
+ {
EnsureSettingsAreSavedInNewestVersion();
- SetSupportedCulture();
+ SetSupportedCulture();
SetApplicationWindowPositionAndSize();
SetKioskMode();
SetPuttyPath();
SetShowSystemTrayIcon();
SetAutoSave();
- LoadExternalAppsFromXml();
+ LoadExternalAppsFromXml();
SetAlwaysShowPanelTabs();
-
- if (mRemoteNG.Settings.Default.ResetToolbars)
+
+ if (mRemoteNG.Settings.Default.ResetToolbars)
SetToolbarsDefault();
- else
+ else
LoadToolbarsFromSettings();
- }
- catch (Exception ex)
- {
+ }
+ catch (Exception ex)
+ {
_messageCollector.AddExceptionMessage("Loading settings failed", ex);
- }
- }
+ }
+ }
private static void SetAlwaysShowPanelTabs()
{
@@ -91,14 +91,15 @@ namespace mRemoteNG.Config.Settings
FrmMain.Default.pnlDock.DocumentStyle = DocumentStyle.DockingWindow;
}
-
private void SetSupportedCulture()
{
if (mRemoteNG.Settings.Default.OverrideUICulture == "" ||
!SupportedCultures.IsNameSupported(mRemoteNG.Settings.Default.OverrideUICulture)) return;
Thread.CurrentThread.CurrentUICulture = new CultureInfo(mRemoteNG.Settings.Default.OverrideUICulture);
- _messageCollector.AddMessage(MessageClass.InformationMsg, $"Override Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}", true);
+ _messageCollector.AddMessage(MessageClass.InformationMsg,
+ $"Override Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}",
+ true);
}
private void SetApplicationWindowPositionAndSize()
@@ -163,7 +164,9 @@ namespace mRemoteNG.Config.Settings
private static void SetPuttyPath()
{
- PuttyBase.PuttyPath = mRemoteNG.Settings.Default.UseCustomPuttyPath ? mRemoteNG.Settings.Default.CustomPuttyPath : GeneralAppInfo.PuttyPath;
+ PuttyBase.PuttyPath = mRemoteNG.Settings.Default.UseCustomPuttyPath
+ ? mRemoteNG.Settings.Default.CustomPuttyPath
+ : GeneralAppInfo.PuttyPath;
}
private void EnsureSettingsAreSavedInNewestVersion()
@@ -183,6 +186,7 @@ namespace mRemoteNG.Config.Settings
{
_messageCollector.AddExceptionMessage("Settings.Upgrade() failed", ex);
}
+
mRemoteNG.Settings.Default.DoUpgrade = false;
// Clear pending update flag
@@ -191,21 +195,21 @@ namespace mRemoteNG.Config.Settings
mRemoteNG.Settings.Default.UpdatePending = false;
}
- private void SetToolbarsDefault()
- {
- ToolStripPanelFromString("top").Join(_quickConnectToolStrip, new Point(300, 0));
+ private void SetToolbarsDefault()
+ {
+ ToolStripPanelFromString("top").Join(_quickConnectToolStrip, new Point(300, 0));
_quickConnectToolStrip.Visible = true;
- ToolStripPanelFromString("bottom").Join(_externalToolsToolStrip, new Point(3, 0));
+ ToolStripPanelFromString("bottom").Join(_externalToolsToolStrip, new Point(3, 0));
_externalToolsToolStrip.Visible = false;
- }
+ }
- private void LoadToolbarsFromSettings()
- {
+ private void LoadToolbarsFromSettings()
+ {
ResetAllToolbarLocations();
- AddMainMenuPanel();
+ AddMainMenuPanel();
AddExternalAppsPanel();
- AddQuickConnectPanel();
- AddMultiSshPanel();
+ AddQuickConnectPanel();
+ AddMultiSshPanel();
}
///
@@ -213,74 +217,75 @@ namespace mRemoteNG.Config.Settings
/// Since all toolbars start in this temp panel, no toolbar load
/// can be blocked by pre-existing toolbars.
///
- private void ResetAllToolbarLocations()
- {
- var tempToolStrip = new ToolStripPanel();
+ private void ResetAllToolbarLocations()
+ {
+ var tempToolStrip = new ToolStripPanel();
tempToolStrip.Join(_mainMenu);
- tempToolStrip.Join(_quickConnectToolStrip);
- tempToolStrip.Join(_externalToolsToolStrip);
- tempToolStrip.Join(_multiSshToolStrip);
+ tempToolStrip.Join(_quickConnectToolStrip);
+ tempToolStrip.Join(_externalToolsToolStrip);
+ tempToolStrip.Join(_multiSshToolStrip);
}
- private void AddMainMenuPanel()
- {
- SetToolstripGripStyle(_mainMenu);
+ private void AddMainMenuPanel()
+ {
+ SetToolstripGripStyle(_mainMenu);
var toolStripPanel = ToolStripPanelFromString("top");
- toolStripPanel.Join(_mainMenu, new Point(3, 0));
+ toolStripPanel.Join(_mainMenu, new Point(3, 0));
}
- private void AddQuickConnectPanel()
- {
- SetToolstripGripStyle(_quickConnectToolStrip);
+ private void AddQuickConnectPanel()
+ {
+ SetToolstripGripStyle(_quickConnectToolStrip);
_quickConnectToolStrip.Visible = mRemoteNG.Settings.Default.QuickyTBVisible;
var toolStripPanel = ToolStripPanelFromString(mRemoteNG.Settings.Default.QuickyTBParentDock);
toolStripPanel.Join(_quickConnectToolStrip, mRemoteNG.Settings.Default.QuickyTBLocation);
- }
-
- private void AddExternalAppsPanel()
- {
- SetToolstripGripStyle(_externalToolsToolStrip);
+ }
+
+ private void AddExternalAppsPanel()
+ {
+ SetToolstripGripStyle(_externalToolsToolStrip);
_externalToolsToolStrip.Visible = mRemoteNG.Settings.Default.ExtAppsTBVisible;
var toolStripPanel = ToolStripPanelFromString(mRemoteNG.Settings.Default.ExtAppsTBParentDock);
toolStripPanel.Join(_externalToolsToolStrip, mRemoteNG.Settings.Default.ExtAppsTBLocation);
- }
+ }
- private void AddMultiSshPanel()
- {
- SetToolstripGripStyle(_multiSshToolStrip);
- _multiSshToolStrip.Visible = mRemoteNG.Settings.Default.MultiSshToolbarVisible;
+ private void AddMultiSshPanel()
+ {
+ SetToolstripGripStyle(_multiSshToolStrip);
+ _multiSshToolStrip.Visible = mRemoteNG.Settings.Default.MultiSshToolbarVisible;
var toolStripPanel = ToolStripPanelFromString(mRemoteNG.Settings.Default.MultiSshToolbarParentDock);
toolStripPanel.Join(_multiSshToolStrip, mRemoteNG.Settings.Default.MultiSshToolbarLocation);
- }
-
- private void SetToolstripGripStyle(ToolStrip toolbar)
- {
- toolbar.GripStyle = mRemoteNG.Settings.Default.LockToolbars
- ? ToolStripGripStyle.Hidden
- : ToolStripGripStyle.Visible;
}
-
- private ToolStripPanel ToolStripPanelFromString(string panel)
- {
- switch (panel.ToLower())
- {
- case "top":
- return MainForm.tsContainer.TopToolStripPanel;
- case "bottom":
- return MainForm.tsContainer.BottomToolStripPanel;
- case "left":
- return MainForm.tsContainer.LeftToolStripPanel;
- case "right":
- return MainForm.tsContainer.RightToolStripPanel;
- default:
- return MainForm.tsContainer.TopToolStripPanel;
- }
- }
- private void LoadExternalAppsFromXml()
- {
+ private void SetToolstripGripStyle(ToolStrip toolbar)
+ {
+ toolbar.GripStyle = mRemoteNG.Settings.Default.LockToolbars
+ ? ToolStripGripStyle.Hidden
+ : ToolStripGripStyle.Visible;
+ }
+
+ private ToolStripPanel ToolStripPanelFromString(string panel)
+ {
+ switch (panel.ToLower())
+ {
+ case "top":
+ return MainForm.tsContainer.TopToolStripPanel;
+ case "bottom":
+ return MainForm.tsContainer.BottomToolStripPanel;
+ case "left":
+ return MainForm.tsContainer.LeftToolStripPanel;
+ case "right":
+ return MainForm.tsContainer.RightToolStripPanel;
+ default:
+ return MainForm.tsContainer.TopToolStripPanel;
+ }
+ }
+
+ private void LoadExternalAppsFromXml()
+ {
_externalAppsLoader.LoadExternalAppsFromXML();
}
+
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Config/Settings/SettingsSaver.cs b/mRemoteV1/Config/Settings/SettingsSaver.cs
index f41ed382..b8fe2b6b 100644
--- a/mRemoteV1/Config/Settings/SettingsSaver.cs
+++ b/mRemoteV1/Config/Settings/SettingsSaver.cs
@@ -11,11 +11,10 @@ namespace mRemoteNG.Config.Settings
{
public static class SettingsSaver
{
- public static void SaveSettings(
- Control quickConnectToolStrip,
- ExternalToolsToolStrip externalToolsToolStrip,
- MultiSshToolStrip multiSshToolStrip,
- FrmMain frmMain)
+ public static void SaveSettings(Control quickConnectToolStrip,
+ ExternalToolsToolStrip externalToolsToolStrip,
+ MultiSshToolStrip multiSshToolStrip,
+ FrmMain frmMain)
{
try
{
@@ -50,7 +49,7 @@ namespace mRemoteNG.Config.Settings
SaveExternalAppsToolbarLocation(externalToolsToolStrip);
SaveQuickConnectToolbarLocation(quickConnectToolStrip);
SaveMultiSshToolbarLocation(multiSshToolStrip);
-
+
mRemoteNG.Settings.Default.Save();
SaveDockPanelLayout();
@@ -100,9 +99,9 @@ namespace mRemoteNG.Config.Settings
{
var panelLayoutXmlFilePath = SettingsFileInfo.SettingsPath + "\\" + SettingsFileInfo.LayoutFileName;
var panelLayoutSaver = new DockPanelLayoutSaver(
- new DockPanelLayoutSerializer(),
- new FileDataProvider(panelLayoutXmlFilePath)
- );
+ new DockPanelLayoutSerializer(),
+ new FileDataProvider(panelLayoutXmlFilePath)
+ );
panelLayoutSaver.Save();
}
diff --git a/mRemoteV1/Connection/AbstractConnectionRecord.cs b/mRemoteV1/Connection/AbstractConnectionRecord.cs
index 2b36fefd..8e7c394f 100644
--- a/mRemoteV1/Connection/AbstractConnectionRecord.cs
+++ b/mRemoteV1/Connection/AbstractConnectionRecord.cs
@@ -19,6 +19,7 @@ namespace mRemoteNG.Connection
public abstract class AbstractConnectionRecord : INotifyPropertyChanged
{
#region Fields
+
private string _name;
private string _description;
private string _icon;
@@ -85,10 +86,13 @@ namespace mRemoteNG.Connection
private ProtocolVNC.Colors _vncColors;
private ProtocolVNC.SmartSizeMode _vncSmartSizeMode;
private bool _vncViewOnly;
+
#endregion
#region Properties
+
#region Display
+
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
LocalizedAttributes.LocalizedDisplayName("strPropertyNameName"),
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionName")]
@@ -99,8 +103,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameDescription"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDescription")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameDescription"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDescription")]
public virtual string Description
{
get => GetPropertyValue("Description", _description);
@@ -108,9 +112,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
- TypeConverter(typeof(ConnectionIcon)),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameIcon"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionIcon")]
+ TypeConverter(typeof(ConnectionIcon)),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameIcon"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionIcon")]
public virtual string Icon
{
get => GetPropertyValue("Icon", _icon);
@@ -118,19 +122,21 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNamePanel"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPanel")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNamePanel"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPanel")]
public virtual string Panel
{
get => GetPropertyValue("Panel", _panel);
set => SetField(ref _panel, value, "Panel");
}
+
#endregion
#region Connection
+
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameAddress"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAddress")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameAddress"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAddress")]
public virtual string Hostname
{
get => _hostname.Trim();
@@ -138,8 +144,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameUsername"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUsername")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameUsername"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUsername")]
[Obsolete("Use the CredentialRecord property")]
[Browsable(false)]
public virtual string Username
@@ -149,9 +155,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNamePassword"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPassword"),
- PasswordPropertyText(true)]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNamePassword"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPassword"),
+ PasswordPropertyText(true)]
[Obsolete("Use the CredentialRecord property")]
[Browsable(false)]
public virtual string Password
@@ -161,8 +167,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameDomain"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDomain")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameDomain"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDomain")]
[Obsolete("Use the CredentialRecord property")]
[Browsable(false)]
public string Domain
@@ -193,10 +199,11 @@ namespace mRemoteNG.Connection
#endregion
#region Protocol
+
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameProtocol"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionProtocol"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameProtocol"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionProtocol"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public virtual ProtocolType Protocol
{
get => GetPropertyValue("Protocol", _protocol);
@@ -204,9 +211,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalTool"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalTool"),
- TypeConverter(typeof(ExternalToolsTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalTool"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalTool"),
+ TypeConverter(typeof(ExternalToolsTypeConverter))]
public string ExtApp
{
get => GetPropertyValue("ExtApp", _extApp);
@@ -214,8 +221,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNamePort"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPort")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNamePort"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPort")]
public virtual int Port
{
get => GetPropertyValue("Port", _port);
@@ -223,9 +230,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNamePuttySession"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPuttySession"),
- TypeConverter(typeof(Config.Putty.PuttySessionsManager.SessionList))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNamePuttySession"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPuttySession"),
+ TypeConverter(typeof(Config.Putty.PuttySessionsManager.SessionList))]
public virtual string PuttySession
{
get => GetPropertyValue("PuttySession", _puttySession);
@@ -233,9 +240,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncryptionStrength"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncryptionStrength"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncryptionStrength"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncryptionStrength"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public IcaProtocol.EncryptionStrength ICAEncryptionStrength
{
get => GetPropertyValue("ICAEncryptionStrength", _icaEncryption);
@@ -243,9 +250,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseConsoleSession"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseConsoleSession"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseConsoleSession"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseConsoleSession"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseConsoleSession
{
get => GetPropertyValue("UseConsoleSession", _useConsoleSession);
@@ -253,9 +260,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationLevel"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationLevel"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationLevel"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationLevel"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.AuthenticationLevel RDPAuthenticationLevel
{
get => GetPropertyValue("RDPAuthenticationLevel", _rdpAuthenticationLevel);
@@ -263,23 +270,24 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPMinutesToIdleTimeout"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPMinutesToIdleTimeout")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPMinutesToIdleTimeout"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPMinutesToIdleTimeout")]
public virtual int RDPMinutesToIdleTimeout
{
get => GetPropertyValue("RDPMinutesToIdleTimeout", _rdpMinutesToIdleTimeout);
- set {
- if(value < 0)
+ set
+ {
+ if (value < 0)
value = 0;
- else if(value > 240)
+ else if (value > 240)
value = 240;
SetField(ref _rdpMinutesToIdleTimeout, value, "RDPMinutesToIdleTimeout");
}
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPAlertIdleTimeout"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPAlertIdleTimeout")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPAlertIdleTimeout"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPAlertIdleTimeout")]
public bool RDPAlertIdleTimeout
{
get => GetPropertyValue("RDPAlertIdleTimeout", _rdpAlertIdleTimeout);
@@ -287,8 +295,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameLoadBalanceInfo"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionLoadBalanceInfo")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameLoadBalanceInfo"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionLoadBalanceInfo")]
public string LoadBalanceInfo
{
get => GetPropertyValue("LoadBalanceInfo", _loadBalanceInfo).Trim();
@@ -296,9 +304,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRenderingEngine"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRenderingEngine"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRenderingEngine"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRenderingEngine"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public HTTPBase.RenderingEngine RenderingEngine
{
get => GetPropertyValue("RenderingEngine", _renderingEngine);
@@ -306,21 +314,23 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseCredSsp"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseCredSsp"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseCredSsp"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseCredSsp"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseCredSsp
{
get => GetPropertyValue("UseCredSsp", _useCredSsp);
set => SetField(ref _useCredSsp, value, "UseCredSsp");
}
+
#endregion
#region RD Gateway
+
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsageMethod"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsageMethod"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsageMethod"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsageMethod"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDGatewayUsageMethod RDGatewayUsageMethod
{
get => GetPropertyValue("RDGatewayUsageMethod", _rdGatewayUsageMethod);
@@ -328,8 +338,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayHostname"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayHostname")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayHostname"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayHostname")]
public string RDGatewayHostname
{
get => GetPropertyValue("RDGatewayHostname", _rdGatewayHostname).Trim();
@@ -337,9 +347,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUseConnectionCredentials"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUseConnectionCredentials"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUseConnectionCredentials"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUseConnectionCredentials"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDGatewayUseConnectionCredentials RDGatewayUseConnectionCredentials
{
get => GetPropertyValue("RDGatewayUseConnectionCredentials", _rdGatewayUseConnectionCredentials);
@@ -347,8 +357,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsername"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsername")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsername"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsername")]
[Obsolete]
public string RDGatewayUsername
{
@@ -357,9 +367,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayPassword"),
- LocalizedAttributes.LocalizedDescription("strPropertyNameRDGatewayPassword"),
- PasswordPropertyText(true)]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayPassword"),
+ LocalizedAttributes.LocalizedDescription("strPropertyNameRDGatewayPassword"),
+ PasswordPropertyText(true)]
[Obsolete]
public string RDGatewayPassword
{
@@ -368,21 +378,23 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayDomain"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayDomain")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayDomain"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayDomain")]
[Obsolete]
public string RDGatewayDomain
{
get => GetPropertyValue("RDGatewayDomain", _rdGatewayDomain).Trim();
set => SetField(ref _rdGatewayDomain, value?.Trim(), "RDGatewayDomain");
}
+
#endregion
#region Appearance
+
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameResolution"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionResolution"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameResolution"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionResolution"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDPResolutions Resolution
{
get => GetPropertyValue("Resolution", _resolution);
@@ -390,9 +402,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameAutomaticResize"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAutomaticResize"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameAutomaticResize"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAutomaticResize"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool AutomaticResize
{
get => GetPropertyValue("AutomaticResize", _automaticResize);
@@ -400,9 +412,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDPColors Colors
{
get => GetPropertyValue("Colors", _colors);
@@ -410,9 +422,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameCacheBitmaps"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCacheBitmaps"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameCacheBitmaps"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCacheBitmaps"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool CacheBitmaps
{
get => GetPropertyValue("CacheBitmaps", _cacheBitmaps);
@@ -420,9 +432,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayWallpaper"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayWallpaper"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayWallpaper"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayWallpaper"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool DisplayWallpaper
{
get => GetPropertyValue("DisplayWallpaper", _displayWallpaper);
@@ -430,9 +442,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayThemes"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayThemes"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayThemes"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayThemes"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool DisplayThemes
{
get => GetPropertyValue("DisplayThemes", _displayThemes);
@@ -440,9 +452,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableFontSmoothing"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableFontSmoothing"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableFontSmoothing"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableFontSmoothing"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EnableFontSmoothing
{
get => GetPropertyValue("EnableFontSmoothing", _enableFontSmoothing);
@@ -450,21 +462,23 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableDesktopComposition"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableDesktopComposition"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableDesktopComposition"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableDesktopComposition"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EnableDesktopComposition
{
get => GetPropertyValue("EnableDesktopComposition", _enableDesktopComposition);
set => SetField(ref _enableDesktopComposition, value, "EnableDesktopComposition");
}
+
#endregion
#region Redirect
+
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectKeys"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectKeys"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectKeys"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectKeys"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectKeys
{
get => GetPropertyValue("RedirectKeys", _redirectKeys);
@@ -472,9 +486,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectDrives"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectDrives"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectDrives"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectDrives"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectDiskDrives
{
get => GetPropertyValue("RedirectDiskDrives", _redirectDiskDrives);
@@ -482,9 +496,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPrinters"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPrinters"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPrinters"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPrinters"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectPrinters
{
get => GetPropertyValue("RedirectPrinters", _redirectPrinters);
@@ -492,9 +506,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectClipboard"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectClipboard"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectClipboard"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectClipboard"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectClipboard
{
get { return GetPropertyValue("RedirectClipboard", _redirectClipboard); }
@@ -502,9 +516,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPorts"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPorts"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPorts"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPorts"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectPorts
{
get => GetPropertyValue("RedirectPorts", _redirectPorts);
@@ -512,9 +526,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSmartCards"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSmartCards"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSmartCards"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSmartCards"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectSmartCards
{
get => GetPropertyValue("RedirectSmartCards", _redirectSmartCards);
@@ -522,9 +536,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSounds"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSounds"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSounds"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSounds"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDPSounds RedirectSound
{
get => GetPropertyValue("RedirectSound", _redirectSound);
@@ -532,24 +546,25 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameSoundQuality"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSoundQuality"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameSoundQuality"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSoundQuality"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public RdpProtocol.RDPSoundQuality SoundQuality
{
get => GetPropertyValue("SoundQuality", _soundQuality);
set => SetField(ref _soundQuality, value, "SoundQuality");
}
+
#endregion
#region Misc
- [Browsable(false)]
- public string ConstantID { get; /*set;*/ }
+
+ [Browsable(false)] public string ConstantID { get; /*set;*/ }
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolBefore"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolBefore"),
- TypeConverter(typeof(ExternalToolsTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolBefore"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolBefore"),
+ TypeConverter(typeof(ExternalToolsTypeConverter))]
public virtual string PreExtApp
{
get => GetPropertyValue("PreExtApp", _preExtApp);
@@ -557,9 +572,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolAfter"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolAfter"),
- TypeConverter(typeof(ExternalToolsTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolAfter"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolAfter"),
+ TypeConverter(typeof(ExternalToolsTypeConverter))]
public virtual string PostExtApp
{
get => GetPropertyValue("PostExtApp", _postExtApp);
@@ -567,8 +582,8 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameMACAddress"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionMACAddress")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameMACAddress"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionMACAddress")]
public virtual string MacAddress
{
get => GetPropertyValue("MacAddress", _macAddress);
@@ -576,21 +591,23 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameUser1"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUser1")]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameUser1"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUser1")]
public virtual string UserField
{
get => GetPropertyValue("UserField", _userField);
set => SetField(ref _userField, value, "UserField");
}
+
#endregion
#region VNC
+
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameCompression"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCompression"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameCompression"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCompression"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.Compression VNCCompression
{
get => GetPropertyValue("VNCCompression", _vncCompression);
@@ -598,10 +615,10 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncoding"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncoding"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncoding"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncoding"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.Encoding VNCEncoding
{
get => GetPropertyValue("VNCEncoding", _vncEncoding);
@@ -609,10 +626,10 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationMode"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationMode"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationMode"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationMode"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.AuthMode VNCAuthMode
{
get => GetPropertyValue("VNCAuthMode", _vncAuthMode);
@@ -620,10 +637,10 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyType"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyType"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyType"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyType"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.ProxyType VNCProxyType
{
get => GetPropertyValue("VNCProxyType", _vncProxyType);
@@ -631,9 +648,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyAddress"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyAddress")]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyAddress"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyAddress")]
public string VNCProxyIP
{
get => GetPropertyValue("VNCProxyIP", _vncProxyIp);
@@ -641,9 +658,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPort"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPort")]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPort"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPort")]
public int VNCProxyPort
{
get => GetPropertyValue("VNCProxyPort", _vncProxyPort);
@@ -651,9 +668,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyUsername"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyUsername")]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyUsername"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyUsername")]
[Obsolete]
public string VNCProxyUsername
{
@@ -662,10 +679,10 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPassword"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPassword"),
- PasswordPropertyText(true)]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPassword"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPassword"),
+ PasswordPropertyText(true)]
[Obsolete]
public string VNCProxyPassword
{
@@ -674,10 +691,10 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- Browsable(false),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ Browsable(false),
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.Colors VNCColors
{
get => GetPropertyValue("VNCColors", _vncColors);
@@ -685,9 +702,9 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameSmartSizeMode"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSmartSizeMode"),
- TypeConverter(typeof(MiscTools.EnumTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameSmartSizeMode"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSmartSizeMode"),
+ TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public ProtocolVNC.SmartSizeMode VNCSmartSizeMode
{
get => GetPropertyValue("VNCSmartSizeMode", _vncSmartSizeMode);
@@ -695,21 +712,23 @@ namespace mRemoteNG.Connection
}
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
- LocalizedAttributes.LocalizedDisplayName("strPropertyNameViewOnly"),
- LocalizedAttributes.LocalizedDescription("strPropertyDescriptionViewOnly"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayName("strPropertyNameViewOnly"),
+ LocalizedAttributes.LocalizedDescription("strPropertyDescriptionViewOnly"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool VNCViewOnly
{
get => GetPropertyValue("VNCViewOnly", _vncViewOnly);
set => SetField(ref _vncViewOnly, value, "VNCViewOnly");
}
- #endregion
+
#endregion
- protected AbstractConnectionRecord(string uniqueId)
- {
- ConstantID = uniqueId.ThrowIfNullOrEmpty(nameof(uniqueId));
- }
+ #endregion
+
+ protected AbstractConnectionRecord(string uniqueId)
+ {
+ ConstantID = uniqueId.ThrowIfNullOrEmpty(nameof(uniqueId));
+ }
protected virtual TPropertyType GetPropertyValue(string propertyName, TPropertyType value)
{
@@ -717,6 +736,7 @@ namespace mRemoteNG.Connection
}
public event PropertyChangedEventHandler PropertyChanged;
+
protected virtual void RaisePropertyChangedEvent(object sender, PropertyChangedEventArgs args)
{
PropertyChanged?.Invoke(sender, new PropertyChangedEventArgs(args.PropertyName));
diff --git a/mRemoteV1/Connection/ConnectionIcon.cs b/mRemoteV1/Connection/ConnectionIcon.cs
index fc4397c1..60bae3c1 100644
--- a/mRemoteV1/Connection/ConnectionIcon.cs
+++ b/mRemoteV1/Connection/ConnectionIcon.cs
@@ -6,43 +6,45 @@ using mRemoteNG.App.Info;
namespace mRemoteNG.Connection
{
- public class ConnectionIcon : StringConverter
- {
- public static string[] Icons = {};
-
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- return new StandardValuesCollection(Icons);
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return true;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
-
- public static System.Drawing.Icon FromString(string iconName)
- {
- try
- {
- var iconPath = $"{GeneralAppInfo.HomePath}\\Icons\\{iconName}.ico";
-
- if (System.IO.File.Exists(iconPath))
- {
- var nI = new System.Drawing.Icon(iconPath);
- return nI;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
- $"Couldn\'t get Icon from String" + Environment.NewLine + ex.Message);
- }
- return null;
- }
- }
-}
+ public class ConnectionIcon : StringConverter
+ {
+ public static string[] Icons = { };
+
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ return new StandardValuesCollection(Icons);
+ }
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+
+ public static System.Drawing.Icon FromString(string iconName)
+ {
+ try
+ {
+ var iconPath = $"{GeneralAppInfo.HomePath}\\Icons\\{iconName}.ico";
+
+ if (System.IO.File.Exists(iconPath))
+ {
+ var nI = new System.Drawing.Icon(iconPath);
+ return nI;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ $"Couldn\'t get Icon from String" + Environment.NewLine +
+ ex.Message);
+ }
+
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/ConnectionInfo.cs b/mRemoteV1/Connection/ConnectionInfo.cs
index 4f007de7..67e18b94 100644
--- a/mRemoteV1/Connection/ConnectionInfo.cs
+++ b/mRemoteV1/Connection/ConnectionInfo.cs
@@ -21,22 +21,18 @@ namespace mRemoteNG.Connection
{
[DefaultProperty("Name")]
public class ConnectionInfo : AbstractConnectionRecord, IHasParent, IInheritable
- {
+ {
#region Public Properties
- [Browsable(false)]
- public ConnectionInfoInheritance Inheritance { get; set; }
- [Browsable(false)]
- public ProtocolList OpenConnections { get; protected set; }
+ [Browsable(false)] public ConnectionInfoInheritance Inheritance { get; set; }
- [Browsable(false)]
- public virtual bool IsContainer { get; set; }
+ [Browsable(false)] public ProtocolList OpenConnections { get; protected set; }
- [Browsable(false)]
- public bool IsDefault { get; set; }
+ [Browsable(false)] public virtual bool IsContainer { get; set; }
- [Browsable(false)]
- public ContainerInfo Parent { get; internal set; }
+ [Browsable(false)] public bool IsDefault { get; set; }
+
+ [Browsable(false)] public ContainerInfo Parent { get; internal set; }
//[Browsable(false)]
//private int PositionID { get; set; }
@@ -45,20 +41,20 @@ namespace mRemoteNG.Connection
// ReSharper disable once UnusedAutoPropertyAccessor.Global
public bool IsQuickConnect { get; set; }
- [Browsable(false)]
- public bool PleaseConnect { get; set; }
- #endregion
+ [Browsable(false)] public bool PleaseConnect { get; set; }
+
+ #endregion
#region Constructors
- public ConnectionInfo()
- : this(Guid.NewGuid().ToString())
- {
- }
+ public ConnectionInfo()
+ : this(Guid.NewGuid().ToString())
+ {
+ }
public ConnectionInfo(string uniqueId)
- : base(uniqueId)
- {
+ : base(uniqueId)
+ {
SetTreeDisplayDefaults();
SetConnectionDefaults();
SetProtocolDefaults();
@@ -69,56 +65,59 @@ namespace mRemoteNG.Connection
SetVncDefaults();
SetNonBrowsablePropertiesDefaults();
SetDefaults();
- }
+ }
+
#endregion
-
+
#region Public Methods
- public virtual ConnectionInfo Clone()
- {
- var newConnectionInfo = new ConnectionInfo();
+
+ public virtual ConnectionInfo Clone()
+ {
+ var newConnectionInfo = new ConnectionInfo();
newConnectionInfo.CopyFrom(this);
- newConnectionInfo.Inheritance = Inheritance.Clone();
+ newConnectionInfo.Inheritance = Inheritance.Clone();
newConnectionInfo.Inheritance.Parent = newConnectionInfo;
return newConnectionInfo;
- }
+ }
- public void CopyFrom(ConnectionInfo sourceConnectionInfo)
- {
- var properties = GetType().BaseType?.GetProperties().Where(prop => prop.CanRead && prop.CanWrite);
- if (properties == null) return;
- foreach (var property in properties)
- {
- if (property.Name == nameof(Parent)) continue;
- var remotePropertyValue = property.GetValue(sourceConnectionInfo, null);
+ public void CopyFrom(ConnectionInfo sourceConnectionInfo)
+ {
+ var properties = GetType().BaseType?.GetProperties().Where(prop => prop.CanRead && prop.CanWrite);
+ if (properties == null) return;
+ foreach (var property in properties)
+ {
+ if (property.Name == nameof(Parent)) continue;
+ var remotePropertyValue = property.GetValue(sourceConnectionInfo, null);
property.SetValue(this, remotePropertyValue, null);
- }
+ }
+
var clonedInheritance = sourceConnectionInfo.Inheritance.Clone();
clonedInheritance.Parent = this;
Inheritance = clonedInheritance;
}
- public virtual TreeNodeType GetTreeNodeType()
- {
- return TreeNodeType.Connection;
- }
+ public virtual TreeNodeType GetTreeNodeType()
+ {
+ return TreeNodeType.Connection;
+ }
private void SetDefaults()
- {
- if (Port == 0)
- {
- SetDefaultPort();
- }
- }
-
- public int GetDefaultPort()
- {
- return GetDefaultPort(Protocol);
- }
-
- public void SetDefaultPort()
- {
- Port = GetDefaultPort();
- }
+ {
+ if (Port == 0)
+ {
+ SetDefaultPort();
+ }
+ }
+
+ public int GetDefaultPort()
+ {
+ return GetDefaultPort(Protocol);
+ }
+
+ public void SetDefaultPort()
+ {
+ Port = GetDefaultPort();
+ }
protected virtual IEnumerable GetProperties(string[] excludedPropertyNames)
{
@@ -151,41 +150,45 @@ namespace mRemoteNG.Connection
Parent?.RemoveChild(this);
}
- public ConnectionInfo GetRootParent()
- {
- return Parent != null ? Parent.GetRootParent() : this;
- }
+ public ConnectionInfo GetRootParent()
+ {
+ return Parent != null ? Parent.GetRootParent() : this;
+ }
- #endregion
+ #endregion
#region Public Enumerations
+
[Flags()]
public enum Force
- {
- None = 0,
- UseConsoleSession = 1,
- Fullscreen = 2,
- DoNotJump = 4,
- OverridePanel = 8,
- DontUseConsoleSession = 16,
- NoCredentials = 32
- }
+ {
+ None = 0,
+ UseConsoleSession = 1,
+ Fullscreen = 2,
+ DoNotJump = 4,
+ OverridePanel = 8,
+ DontUseConsoleSession = 16,
+ NoCredentials = 32
+ }
+
#endregion
-
+
#region Private Methods
+
protected override TPropertyType GetPropertyValue(string propertyName, TPropertyType value)
{
if (!ShouldThisPropertyBeInherited(propertyName))
return value;
- var couldGetInheritedValue = TryGetInheritedPropertyValue(propertyName, out var inheritedValue);
+ var couldGetInheritedValue =
+ TryGetInheritedPropertyValue(propertyName, out var inheritedValue);
return couldGetInheritedValue
? inheritedValue
: value;
}
- private bool ShouldThisPropertyBeInherited(string propertyName)
+ private bool ShouldThisPropertyBeInherited(string propertyName)
{
return ParentIsValidInheritanceTarget() && IsInheritanceTurnedOnForThisProperty(propertyName);
}
@@ -199,7 +202,8 @@ namespace mRemoteNG.Connection
{
var inheritType = Inheritance.GetType();
var inheritPropertyInfo = inheritType.GetProperty(propertyName);
- var inheritPropertyValue = inheritPropertyInfo != null && Convert.ToBoolean(inheritPropertyInfo.GetValue(Inheritance, null));
+ var inheritPropertyValue = inheritPropertyInfo != null &&
+ Convert.ToBoolean(inheritPropertyInfo.GetValue(Inheritance, null));
return inheritPropertyValue;
}
@@ -210,24 +214,26 @@ namespace mRemoteNG.Connection
var connectionInfoType = Parent.GetType();
var parentPropertyInfo = connectionInfoType.GetProperty(propertyName);
if (parentPropertyInfo == null)
- throw new NullReferenceException($"Could not retrieve property data for property '{propertyName}' on parent node '{Parent?.Name}'");
+ throw new NullReferenceException(
+ $"Could not retrieve property data for property '{propertyName}' on parent node '{Parent?.Name}'");
inheritedValue = (TPropertyType)parentPropertyInfo.GetValue(Parent, null);
return true;
}
catch (Exception e)
{
- Runtime.MessageCollector.AddExceptionStackTrace($"Error retrieving inherited property '{propertyName}'", e);
+ Runtime.MessageCollector.AddExceptionStackTrace($"Error retrieving inherited property '{propertyName}'",
+ e);
inheritedValue = default(TPropertyType);
return false;
}
}
- private static int GetDefaultPort(ProtocolType protocol)
- {
- try
- {
- // ReSharper disable once SwitchStatementMissingSomeCases
+ private static int GetDefaultPort(ProtocolType protocol)
+ {
+ try
+ {
+ // ReSharper disable once SwitchStatementMissingSomeCases
switch (protocol)
{
case ProtocolType.RDP:
@@ -253,14 +259,15 @@ namespace mRemoteNG.Connection
case ProtocolType.IntApp:
return (int)IntegratedProgram.Defaults.Port;
}
+
return 0;
- }
- catch (Exception ex)
- {
+ }
+ catch (Exception ex)
+ {
Runtime.MessageCollector.AddExceptionMessage(Language.strConnectionSetDefaultPortFailed, ex);
return 0;
- }
- }
+ }
+ }
private void SetTreeDisplayDefaults()
{
@@ -281,31 +288,54 @@ namespace mRemoteNG.Connection
ExtApp = Settings.Default.ConDefaultExtApp;
Port = 0;
PuttySession = Settings.Default.ConDefaultPuttySession;
- ICAEncryptionStrength = (IcaProtocol.EncryptionStrength) Enum.Parse(typeof(IcaProtocol.EncryptionStrength), Settings.Default.ConDefaultICAEncryptionStrength);
+ ICAEncryptionStrength = (IcaProtocol.EncryptionStrength)Enum.Parse(typeof(IcaProtocol.EncryptionStrength),
+ Settings
+ .Default
+ .ConDefaultICAEncryptionStrength);
UseConsoleSession = Settings.Default.ConDefaultUseConsoleSession;
- RDPAuthenticationLevel = (RdpProtocol.AuthenticationLevel) Enum.Parse(typeof(RdpProtocol.AuthenticationLevel), Settings.Default.ConDefaultRDPAuthenticationLevel);
+ RDPAuthenticationLevel = (RdpProtocol.AuthenticationLevel)Enum.Parse(
+ typeof(RdpProtocol.AuthenticationLevel
+ ),
+ Settings
+ .Default
+ .ConDefaultRDPAuthenticationLevel);
RDPMinutesToIdleTimeout = Settings.Default.ConDefaultRDPMinutesToIdleTimeout;
RDPAlertIdleTimeout = Settings.Default.ConDefaultRDPAlertIdleTimeout;
LoadBalanceInfo = Settings.Default.ConDefaultLoadBalanceInfo;
- RenderingEngine = (HTTPBase.RenderingEngine) Enum.Parse(typeof(HTTPBase.RenderingEngine), Settings.Default.ConDefaultRenderingEngine);
+ RenderingEngine = (HTTPBase.RenderingEngine)Enum.Parse(typeof(HTTPBase.RenderingEngine),
+ Settings.Default.ConDefaultRenderingEngine);
UseCredSsp = Settings.Default.ConDefaultUseCredSsp;
}
private void SetRdGatewayDefaults()
{
- RDGatewayUsageMethod = (RdpProtocol.RDGatewayUsageMethod) Enum.Parse(typeof(RdpProtocol.RDGatewayUsageMethod), Settings.Default.ConDefaultRDGatewayUsageMethod);
+ RDGatewayUsageMethod = (RdpProtocol.RDGatewayUsageMethod)Enum.Parse(
+ typeof(RdpProtocol.RDGatewayUsageMethod
+ ),
+ Settings
+ .Default
+ .ConDefaultRDGatewayUsageMethod);
RDGatewayHostname = Settings.Default.ConDefaultRDGatewayHostname;
- RDGatewayUseConnectionCredentials = (RdpProtocol.RDGatewayUseConnectionCredentials) Enum.Parse(typeof(RdpProtocol.RDGatewayUseConnectionCredentials), Settings.Default.ConDefaultRDGatewayUseConnectionCredentials);
+ RDGatewayUseConnectionCredentials = (RdpProtocol.RDGatewayUseConnectionCredentials)Enum.Parse(
+ typeof(
+ RdpProtocol
+ .RDGatewayUseConnectionCredentials
+ ),
+ Settings
+ .Default
+ .ConDefaultRDGatewayUseConnectionCredentials);
RDGatewayUsername = Settings.Default.ConDefaultRDGatewayUsername;
RDGatewayPassword = Settings.Default.ConDefaultRDGatewayPassword;
RDGatewayDomain = Settings.Default.ConDefaultRDGatewayDomain;
}
- private void SetAppearanceDefaults()
+ private void SetAppearanceDefaults()
{
- Resolution = (RdpProtocol.RDPResolutions) Enum.Parse(typeof(RdpProtocol.RDPResolutions), Settings.Default.ConDefaultResolution);
+ Resolution = (RdpProtocol.RDPResolutions)Enum.Parse(typeof(RdpProtocol.RDPResolutions),
+ Settings.Default.ConDefaultResolution);
AutomaticResize = Settings.Default.ConDefaultAutomaticResize;
- Colors = (RdpProtocol.RDPColors) Enum.Parse(typeof(RdpProtocol.RDPColors), Settings.Default.ConDefaultColors);
+ Colors = (RdpProtocol.RDPColors)Enum.Parse(typeof(RdpProtocol.RDPColors),
+ Settings.Default.ConDefaultColors);
CacheBitmaps = Settings.Default.ConDefaultCacheBitmaps;
DisplayWallpaper = Settings.Default.ConDefaultDisplayWallpaper;
DisplayThemes = Settings.Default.ConDefaultDisplayThemes;
@@ -321,8 +351,10 @@ namespace mRemoteNG.Connection
RedirectClipboard = Settings.Default.ConDefaultRedirectClipboard;
RedirectPorts = Settings.Default.ConDefaultRedirectPorts;
RedirectSmartCards = Settings.Default.ConDefaultRedirectSmartCards;
- RedirectSound = (RdpProtocol.RDPSounds) Enum.Parse(typeof(RdpProtocol.RDPSounds), Settings.Default.ConDefaultRedirectSound);
- SoundQuality = (RdpProtocol.RDPSoundQuality)Enum.Parse(typeof(RdpProtocol.RDPSoundQuality), Settings.Default.ConDefaultSoundQuality);
+ RedirectSound = (RdpProtocol.RDPSounds)Enum.Parse(typeof(RdpProtocol.RDPSounds),
+ Settings.Default.ConDefaultRedirectSound);
+ SoundQuality = (RdpProtocol.RDPSoundQuality)Enum.Parse(typeof(RdpProtocol.RDPSoundQuality),
+ Settings.Default.ConDefaultSoundQuality);
}
private void SetMiscDefaults()
@@ -335,16 +367,22 @@ namespace mRemoteNG.Connection
private void SetVncDefaults()
{
- VNCCompression = (ProtocolVNC.Compression) Enum.Parse(typeof(ProtocolVNC.Compression), Settings.Default.ConDefaultVNCCompression);
- VNCEncoding = (ProtocolVNC.Encoding) Enum.Parse(typeof(ProtocolVNC.Encoding), Settings.Default.ConDefaultVNCEncoding);
- VNCAuthMode = (ProtocolVNC.AuthMode) Enum.Parse(typeof(ProtocolVNC.AuthMode), Settings.Default.ConDefaultVNCAuthMode);
- VNCProxyType = (ProtocolVNC.ProxyType) Enum.Parse(typeof(ProtocolVNC.ProxyType), Settings.Default.ConDefaultVNCProxyType);
+ VNCCompression = (ProtocolVNC.Compression)Enum.Parse(typeof(ProtocolVNC.Compression),
+ Settings.Default.ConDefaultVNCCompression);
+ VNCEncoding =
+ (ProtocolVNC.Encoding)Enum.Parse(typeof(ProtocolVNC.Encoding), Settings.Default.ConDefaultVNCEncoding);
+ VNCAuthMode =
+ (ProtocolVNC.AuthMode)Enum.Parse(typeof(ProtocolVNC.AuthMode), Settings.Default.ConDefaultVNCAuthMode);
+ VNCProxyType = (ProtocolVNC.ProxyType)Enum.Parse(typeof(ProtocolVNC.ProxyType),
+ Settings.Default.ConDefaultVNCProxyType);
VNCProxyIP = Settings.Default.ConDefaultVNCProxyIP;
VNCProxyPort = Settings.Default.ConDefaultVNCProxyPort;
VNCProxyUsername = Settings.Default.ConDefaultVNCProxyUsername;
VNCProxyPassword = Settings.Default.ConDefaultVNCProxyPassword;
- VNCColors = (ProtocolVNC.Colors) Enum.Parse(typeof(ProtocolVNC.Colors), Settings.Default.ConDefaultVNCColors);
- VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode) Enum.Parse(typeof(ProtocolVNC.SmartSizeMode), Settings.Default.ConDefaultVNCSmartSizeMode);
+ VNCColors = (ProtocolVNC.Colors)Enum.Parse(typeof(ProtocolVNC.Colors),
+ Settings.Default.ConDefaultVNCColors);
+ VNCSmartSizeMode = (ProtocolVNC.SmartSizeMode)Enum.Parse(typeof(ProtocolVNC.SmartSizeMode),
+ Settings.Default.ConDefaultVNCSmartSizeMode);
VNCViewOnly = Settings.Default.ConDefaultVNCViewOnly;
}
@@ -356,10 +394,12 @@ namespace mRemoteNG.Connection
}
private void SetNewOpenConnectionList()
- {
- OpenConnections = new ProtocolList();
- OpenConnections.CollectionChanged += (sender, args) => RaisePropertyChangedEvent(this, new PropertyChangedEventArgs("OpenConnections"));
- }
+ {
+ OpenConnections = new ProtocolList();
+ OpenConnections.CollectionChanged += (sender, args) =>
+ RaisePropertyChangedEvent(this, new PropertyChangedEventArgs("OpenConnections"));
+ }
+
#endregion
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/ConnectionInfoInheritance.cs b/mRemoteV1/Connection/ConnectionInfoInheritance.cs
index 7d7e212c..2ac14f3e 100644
--- a/mRemoteV1/Connection/ConnectionInfoInheritance.cs
+++ b/mRemoteV1/Connection/ConnectionInfoInheritance.cs
@@ -7,38 +7,48 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Connection
{
- public class ConnectionInfoInheritance
- {
+ public class ConnectionInfoInheritance
+ {
private ConnectionInfoInheritance _tempInheritanceStorage;
#region Public Properties
+
#region General
+
[LocalizedAttributes.LocalizedCategory("strCategoryGeneral"),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAll"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAll"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAll"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAll"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EverythingInherited
- {
- get { return EverythingIsInherited(); }
+ {
+ get { return EverythingIsInherited(); }
set { SetAllValues(value); }
- }
+ }
+
#endregion
+
#region Display
- [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDescription"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDescription"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Description {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameIcon"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionIcon"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Icon {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePanel"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPanel"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Panel {get; set;}
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDescription"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDescription"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Description { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameIcon"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionIcon"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Icon { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePanel"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPanel"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Panel { get; set; }
+
#endregion
+
#region Connection
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strCategoryCredentials)),
@@ -47,308 +57,370 @@ namespace mRemoteNG.Connection
public bool CredentialId { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUsername"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUsername"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUsername"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUsername"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(false)]
[Obsolete("Use the ConnectionRecord property")]
public bool Username { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePassword"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPassword"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePassword"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPassword"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(false)]
[Obsolete("Use the ConnectionRecord property")]
public bool Password { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDomain"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDomain"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDomain"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDomain"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(false)]
[Obsolete("Use the ConnectionRecord property")]
public bool Domain { get; set; }
+
#endregion
+
#region Protocol
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameProtocol"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionProtocol"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Protocol {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalTool"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalTool"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool ExtApp {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePort"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPort"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Port {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePuttySession"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPuttySession"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool PuttySession {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncryptionStrength"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncryptionStrength"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool ICAEncryptionStrength {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationLevel"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationLevel"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RDPAuthenticationLevel {get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDPMinutesToIdleTimeout"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDPMinutesToIdleTimeout"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RDPMinutesToIdleTimeout { get; set; }
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameProtocol"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionProtocol"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Protocol { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDPAlertIdleTimeout"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDPAlertIdleTimeout"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))] public bool RDPAlertIdleTimeout { get; set; }
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalTool"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalTool"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool ExtApp { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePort"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPort"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Port { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePuttySession"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPuttySession"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool PuttySession { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncryptionStrength"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncryptionStrength"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool ICAEncryptionStrength { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationLevel"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationLevel"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDPAuthenticationLevel { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDPMinutesToIdleTimeout"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDPMinutesToIdleTimeout"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDPMinutesToIdleTimeout { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDPAlertIdleTimeout"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDPAlertIdleTimeout"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDPAlertIdleTimeout { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameLoadBalanceInfo"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionLoadBalanceInfo"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool LoadBalanceInfo { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRenderingEngine"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRenderingEngine"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RenderingEngine { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseConsoleSession"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseConsoleSession"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool UseConsoleSession { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseCredSsp"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseCredSsp"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool UseCredSsp { get; set; }
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameLoadBalanceInfo"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionLoadBalanceInfo"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool LoadBalanceInfo {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRenderingEngine"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRenderingEngine"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RenderingEngine {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseConsoleSession"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseConsoleSession"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool UseConsoleSession {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseCredSsp"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseCredSsp"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool UseCredSsp {get; set;}
#endregion
+
#region RD Gateway
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsageMethod"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsageMethod"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayUsageMethod {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayHostname"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayHostname"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayHostname {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUseConnectionCredentials"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUseConnectionCredentials"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayUseConnectionCredentials {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsername"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsername"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayUsername {get; set;}
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayPassword"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayPassword"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayPassword {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayDomain"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayDomain"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
- public bool RDGatewayDomain {get; set;}
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsageMethod"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsageMethod"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayUsageMethod { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayHostname"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayHostname"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayHostname { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUseConnectionCredentials"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute(
+ "strPropertyDescriptionRDGatewayUseConnectionCredentials"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayUseConnectionCredentials { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsername"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsername"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayUsername { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayPassword"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayPassword"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayPassword { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayDomain"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayDomain"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RDGatewayDomain { get; set; }
+
#endregion
+
#region Appearance
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameResolution"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionResolution"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Resolution {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAutomaticResize"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAutomaticResize"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool AutomaticResize {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool Colors {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCacheBitmaps"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCacheBitmaps"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool CacheBitmaps {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayWallpaper"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayWallpaper"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool DisplayWallpaper {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayThemes"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayThemes"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool DisplayThemes {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableFontSmoothing"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableFontSmoothing"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool EnableFontSmoothing {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableDesktopComposition"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableEnableDesktopComposition"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool EnableDesktopComposition {get; set;}
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameResolution"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionResolution"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Resolution { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAutomaticResize"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAutomaticResize"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool AutomaticResize { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool Colors { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCacheBitmaps"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCacheBitmaps"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool CacheBitmaps { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayWallpaper"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayWallpaper"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool DisplayWallpaper { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayThemes"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayThemes"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool DisplayThemes { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableFontSmoothing"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableFontSmoothing"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool EnableFontSmoothing { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableDesktopComposition"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute(
+ "strPropertyDescriptionEnableEnableDesktopComposition"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool EnableDesktopComposition { get; set; }
#endregion
+
#region Redirect
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectKeys"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectKeys"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectKeys {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectDrives"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectDrives"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectDiskDrives {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPrinters"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPrinters"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectPrinters {get; set;}
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectClipboard"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectClipboard"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectClipboard { get; set; }
-
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPorts"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPorts"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectPorts {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSmartCards"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSmartCards"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectSmartCards {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSounds"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSounds"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool RedirectSound {get; set;}
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectKeys"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectKeys"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectKeys { get; set; }
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameSoundQuality"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionSoundQuality"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectDrives"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectDrives"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectDiskDrives { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPrinters"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPrinters"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectPrinters { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectClipboard"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectClipboard"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectClipboard { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPorts"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPorts"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectPorts { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSmartCards"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSmartCards"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectSmartCards { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSounds"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSounds"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool RedirectSound { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameSoundQuality"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionSoundQuality"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool SoundQuality { get; set; }
+
#endregion
+
#region Misc
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolBefore"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolBefore"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool PreExtApp {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolAfter"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolAfter"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool PostExtApp {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameMACAddress"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionMACAddress"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool MacAddress {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUser1"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUser1"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool UserField {get; set;}
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolBefore"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolBefore"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool PreExtApp { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolAfter"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolAfter"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool PostExtApp { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameMACAddress"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionMACAddress"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool MacAddress { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUser1"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUser1"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool UserField { get; set; }
+
#endregion
+
#region VNC
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCompression"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCompression"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCCompression {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncoding"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncoding"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCEncoding {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationMode"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationMode"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCAuthMode {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyType"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyType"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyType {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyAddress"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyAddress"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyIP {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPort"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPort"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPort {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyUsername"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyUsername"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyUsername {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPassword"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPassword"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPassword {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCColors {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameSmartSizeMode"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionSmartSizeMode"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCSmartSizeMode {get; set;}
-
- [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
- LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameViewOnly"),
- LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionViewOnly"),
- TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCViewOnly {get; set;}
- #endregion
-
- [Browsable(false)]
- public object Parent {get; set;}
- #endregion
-
- public ConnectionInfoInheritance(object parent, bool ignoreDefaultInheritance = false)
- {
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCompression"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCompression"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCCompression { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncoding"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncoding"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCEncoding { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationMode"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationMode"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCAuthMode { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyType"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyType"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCProxyType { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyAddress"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyAddress"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCProxyIP { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPort"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPort"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCProxyPort { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyUsername"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyUsername"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCProxyUsername { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPassword"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPassword"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCProxyPassword { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCColors { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameSmartSizeMode"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionSmartSizeMode"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCSmartSizeMode { get; set; }
+
+ [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
+ LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameViewOnly"),
+ LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionViewOnly"),
+ TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
+ public bool VNCViewOnly { get; set; }
+
+ #endregion
+
+ [Browsable(false)] public object Parent { get; set; }
+
+ #endregion
+
+
+ public ConnectionInfoInheritance(object parent, bool ignoreDefaultInheritance = false)
+ {
Parent = parent;
- if (!ignoreDefaultInheritance)
- SetAllValues(DefaultConnectionInheritance.Instance);
- }
+ if (!ignoreDefaultInheritance)
+ SetAllValues(DefaultConnectionInheritance.Instance);
+ }
- public ConnectionInfoInheritance Clone()
- {
- var newInheritance = (ConnectionInfoInheritance) MemberwiseClone();
- newInheritance._tempInheritanceStorage = null;
+ public ConnectionInfoInheritance Clone()
+ {
+ var newInheritance = (ConnectionInfoInheritance)MemberwiseClone();
+ newInheritance._tempInheritanceStorage = null;
return newInheritance;
- }
+ }
public void EnableInheritance()
{
@@ -374,14 +446,14 @@ namespace mRemoteNG.Connection
}
public void TurnOnInheritanceCompletely()
- {
- SetAllValues(true);
- }
-
- public void TurnOffInheritanceCompletely()
- {
- SetAllValues(false);
- }
+ {
+ SetAllValues(true);
+ }
+
+ public void TurnOffInheritanceCompletely()
+ {
+ SetAllValues(false);
+ }
private bool EverythingIsInherited()
{
@@ -408,8 +480,8 @@ namespace mRemoteNG.Connection
return valueShouldNotBeFiltered;
}
- private void SetAllValues(bool value)
- {
+ private void SetAllValues(bool value)
+ {
var properties = GetProperties();
foreach (var property in properties)
{
@@ -418,7 +490,7 @@ namespace mRemoteNG.Connection
}
}
- private void SetAllValues(ConnectionInfoInheritance otherInheritanceObject)
+ private void SetAllValues(ConnectionInfoInheritance otherInheritanceObject)
{
var properties = GetProperties();
foreach (var property in properties)
diff --git a/mRemoteV1/Connection/ConnectionInitiator.cs b/mRemoteV1/Connection/ConnectionInitiator.cs
index 1ef4bf20..ae982fe2 100644
--- a/mRemoteV1/Connection/ConnectionInitiator.cs
+++ b/mRemoteV1/Connection/ConnectionInitiator.cs
@@ -9,7 +9,8 @@ using System;
using System.Collections.Generic;
using System.Windows.Forms;
using mRemoteNG.Credential;
-using TabPage = Crownwood.Magic.Controls.TabPage;
+using mRemoteNG.UI.Tabs;
+using WeifenLuo.WinFormsUI.Docking;
namespace mRemoteNG.Connection
@@ -25,45 +26,71 @@ namespace mRemoteNG.Connection
_credentialService = credentialService;
}
- ///
- /// List of unique IDs of the currently active connections
- ///
public IEnumerable ActiveConnections => _activeConnections;
+ public void OpenConnection(ContainerInfo containerInfo, ConnectionInfo.Force force = ConnectionInfo.Force.None)
+ {
+ OpenConnection(containerInfo, force, null);
+ }
+
+ public void OpenConnection(ConnectionInfo connectionInfo)
+ {
+ try
+ {
+ OpenConnection(connectionInfo, ConnectionInfo.Force.None);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionOpenFailed, ex);
+ }
+ }
+
+ public void OpenConnection(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
+ {
+ try
+ {
+ OpenConnection(connectionInfo, force, null);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionOpenFailed, ex);
+ }
+ }
+
public bool SwitchToOpenConnection(ConnectionInfo connectionInfo)
{
var interfaceControl = FindConnectionContainer(connectionInfo);
if (interfaceControl == null) return false;
- var connectionWindow = (ConnectionWindow)interfaceControl.FindForm();
- connectionWindow?.Focus();
- var findForm = (ConnectionWindow)interfaceControl.FindForm();
- findForm?.Show(FrmMain.Default.pnlDock);
- var tabPage = (TabPage)interfaceControl.Parent;
- tabPage.Selected = true;
+ var connT = (ConnectionTab)interfaceControl.FindForm();
+ connT?.Focus();
+ var findForm = (ConnectionTab)interfaceControl.FindForm();
+ findForm?.Show(findForm.DockPanel);
return true;
}
- public void OpenConnection(ContainerInfo containerInfo, ConnectionInfo.Force force)
+ #region Private
+
+ private void OpenConnection(ContainerInfo containerInfo, ConnectionInfo.Force force, Form conForm)
{
var children = containerInfo.Children;
if (children.Count == 0) return;
foreach (var child in children)
{
- var childAsContainer = child as ContainerInfo;
- if (childAsContainer != null)
- OpenConnection(childAsContainer, force);
+ if (child is ContainerInfo childAsContainer)
+ OpenConnection(childAsContainer, force, conForm);
else
- OpenConnection(child, force);
+ OpenConnection(child, force, conForm);
}
}
- public void OpenConnection(ConnectionInfo connectionInfo, ConnectionInfo.Force force = ConnectionInfo.Force.None)
+ private void OpenConnection(ConnectionInfo connectionInfo, ConnectionInfo.Force force, Form conForm)
{
try
{
if (connectionInfo.Hostname == "" && connectionInfo.Protocol != ProtocolType.IntApp)
{
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, Language.strConnectionOpenFailedNoHostname);
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ Language.strConnectionOpenFailedNoHostname);
return;
}
@@ -80,7 +107,7 @@ namespace mRemoteNG.Connection
var connectionPanel = SetConnectionPanel(connectionInfo, force);
if (string.IsNullOrEmpty(connectionPanel)) return;
- var connectionForm = SetConnectionForm(connectionPanel);
+ var connectionForm = SetConnectionForm(conForm, connectionPanel);
var connectionContainer = SetConnectionContainer(connectionInfo, connectionForm);
SetConnectionFormEventHandlers(newProtocol, connectionForm);
SetConnectionEventHandlers(newProtocol);
@@ -110,7 +137,6 @@ namespace mRemoteNG.Connection
}
}
- #region Private
private static void StartPreConnectionExternalApp(ConnectionInfo connectionInfo)
{
if (connectionInfo.PreExtApp == "") return;
@@ -123,26 +149,29 @@ namespace mRemoteNG.Connection
if (connectionInfo.OpenConnections.Count <= 0) return null;
for (var i = 0; i <= Runtime.WindowList.Count - 1; i++)
{
- var window = Runtime.WindowList[i] as ConnectionWindow;
- var connectionWindow = window;
- if (connectionWindow?.TabController == null) continue;
- foreach (TabPage t in connectionWindow.TabController.TabPages)
+ // the new structure is ConnectionWindow.Controls[0].ActiveDocument.Controls[0]
+ // DockPanel InterfaceControl
+ if (!(Runtime.WindowList[i] is ConnectionWindow connectionWindow)) continue;
+ if (connectionWindow.Controls.Count < 1) continue;
+ if (!(connectionWindow.Controls[0] is DockPanel cwDp)) continue;
+ foreach (var dockContent in cwDp.Documents)
{
- var ic = t.Controls[0] as InterfaceControl;
+ var tab = (ConnectionTab)dockContent;
+ var ic = InterfaceControl.FindInterfaceControl(tab);
if (ic == null) continue;
if (ic.Info == connectionInfo)
- {
return ic;
- }
}
}
+
return null;
}
private static string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
{
string connectionPanel;
- if (connectionInfo.Panel == "" || force.HasFlag(ConnectionInfo.Force.OverridePanel) || Settings.Default.AlwaysShowPanelSelectionDlg)
+ if (connectionInfo.Panel == "" || force.HasFlag(ConnectionInfo.Force.OverridePanel) ||
+ Settings.Default.AlwaysShowPanelSelectionDlg)
{
var frmPnl = new FrmChoosePanel();
if (frmPnl.ShowDialog() == DialogResult.OK)
@@ -156,43 +185,52 @@ namespace mRemoteNG.Connection
}
else
{
- connectionPanel = connectionInfo.Panel;
+ //Return the current panel if exist, if not return default panel
+ if (TabHelper.Instance.CurrentPanel != null)
+ {
+ connectionPanel = TabHelper.Instance.CurrentPanel.TabText;
+ }
+ else
+ {
+ connectionPanel = connectionInfo.Panel;
+ }
}
+
return connectionPanel;
}
- private ConnectionWindow SetConnectionForm(string connectionPanelName)
+ private Form SetConnectionForm(Form conForm, string connectionPanel)
{
- var connectionForm = Runtime.WindowList.FromString(connectionPanelName) as ConnectionWindow;
+ var connectionForm = conForm ?? Runtime.WindowList.FromString(connectionPanel);
if (connectionForm == null)
- connectionForm = _panelAdder.AddPanel(connectionPanelName);
+ connectionForm = _panelAdder.AddPanel(connectionPanel);
else
- connectionForm.Show(FrmMain.Default.pnlDock);
+ ((ConnectionWindow)connectionForm).Show(FrmMain.Default.pnlDock);
connectionForm.Focus();
return connectionForm;
}
- private static Control SetConnectionContainer(ConnectionInfo connectionInfo, ConnectionWindow connectionForm)
+ private static Control SetConnectionContainer(ConnectionInfo connectionInfo, Form connectionForm)
{
- Control connectionContainer = connectionForm.AddConnectionTab(connectionInfo);
+ Control connectionContainer = ((ConnectionWindow)connectionForm).AddConnectionTab(connectionInfo);
if (connectionInfo.Protocol != ProtocolType.IntApp) return connectionContainer;
var extT = Runtime.ExternalToolsService.GetExtAppByName(connectionInfo.ExtApp);
- if(extT == null) return connectionContainer;
+ if (extT == null) return connectionContainer;
if (extT.Icon != null)
- ((TabPage)connectionContainer).Icon = extT.Icon;
+ ((ConnectionTab)connectionContainer).Icon = extT.Icon;
return connectionContainer;
}
- private static void SetConnectionFormEventHandlers(ProtocolBase newProtocol, ConnectionWindow connectionForm)
+ private static void SetConnectionFormEventHandlers(ProtocolBase newProtocol, Form connectionForm)
{
- newProtocol.Closed += connectionForm.Prot_Event_Closed;
+ newProtocol.Closed += ((ConnectionWindow)connectionForm).Prot_Event_Closed;
}
private void SetConnectionEventHandlers(ProtocolBase newProtocol)
@@ -203,13 +241,17 @@ namespace mRemoteNG.Connection
newProtocol.ErrorOccured += Prot_Event_ErrorOccured;
}
- private static void BuildConnectionInterfaceController(ConnectionInfo connectionInfo, ProtocolBase newProtocol, Control connectionContainer)
+ private static void BuildConnectionInterfaceController(ConnectionInfo connectionInfo,
+ ProtocolBase newProtocol,
+ Control connectionContainer)
{
newProtocol.InterfaceControl = new InterfaceControl(connectionContainer, newProtocol, connectionInfo);
}
+
#endregion
#region Event handlers
+
private static void Prot_Event_Disconnected(object sender, string disconnectedMessage, int? reasonCode)
{
try
@@ -225,12 +267,12 @@ namespace mRemoteNG.Connection
}
}
- Runtime.MessageCollector.AddMessage(msgClass,
- string.Format(
- Language.strProtocolEventDisconnected,
- disconnectedMessage,
- prot.InterfaceControl.Info.Hostname,
- prot.InterfaceControl.Info.Protocol.ToString()));
+ Runtime.MessageCollector.AddMessage(msgClass,
+ string.Format(
+ Language.strProtocolEventDisconnected,
+ disconnectedMessage,
+ prot.InterfaceControl.Info.Hostname,
+ prot.InterfaceControl.Info.Protocol.ToString()));
}
catch (Exception ex)
{
@@ -243,16 +285,21 @@ namespace mRemoteNG.Connection
try
{
var prot = (ProtocolBase)sender;
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnenctionCloseEvent, true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnenctionCloseEvent,
+ true);
string connDetail;
- if (prot.InterfaceControl.Info.Hostname == "" && prot.InterfaceControl.Info.Protocol == ProtocolType.IntApp)
+ if (prot.InterfaceControl.Info.Hostname == "" &&
+ prot.InterfaceControl.Info.Protocol == ProtocolType.IntApp)
connDetail = prot.InterfaceControl.Info.ExtApp;
else if (prot.InterfaceControl.Info.Hostname != "")
connDetail = prot.InterfaceControl.Info.Hostname;
else
connDetail = "UNKNOWN";
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strConnenctionClosedByUser, connDetail, prot.InterfaceControl.Info.Protocol, Environment.UserName));
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strConnenctionClosedByUser, connDetail,
+ prot.InterfaceControl.Info.Protocol,
+ Environment.UserName));
prot.InterfaceControl.Info.OpenConnections.Remove(prot);
if (_activeConnections.Contains(prot.InterfaceControl.Info.ConstantID))
_activeConnections.Remove(prot.InterfaceControl.Info.ConstantID);
@@ -270,21 +317,27 @@ namespace mRemoteNG.Connection
private static void Prot_Event_Connected(object sender)
{
var prot = (ProtocolBase)sender;
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnectionEventConnected, true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strConnectionEventConnectedDetail, prot.InterfaceControl.Info.Hostname, prot.InterfaceControl.Info.Protocol, Environment.UserName, prot.InterfaceControl.Info.Description, prot.InterfaceControl.Info.UserField));
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnectionEventConnected,
+ true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strConnectionEventConnectedDetail,
+ prot.InterfaceControl.Info.Hostname,
+ prot.InterfaceControl.Info.Protocol, Environment.UserName,
+ prot.InterfaceControl.Info.Description,
+ prot.InterfaceControl.Info.UserField));
}
private static void Prot_Event_ErrorOccured(object sender, string errorMessage, int? errorCode)
{
try
{
- var prot = (ProtocolBase) sender;
+ var prot = (ProtocolBase)sender;
var msg = string.Format(
- Language.strConnectionEventErrorOccured,
- errorMessage,
- prot.InterfaceControl.Info.Hostname,
- errorCode?.ToString() ?? "-");
+ Language.strConnectionEventErrorOccured,
+ errorMessage,
+ prot.InterfaceControl.Info.Hostname,
+ errorCode?.ToString() ?? "-");
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, msg);
}
catch (Exception ex)
@@ -292,6 +345,7 @@ namespace mRemoteNG.Connection
Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionEventConnectionFailed, ex);
}
}
+
#endregion
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/ConnectionsService.cs b/mRemoteV1/Connection/ConnectionsService.cs
index 6a0cbc79..6357042b 100644
--- a/mRemoteV1/Connection/ConnectionsService.cs
+++ b/mRemoteV1/Connection/ConnectionsService.cs
@@ -47,7 +47,8 @@ namespace mRemoteNG.Connection
_puttySessionsManager = puttySessionsManager.ThrowIfNull(nameof(puttySessionsManager));
_credentialService = credentialService.ThrowIfNull(nameof(credentialService));
var path = SettingsFileInfo.SettingsPath;
- _localConnectionPropertiesDataProvider = new FileDataProvider(Path.Combine(path, "LocalConnectionProperties.xml"));
+ _localConnectionPropertiesDataProvider =
+ new FileDataProvider(Path.Combine(path, "LocalConnectionProperties.xml"));
_localConnectionPropertiesSerializer = new LocalConnectionPropertiesXmlSerializer();
_puttySessionsManager.RootPuttySessionsNodes.ForEach(node => ConnectionTreeModel.AddRootNode(node));
@@ -79,7 +80,9 @@ namespace mRemoteNG.Connection
var newConnectionInfo = new ConnectionInfo();
newConnectionInfo.CopyFrom(DefaultConnectionInfo.Instance);
- newConnectionInfo.Name = Settings.Default.IdentifyQuickConnectTabs ? string.Format(Language.strQuick, uriBuilder.Host) : uriBuilder.Host;
+ newConnectionInfo.Name = Settings.Default.IdentifyQuickConnectTabs
+ ? string.Format(Language.strQuick, uriBuilder.Host)
+ : uriBuilder.Host;
newConnectionInfo.Protocol = protocol;
newConnectionInfo.Hostname = uriBuilder.Host;
@@ -118,7 +121,8 @@ namespace mRemoteNG.Connection
var oldIsUsingDatabaseValue = UsingDatabase;
var connectionLoader = useDatabase
- ? (IConnectionsLoader)new SqlConnectionsLoader(_localConnectionPropertiesSerializer, _localConnectionPropertiesDataProvider)
+ ? (IConnectionsLoader)new SqlConnectionsLoader(_localConnectionPropertiesSerializer,
+ _localConnectionPropertiesDataProvider)
: new XmlConnectionsLoader(connectionFileName, _credentialService, this);
var serializationResult = connectionLoader.Load();
@@ -128,7 +132,8 @@ namespace mRemoteNG.Connection
if (serializationResult == null)
{
- DialogFactory.ShowLoadConnectionsFailedDialog(connectionFileName, "Decrypting connection file failed", IsConnectionsFileLoaded);
+ DialogFactory.ShowLoadConnectionsFailedDialog(connectionFileName, "Decrypting connection file failed",
+ IsConnectionsFileLoaded);
return;
}
@@ -144,8 +149,11 @@ namespace mRemoteNG.Connection
ConnectionTreeModel.AddRootNode(rootNode);
UpdateCustomConsPathSetting(connectionFileName);
- RaiseConnectionsLoadedEvent(new List(), new List(), oldIsUsingDatabaseValue, useDatabase, connectionFileName);
- Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Connections loaded using {connectionLoader.GetType().Name}");
+ // TODO: fix this call
+ RaiseConnectionsLoadedEvent(new List(), new List(),
+ oldIsUsingDatabaseValue, useDatabase, connectionFileName);
+ Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
+ $"Connections loaded using {connectionLoader.GetType().Name}");
}
///
@@ -170,7 +178,7 @@ namespace mRemoteNG.Connection
if (_saveAsyncRequested)
SaveConnectionsAsync();
- else if(_saveRequested)
+ else if (_saveRequested)
SaveConnections();
}
@@ -235,12 +243,15 @@ namespace mRemoteNG.Connection
UsingDatabase = useDatabase;
ConnectionFileName = connectionFileName;
- RaiseConnectionsSavedEvent(connectionTreeModel, previouslyUsingDatabase, UsingDatabase, connectionFileName);
+ RaiseConnectionsSavedEvent(connectionTreeModel, previouslyUsingDatabase, UsingDatabase,
+ connectionFileName);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Successfully saved connections");
}
catch (Exception ex)
{
- Runtime.MessageCollector?.AddExceptionMessage(string.Format(Language.strConnectionsFileCouldNotSaveAs, connectionFileName), ex, logOnly:false);
+ Runtime.MessageCollector?.AddExceptionMessage(
+ string.Format(Language.strConnectionsFileCouldNotSaveAs,
+ connectionFileName), ex, logOnly: false);
}
finally
{
@@ -268,11 +279,11 @@ namespace mRemoteNG.Connection
lock (SaveLock)
{
SaveConnections(
- ConnectionTreeModel,
- UsingDatabase,
- new SaveFilter(),
- ConnectionFileName,
- propertyNameTrigger: propertyNameTrigger);
+ ConnectionTreeModel,
+ UsingDatabase,
+ new SaveFilter(),
+ ConnectionFileName,
+ propertyNameTrigger: propertyNameTrigger);
}
});
t.SetApartmentState(ApartmentState.STA);
@@ -281,15 +292,15 @@ namespace mRemoteNG.Connection
public string GetStartupConnectionFileName()
{
- return Settings.Default.LoadConsFromCustomLocation == false
- ? GetDefaultStartupConnectionFileName()
+ return Settings.Default.LoadConsFromCustomLocation == false
+ ? GetDefaultStartupConnectionFileName()
: Settings.Default.CustomConsPath;
}
public string GetDefaultStartupConnectionFileName()
{
- return Runtime.IsPortableEdition
- ? GetDefaultStartupConnectionFileNamePortableEdition()
+ return Runtime.IsPortableEdition
+ ? GetDefaultStartupConnectionFileNamePortableEdition()
: GetDefaultStartupConnectionFileNameNormalEdition();
}
@@ -309,9 +320,9 @@ namespace mRemoteNG.Connection
private string GetDefaultStartupConnectionFileNameNormalEdition()
{
var appDataPath = Path.Combine(
- Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
- Application.ProductName,
- ConnectionsFileInfo.DefaultConnectionsFile);
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+ Application.ProductName,
+ ConnectionsFileInfo.DefaultConnectionsFile);
return File.Exists(appDataPath) ? appDataPath : GetDefaultStartupConnectionFileNamePortableEdition();
}
@@ -321,6 +332,7 @@ namespace mRemoteNG.Connection
}
#region Events
+
public event EventHandler ConnectionsLoaded;
public event EventHandler ConnectionsSaved;
@@ -331,9 +343,9 @@ namespace mRemoteNG.Connection
ConnectionsLoaded?.Invoke(this, new ConnectionsLoadedEventArgs(
removedConnections,
addedConnections,
- previousSourceWasDatabase,
- newSourceIsDatabase,
- newSourcePath));
+ previousSourceWasDatabase,
+ newSourceIsDatabase,
+ newSourcePath));
}
private void RaiseConnectionsSavedEvent(IConnectionTreeModel modelThatWasSaved, bool previouslyUsingDatabase, bool usingDatabase, string connectionFileName)
diff --git a/mRemoteV1/Connection/DefaultConnectionInfo.cs b/mRemoteV1/Connection/DefaultConnectionInfo.cs
index 5c391c63..a58c6d5f 100644
--- a/mRemoteV1/Connection/DefaultConnectionInfo.cs
+++ b/mRemoteV1/Connection/DefaultConnectionInfo.cs
@@ -12,29 +12,31 @@ namespace mRemoteNG.Connection
private DefaultConnectionInfo()
{
IsDefault = true;
- Inheritance = DefaultConnectionInheritance.Instance;
+ Inheritance = DefaultConnectionInheritance.Instance;
}
public void LoadFrom(TSource sourceInstance, Func propertyNameMutator = null)
{
if (propertyNameMutator == null)
- propertyNameMutator = a => a;
+ propertyNameMutator = a => a;
var connectionProperties = GetSerializableProperties();
foreach (var property in connectionProperties)
{
try
{
- var expectedPropertyName = propertyNameMutator(property.Name);
- var propertyFromSource = typeof(TSource).GetProperty(expectedPropertyName);
+ var expectedPropertyName = propertyNameMutator(property.Name);
+ var propertyFromSource = typeof(TSource).GetProperty(expectedPropertyName);
if (propertyFromSource == null)
- throw new SettingsPropertyNotFoundException($"No property with name '{expectedPropertyName}' found.");
+ throw new SettingsPropertyNotFoundException(
+ $"No property with name '{expectedPropertyName}' found.");
+
+ var valueFromSource = propertyFromSource.GetValue(sourceInstance, null);
- var valueFromSource = propertyFromSource.GetValue(sourceInstance, null);
-
if (property.PropertyType.IsEnum)
{
- property.SetValue(Instance, Enum.Parse(property.PropertyType, valueFromSource.ToString()), null);
+ property.SetValue(Instance, Enum.Parse(property.PropertyType, valueFromSource.ToString()),
+ null);
continue;
}
@@ -42,15 +44,18 @@ namespace mRemoteNG.Connection
}
catch (Exception ex)
{
- Runtime.MessageCollector?.AddExceptionStackTrace($"Error loading default connectioninfo property {property.Name}", ex);
+ Runtime.MessageCollector?.AddExceptionStackTrace(
+ $"Error loading default connectioninfo property {property.Name}",
+ ex);
}
}
}
- public void SaveTo(TDestination destinationInstance, Func propertyNameMutator = null)
+ public void SaveTo(TDestination destinationInstance,
+ Func propertyNameMutator = null)
{
if (propertyNameMutator == null)
- propertyNameMutator = (a) => a;
+ propertyNameMutator = (a) => a;
var connectionProperties = GetSerializableProperties();
@@ -58,24 +63,27 @@ namespace mRemoteNG.Connection
{
try
{
- var expectedPropertyName = propertyNameMutator(property.Name);
- var propertyFromDestination = typeof(TDestination).GetProperty(expectedPropertyName);
+ var expectedPropertyName = propertyNameMutator(property.Name);
+ var propertyFromDestination = typeof(TDestination).GetProperty(expectedPropertyName);
- if (propertyFromDestination == null)
- throw new SettingsPropertyNotFoundException($"No property with name '{expectedPropertyName}' found.");
+ if (propertyFromDestination == null)
+ throw new SettingsPropertyNotFoundException(
+ $"No property with name '{expectedPropertyName}' found.");
- // ensure value is of correct type
+ // ensure value is of correct type
var value = property.PropertyType == propertyFromDestination.PropertyType
? property.GetValue(Instance, null)
: propertyFromDestination.PropertyType == typeof(string)
? property.GetValue(Instance, null).ToString()
- : Convert.ChangeType(property.GetValue(Instance, null), propertyFromDestination.PropertyType);
+ : Convert.ChangeType(property.GetValue(Instance, null), propertyFromDestination.PropertyType);
propertyFromDestination.SetValue(destinationInstance, value, null);
}
catch (Exception ex)
{
- Runtime.MessageCollector?.AddExceptionStackTrace($"Error saving default connectioninfo property {property.Name}", ex);
+ Runtime.MessageCollector?.AddExceptionStackTrace(
+ $"Error saving default connectioninfo property {property.Name}",
+ ex);
}
}
}
diff --git a/mRemoteV1/Connection/DefaultConnectionInheritance.cs b/mRemoteV1/Connection/DefaultConnectionInheritance.cs
index b55ca863..8e2d8e82 100644
--- a/mRemoteV1/Connection/DefaultConnectionInheritance.cs
+++ b/mRemoteV1/Connection/DefaultConnectionInheritance.cs
@@ -13,10 +13,11 @@ namespace mRemoteNG.Connection
}
static DefaultConnectionInheritance()
- { }
+ {
+ }
- public void LoadFrom(TSource sourceInstance, Func propertyNameMutator = null)
+ public void LoadFrom(TSource sourceInstance, Func propertyNameMutator = null)
{
if (propertyNameMutator == null) propertyNameMutator = a => a;
var inheritanceProperties = GetProperties();
@@ -26,15 +27,18 @@ namespace mRemoteNG.Connection
if (propertyFromSettings == null)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
- $"DefaultConInherit-LoadFrom: Could not load {property.Name}", true);
+ $"DefaultConInherit-LoadFrom: Could not load {property.Name}",
+ true);
continue;
}
+
var valueFromSettings = propertyFromSettings.GetValue(sourceInstance, null);
property.SetValue(Instance, valueFromSettings, null);
}
}
- public void SaveTo(TDestination destinationInstance, Func propertyNameMutator = null)
+ public void SaveTo(TDestination destinationInstance,
+ Func propertyNameMutator = null)
{
if (propertyNameMutator == null) propertyNameMutator = a => a;
var inheritanceProperties = GetProperties();
@@ -45,9 +49,11 @@ namespace mRemoteNG.Connection
if (propertyFromSettings == null)
{
Runtime.MessageCollector?.AddMessage(Messages.MessageClass.ErrorMsg,
- $"DefaultConInherit-SaveTo: Could not load {property.Name}", true);
+ $"DefaultConInherit-SaveTo: Could not load {property.Name}",
+ true);
continue;
}
+
propertyFromSettings.SetValue(destinationInstance, localValue, null);
}
}
diff --git a/mRemoteV1/Connection/IConnectionInitiator.cs b/mRemoteV1/Connection/IConnectionInitiator.cs
index 0023d27a..c29a15d4 100644
--- a/mRemoteV1/Connection/IConnectionInitiator.cs
+++ b/mRemoteV1/Connection/IConnectionInitiator.cs
@@ -1,5 +1,5 @@
-using mRemoteNG.Container;
using System.Collections.Generic;
+using mRemoteNG.Container;
namespace mRemoteNG.Connection
{
@@ -7,9 +7,11 @@ namespace mRemoteNG.Connection
{
IEnumerable ActiveConnections { get; }
+ void OpenConnection(ConnectionInfo connectionInfo);
+
void OpenConnection(ContainerInfo containerInfo, ConnectionInfo.Force force = ConnectionInfo.Force.None);
- void OpenConnection(ConnectionInfo connectionInfo, ConnectionInfo.Force force = ConnectionInfo.Force.None);
+ void OpenConnection(ConnectionInfo connectionInfo, ConnectionInfo.Force force);
bool SwitchToOpenConnection(ConnectionInfo connectionInfo);
}
diff --git a/mRemoteV1/Connection/InterfaceControl.cs b/mRemoteV1/Connection/InterfaceControl.cs
index 185d5023..b21c31b8 100644
--- a/mRemoteV1/Connection/InterfaceControl.cs
+++ b/mRemoteV1/Connection/InterfaceControl.cs
@@ -3,32 +3,55 @@ using mRemoteNG.Connection.Protocol;
using System;
using System.Drawing;
using System.Windows.Forms;
+using mRemoteNG.UI.Tabs;
+using WeifenLuo.WinFormsUI.Docking;
namespace mRemoteNG.Connection
{
- public sealed partial class InterfaceControl
+ public sealed partial class InterfaceControl
{
public ProtocolBase Protocol { get; set; }
- public ConnectionInfo Info { get; set; }
+ public ConnectionInfo Info { get; set; }
- public InterfaceControl(Control parent, ProtocolBase protocol, ConnectionInfo info)
- {
- try
- {
- Protocol = protocol;
- Info = info;
+ public InterfaceControl(Control parent, ProtocolBase protocol, ConnectionInfo info)
+ {
+ try
+ {
+ Protocol = protocol;
+ Info = info;
Parent = parent;
Location = new Point(0, 0);
Size = Parent.Size;
Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
- InitializeComponent();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Couldn\'t create new InterfaceControl" + Environment.NewLine + ex.Message);
- }
- }
- }
+ InitializeComponent();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ "Couldn\'t create new InterfaceControl" + Environment.NewLine +
+ ex.Message);
+ }
+ }
+
+ public static InterfaceControl FindInterfaceControl(DockPanel DockPnl)
+ {
+ if (!(DockPnl.ActiveDocument is ConnectionTab ct)) return null;
+ if (ct.Controls.Count < 1) return null;
+ if (ct.Controls[0] is InterfaceControl ic)
+ return ic;
+
+ return null;
+ }
+
+ public static InterfaceControl FindInterfaceControl(ConnectionTab tab)
+ {
+ if (tab.Controls.Count < 1) return null;
+ if (tab.Controls[0] is InterfaceControl ic)
+ return ic;
+
+ return null;
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTP.cs b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTP.cs
index cbdaca2f..3ebf3007 100644
--- a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTP.cs
+++ b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTP.cs
@@ -1,17 +1,16 @@
namespace mRemoteNG.Connection.Protocol.Http
{
- public class ProtocolHTTP : HTTPBase
- {
-
- public ProtocolHTTP(RenderingEngine RenderingEngine) : base(RenderingEngine)
- {
+ public class ProtocolHTTP : HTTPBase
+ {
+ public ProtocolHTTP(RenderingEngine RenderingEngine) : base(RenderingEngine)
+ {
httpOrS = "http";
defaultPort = (int)Defaults.Port;
}
-
- public enum Defaults
- {
- Port = 80
- }
- }
-}
+
+ public enum Defaults
+ {
+ Port = 80
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPBase.cs b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPBase.cs
index 5c426553..9c1fcc02 100644
--- a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPBase.cs
+++ b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPBase.cs
@@ -4,64 +4,66 @@ using Gecko;
using mRemoteNG.Tools;
using mRemoteNG.App;
using mRemoteNG.Credential;
-using TabPage = Crownwood.Magic.Controls.TabPage;
+
namespace mRemoteNG.Connection.Protocol.Http
{
- public class HTTPBase : ProtocolBase
- {
+ public class HTTPBase : ProtocolBase
+ {
#region Private Properties
- private Control wBrowser;
- protected string httpOrS;
- protected int defaultPort;
- private string tabTitle;
+
+ private Control wBrowser;
+ protected string httpOrS;
+ protected int defaultPort;
+ private string tabTitle;
+
#endregion
-
+
#region Public Methods
- protected HTTPBase(RenderingEngine RenderingEngine)
- {
- try
- {
- if (RenderingEngine == RenderingEngine.Gecko)
- {
- if(!Xpcom.IsInitialized)
+ protected HTTPBase(RenderingEngine RenderingEngine)
+ {
+ try
+ {
+ if (RenderingEngine == RenderingEngine.Gecko)
+ {
+ if (!Xpcom.IsInitialized)
Xpcom.Initialize("Firefox");
Control = new GeckoWebBrowser();
- }
- else
- {
+ }
+ else
+ {
Control = new WebBrowser();
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpConnectionFailed, ex);
- }
- }
-
- public override bool Initialize()
- {
- base.Initialize();
-
- try
- {
- var objTabPage = InterfaceControl.Parent as TabPage;
- if (objTabPage != null) tabTitle = objTabPage.Title;
- }
- catch (Exception)
- {
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpConnectionFailed, ex);
+ }
+ }
+
+ public override bool Initialize()
+ {
+ base.Initialize();
+
+ try
+ {
+ var objTabPage = InterfaceControl.Parent as TabPage;
+ // if (objTabPage != null) tabTitle = objTabPage.Title;
+ }
+ catch (Exception)
+ {
tabTitle = "";
- }
-
- try
- {
+ }
+
+ try
+ {
wBrowser = Control;
-
- if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
- {
- var GeckoBrowser = (GeckoWebBrowser) wBrowser;
+
+ if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
+ {
+ var GeckoBrowser = (GeckoWebBrowser)wBrowser;
if (GeckoBrowser != null)
{
GeckoBrowser.DocumentTitleChanged += geckoBrowser_DocumentTitleChanged;
@@ -73,31 +75,31 @@ namespace mRemoteNG.Connection.Protocol.Http
}
}
else
- {
+ {
var objWebBrowser = (WebBrowser)wBrowser;
- objWebBrowser.ScrollBarsEnabled = true;
+ objWebBrowser.ScrollBarsEnabled = true;
// http://stackoverflow.com/questions/4655662/how-to-ignore-script-errors-in-webbrowser
objWebBrowser.ScriptErrorsSuppressed = true;
objWebBrowser.Navigated += wBrowser_Navigated;
- objWebBrowser.DocumentTitleChanged += wBrowser_DocumentTitleChanged;
- }
-
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpSetPropsFailed, ex);
- return false;
- }
- }
-
- public override bool Connect()
- {
- try
- {
- var strHost = InterfaceControl.Info.Hostname;
+ objWebBrowser.DocumentTitleChanged += wBrowser_DocumentTitleChanged;
+ }
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpSetPropsFailed, ex);
+ return false;
+ }
+ }
+
+ public override bool Connect()
+ {
+ try
+ {
+ var strHost = InterfaceControl.Info.Hostname;
/*
* Commenting out since this codes doesn't actually do anything at this time...
* Possibly related to MR-221 and/or MR-533 ????
@@ -108,117 +110,120 @@ namespace mRemoteNG.Connection.Protocol.Http
{
strAuth = "Authorization: Basic " + Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(InterfaceControl.Info.Username + ":" + InterfaceControl.Info.Password)) + Environment.NewLine;
}
- */
- if (InterfaceControl.Info.Port != defaultPort)
- {
- if (strHost.EndsWith("/"))
- {
- strHost = strHost.Substring(0, strHost.Length - 1);
- }
-
- if (strHost.Contains(httpOrS + "://") == false)
- {
- strHost = httpOrS + "://" + strHost;
- }
-
- if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
- {
+ */
+ if (InterfaceControl.Info.Port != defaultPort)
+ {
+ if (strHost.EndsWith("/"))
+ {
+ strHost = strHost.Substring(0, strHost.Length - 1);
+ }
+
+ if (strHost.Contains(httpOrS + "://") == false)
+ {
+ strHost = httpOrS + "://" + strHost;
+ }
+
+ if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
+ {
((GeckoWebBrowser)wBrowser).Navigate(strHost + ":" + InterfaceControl.Info.Port);
- }
- else
- {
+ }
+ else
+ {
((WebBrowser)wBrowser).Navigate(strHost + ":" + InterfaceControl.Info.Port);
- }
- }
- else
- {
- if (strHost.Contains(httpOrS + "://") == false)
- {
- strHost = httpOrS + "://" + strHost;
- }
-
- if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
- {
- ((GeckoWebBrowser)wBrowser).Navigate(strHost);
- }
- else
- {
+ }
+ }
+ else
+ {
+ if (strHost.Contains(httpOrS + "://") == false)
+ {
+ strHost = httpOrS + "://" + strHost;
+ }
+
+ if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
+ {
+ ((GeckoWebBrowser)wBrowser).Navigate(strHost);
+ }
+ else
+ {
((WebBrowser)wBrowser).Navigate(strHost);
- }
- }
-
- base.Connect();
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpConnectFailed, ex);
- return false;
- }
- }
+ }
+ }
+
+ base.Connect();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpConnectFailed, ex);
+ return false;
+ }
+ }
+
#endregion
-
+
#region Private Methods
+
#endregion
-
+
#region Events
- private void wBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
- {
- var objWebBrowser = wBrowser as WebBrowser;
- if (objWebBrowser == null) return;
-
- // This can only be set once the WebBrowser control is shown, it will throw a COM exception otherwise.
- objWebBrowser.AllowWebBrowserDrop = false;
-
- objWebBrowser.Navigated -= wBrowser_Navigated;
- }
+
+ private void wBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
+ {
+ var objWebBrowser = wBrowser as WebBrowser;
+ if (objWebBrowser == null) return;
+
+ // This can only be set once the WebBrowser control is shown, it will throw a COM exception otherwise.
+ objWebBrowser.AllowWebBrowserDrop = false;
+
+ objWebBrowser.Navigated -= wBrowser_Navigated;
+ }
private void wBrowser_DocumentTitleChanged(object sender, EventArgs e)
- {
- try
- {
- var tabP = InterfaceControl.Parent as TabPage;
+ {
+ try
+ {
+ var tabP = InterfaceControl.Parent as TabPage;
- if (tabP == null) return;
- string shortTitle;
-
- if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
- {
- if (((GeckoWebBrowser) wBrowser).DocumentTitle.Length >= 15)
- {
- shortTitle = ((GeckoWebBrowser) wBrowser).DocumentTitle.Substring(0, 10) + "...";
- }
- else
- {
- shortTitle = ((GeckoWebBrowser) wBrowser).DocumentTitle;
- }
- }
- else
- {
- if (((WebBrowser) wBrowser).DocumentTitle.Length >= 15)
- {
- shortTitle = ((WebBrowser) wBrowser).DocumentTitle.Substring(0, 10) + "...";
- }
- else
- {
- shortTitle = ((WebBrowser) wBrowser).DocumentTitle;
- }
- }
-
- if (!string.IsNullOrEmpty(tabTitle))
- {
- tabP.Title = tabTitle + @" - " + shortTitle;
- }
- else
- {
- tabP.Title = shortTitle;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpDocumentTileChangeFailed, ex);
- }
- }
+ if (tabP == null) return;
+ string shortTitle;
+
+ if (InterfaceControl.Info.RenderingEngine == RenderingEngine.Gecko)
+ {
+ if (((GeckoWebBrowser)wBrowser).DocumentTitle.Length >= 15)
+ {
+ shortTitle = ((GeckoWebBrowser)wBrowser).DocumentTitle.Substring(0, 10) + "...";
+ }
+ else
+ {
+ shortTitle = ((GeckoWebBrowser)wBrowser).DocumentTitle;
+ }
+ }
+ else
+ {
+ if (((WebBrowser)wBrowser).DocumentTitle.Length >= 15)
+ {
+ shortTitle = ((WebBrowser)wBrowser).DocumentTitle.Substring(0, 10) + "...";
+ }
+ else
+ {
+ shortTitle = ((WebBrowser)wBrowser).DocumentTitle;
+ }
+ }
+
+ /* if (!string.IsNullOrEmpty(tabTitle))
+ {
+ tabP.Title = tabTitle + @" - " + shortTitle;
+ }
+ else
+ {
+ tabP.Title = shortTitle;
+ }*/
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpDocumentTileChangeFailed, ex);
+ }
+ }
private void geckoBrowser_DocumentTitleChanged(object sender, EventArgs e)
@@ -234,50 +239,53 @@ namespace mRemoteNG.Connection.Protocol.Http
{
if (((GeckoWebBrowser)wBrowser).DocumentTitle.Length >= 15)
{
- shortTitle = ((GeckoWebBrowser) wBrowser).DocumentTitle.Substring(0, 10) + "...";
+ shortTitle = ((GeckoWebBrowser)wBrowser).DocumentTitle.Substring(0, 10) + "...";
}
else
{
- shortTitle = ((GeckoWebBrowser) wBrowser).DocumentTitle;
+ shortTitle = ((GeckoWebBrowser)wBrowser).DocumentTitle;
}
}
else
{
- if (((WebBrowser) wBrowser).DocumentTitle.Length >= 15)
+ if (((WebBrowser)wBrowser).DocumentTitle.Length >= 15)
{
- shortTitle = ((WebBrowser) wBrowser).DocumentTitle.Substring(0, 10) + "...";
+ shortTitle = ((WebBrowser)wBrowser).DocumentTitle.Substring(0, 10) + "...";
}
else
{
- shortTitle = ((WebBrowser) wBrowser).DocumentTitle;
+ shortTitle = ((WebBrowser)wBrowser).DocumentTitle;
}
}
- if (!string.IsNullOrEmpty(tabTitle))
- {
- tabP.Title = tabTitle + @" - " + shortTitle;
- }
- else
- {
- tabP.Title = shortTitle;
- }
+ /* if (!string.IsNullOrEmpty(tabTitle))
+ {
+ tabP.Title = tabTitle + @" - " + shortTitle;
+ }
+ else
+ {
+ tabP.Title = shortTitle;
+ }*/
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpDocumentTileChangeFailed, ex);
}
}
-#endregion
-
-#region Enums
- public enum RenderingEngine
- {
+
+ #endregion
+
+ #region Enums
+
+ public enum RenderingEngine
+ {
[LocalizedAttributes.LocalizedDescription("strHttpInternetExplorer")]
IE = 1,
+
[LocalizedAttributes.LocalizedDescription("strHttpGecko")]
Gecko = 2
- }
+ }
-#endregion
- }
+ #endregion
+ }
}
diff --git a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.CertEvent.cs b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.CertEvent.cs
index 086d8b49..5e9f1322 100644
--- a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.CertEvent.cs
+++ b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.CertEvent.cs
@@ -4,6 +4,7 @@ using mRemoteNG.App;
using mRemoteNG.App.Info;
using mRemoteNG.Messages;
using mRemoteNG.UI.TaskDialog;
+
// ReSharper disable RedundantAssignment
namespace mRemoteNG.Connection.Protocol.Http
@@ -26,15 +27,17 @@ namespace mRemoteNG.Connection.Protocol.Http
string[] commandButtons =
{
- Language.strHttpsInsecureAllowOnce, // 0
- Language.strHttpsInsecureAllowAlways, // 1
- Language.strHttpsInsecureDontAllow // 2
+ Language.strHttpsInsecureAllowOnce, // 0
+ Language.strHttpsInsecureAllowAlways, // 1
+ Language.strHttpsInsecureDontAllow // 2
};
CTaskDialog.ShowTaskDialogBox(null, GeneralAppInfo.ProductName, Language.strHttpsInsecurePromptTitle,
- string.Format(Language.strHttpsInsecurePrompt, e.Uri.AbsoluteUri), "", "", "", "",
- string.Join(" | ", commandButtons), ETaskDialogButtons.None, ESysIcons.Question, ESysIcons.Question);
-
+ string.Format(Language.strHttpsInsecurePrompt, e.Uri.AbsoluteUri), "", "", "",
+ "",
+ string.Join(" | ", commandButtons), ETaskDialogButtons.None,
+ ESysIcons.Question, ESysIcons.Question);
+
var allow = false;
var temporary = true;
// ReSharper disable once SwitchStatementMissingSomeCases
@@ -53,10 +56,11 @@ namespace mRemoteNG.Connection.Protocol.Http
temporary = true; // just to be safe
break;
}
-
+
if (!allow)
{
- Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, $"User did not allow navigation to {e.Uri.AbsoluteUri} with an insecure certificate: {e.Message}");
+ Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
+ $"User did not allow navigation to {e.Uri.AbsoluteUri} with an insecure certificate: {e.Message}");
return;
}
@@ -65,10 +69,11 @@ namespace mRemoteNG.Connection.Protocol.Http
* However, my testing was successful in Gecko 45.0.22
*/
CertOverrideService.GetService().RememberValidityOverride(e.Uri, e.Certificate,
- CertOverride.Mismatch | CertOverride.Time | CertOverride.Untrusted, temporary);
+ CertOverride.Mismatch | CertOverride.Time |
+ CertOverride.Untrusted, temporary);
e.Handled = true;
((GeckoWebBrowser)sender).Navigate(e.Uri.AbsoluteUri);
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.cs b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.cs
index 08f28a92..90f35f5a 100644
--- a/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.cs
+++ b/mRemoteV1/Connection/Protocol/Http/Connection.Protocol.HTTPS.cs
@@ -1,17 +1,16 @@
namespace mRemoteNG.Connection.Protocol.Http
{
- public class ProtocolHTTPS : HTTPBase
- {
-
- public ProtocolHTTPS(RenderingEngine RenderingEngine) : base(RenderingEngine)
- {
+ public class ProtocolHTTPS : HTTPBase
+ {
+ public ProtocolHTTPS(RenderingEngine RenderingEngine) : base(RenderingEngine)
+ {
httpOrS = "https";
defaultPort = (int)Defaults.Port;
}
-
- public enum Defaults
- {
- Port = 443
- }
- }
-}
+
+ public enum Defaults
+ {
+ Port = 443
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/ICA/IcaProtocol.cs b/mRemoteV1/Connection/Protocol/ICA/IcaProtocol.cs
index 5096fbac..0522cc85 100644
--- a/mRemoteV1/Connection/Protocol/ICA/IcaProtocol.cs
+++ b/mRemoteV1/Connection/Protocol/ICA/IcaProtocol.cs
@@ -17,108 +17,116 @@ using mRemoteNG.Security;
namespace mRemoteNG.Connection.Protocol.ICA
{
public class IcaProtocol : ProtocolBase
- {
- private AxICAClient _icaClient;
- private ConnectionInfo _info;
+ {
+ private AxICAClient _icaClient;
+ private ConnectionInfo _info;
private readonly FrmMain _frmMain = FrmMain.Default;
-
- #region Public Methods
- public IcaProtocol()
- {
- try
- {
- Control = new AxICAClient();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaControlFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- public override bool Initialize()
- {
- base.Initialize();
-
- try
- {
- _icaClient = (AxICAClient)Control;
- _info = InterfaceControl.Info;
- _icaClient.CreateControl();
-
- while (!_icaClient.Created)
- {
- Thread.Sleep(10);
- Application.DoEvents();
- }
- _icaClient.Address = _info.Hostname;
- SetCredentials();
- SetResolution();
- SetColors();
- SetSecurity();
-
- //Disable hotkeys for international users
- _icaClient.Hotkey1Shift = null;
- _icaClient.Hotkey1Char = null;
- _icaClient.Hotkey2Shift = null;
- _icaClient.Hotkey2Char = null;
- _icaClient.Hotkey3Shift = null;
- _icaClient.Hotkey3Char = null;
- _icaClient.Hotkey4Shift = null;
- _icaClient.Hotkey4Char = null;
- _icaClient.Hotkey5Shift = null;
- _icaClient.Hotkey5Char = null;
- _icaClient.Hotkey6Shift = null;
- _icaClient.Hotkey6Char = null;
- _icaClient.Hotkey7Shift = null;
- _icaClient.Hotkey7Char = null;
- _icaClient.Hotkey8Shift = null;
- _icaClient.Hotkey8Char = null;
- _icaClient.Hotkey9Shift = null;
- _icaClient.Hotkey9Char = null;
- _icaClient.Hotkey10Shift = null;
- _icaClient.Hotkey10Char = null;
- _icaClient.Hotkey11Shift = null;
- _icaClient.Hotkey11Char = null;
-
- _icaClient.PersistentCacheEnabled = _info.CacheBitmaps;
- _icaClient.Title = _info.Name;
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaSetPropsFailed + Environment.NewLine + ex.Message, true);
- return false;
- }
- }
-
- public override bool Connect()
- {
- SetEventHandlers();
-
- try
- {
- _icaClient.Connect();
- base.Connect();
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaConnectionFailed + Environment.NewLine + ex.Message);
- return false;
- }
- }
+ #region Public Methods
+
+ public IcaProtocol()
+ {
+ try
+ {
+ Control = new AxICAClient();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaControlFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+ }
+
+ public override bool Initialize()
+ {
+ base.Initialize();
+
+ try
+ {
+ _icaClient = (AxICAClient)Control;
+ _info = InterfaceControl.Info;
+ _icaClient.CreateControl();
+
+ while (!_icaClient.Created)
+ {
+ Thread.Sleep(10);
+ Application.DoEvents();
+ }
+
+ _icaClient.Address = _info.Hostname;
+ SetCredentials();
+ SetResolution();
+ SetColors();
+ SetSecurity();
+
+ //Disable hotkeys for international users
+ _icaClient.Hotkey1Shift = null;
+ _icaClient.Hotkey1Char = null;
+ _icaClient.Hotkey2Shift = null;
+ _icaClient.Hotkey2Char = null;
+ _icaClient.Hotkey3Shift = null;
+ _icaClient.Hotkey3Char = null;
+ _icaClient.Hotkey4Shift = null;
+ _icaClient.Hotkey4Char = null;
+ _icaClient.Hotkey5Shift = null;
+ _icaClient.Hotkey5Char = null;
+ _icaClient.Hotkey6Shift = null;
+ _icaClient.Hotkey6Char = null;
+ _icaClient.Hotkey7Shift = null;
+ _icaClient.Hotkey7Char = null;
+ _icaClient.Hotkey8Shift = null;
+ _icaClient.Hotkey8Char = null;
+ _icaClient.Hotkey9Shift = null;
+ _icaClient.Hotkey9Char = null;
+ _icaClient.Hotkey10Shift = null;
+ _icaClient.Hotkey10Char = null;
+ _icaClient.Hotkey11Shift = null;
+ _icaClient.Hotkey11Char = null;
+
+ _icaClient.PersistentCacheEnabled = _info.CacheBitmaps;
+ _icaClient.Title = _info.Name;
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaSetPropsFailed + Environment.NewLine + ex.Message,
+ true);
+ return false;
+ }
+ }
+
+ public override bool Connect()
+ {
+ SetEventHandlers();
+
+ try
+ {
+ _icaClient.Connect();
+ base.Connect();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaConnectionFailed + Environment.NewLine + ex.Message);
+ return false;
+ }
+ }
+
#endregion
-
+
#region Private Methods
- private void SetCredentials()
- {
- try
- {
+
+ private void SetCredentials()
+ {
+ try
+ {
if (Force.HasFlag(ConnectionInfo.Force.NoCredentials))
- {
- return;
- }
+ {
+ return;
+ }
var cred = Runtime.CredentialService.GetEffectiveCredentialRecord(_info.CredentialRecordId
.FirstOrDefault()).FirstOrDefault();
@@ -127,229 +135,253 @@ namespace mRemoteNG.Connection.Protocol.ICA
var pass = cred.Password?.ConvertToUnsecureString() ?? "";
var dom = cred.Domain ?? "";
- if (string.IsNullOrEmpty(user))
- {
- if (Settings.Default.EmptyCredentials == "windows")
- {
- _icaClient.Username = Environment.UserName;
- }
- else if (Settings.Default.EmptyCredentials == "custom")
- {
+ if (string.IsNullOrEmpty(user))
+ {
+ if (Settings.Default.EmptyCredentials == "windows")
+ {
+ _icaClient.Username = Environment.UserName;
+ }
+ else if (Settings.Default.EmptyCredentials == "custom")
+ {
_icaClient.Username = Runtime.CredentialService.GetCredentialRecord(Settings.Default.DefaultCredentialRecord).Username;
- }
- }
- else
- {
- _icaClient.Username = user;
- }
-
- if (string.IsNullOrEmpty(pass))
- {
- if (Settings.Default.EmptyCredentials == "custom")
- {
+ }
+ }
+ else
+ {
+ _icaClient.Username = user;
+ }
+
+ if (string.IsNullOrEmpty(pass))
+ {
+ if (Settings.Default.EmptyCredentials == "custom")
+ {
var p = Runtime.CredentialService.GetCredentialRecord(Settings.Default.DefaultCredentialRecord).Password;
if (p.Length > 0)
- {
+ {
_icaClient.SetProp("ClearPassword", p.ConvertToUnsecureString());
- }
- }
- }
- else
- {
- _icaClient.SetProp("ClearPassword", pass);
- }
-
- if (string.IsNullOrEmpty(dom))
- {
- if (Settings.Default.EmptyCredentials == "windows")
- {
- _icaClient.Domain = Environment.UserDomainName;
- }
- else if (Settings.Default.EmptyCredentials == "custom")
- {
- _icaClient.Domain = Runtime.CredentialService.GetCredentialRecord(Settings.Default.DefaultCredentialRecord).Domain;
- }
- }
- else
- {
- _icaClient.Domain = dom;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaSetCredentialsFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- private void SetResolution()
- {
- try
- {
- if (Force.HasFlag(ConnectionInfo.Force.Fullscreen))
- {
- _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, Screen.FromControl(_frmMain).Bounds.Width, Screen.FromControl(_frmMain).Bounds.Height, 0);
- _icaClient.FullScreenWindow();
-
- return;
- }
-
- if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.FitToWindow)
- {
- _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width, InterfaceControl.Size.Height, 0);
- }
- else if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.SmartSize)
- {
- _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width, InterfaceControl.Size.Height, 0);
- }
- else if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.Fullscreen)
- {
- _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, Screen.FromControl(_frmMain).Bounds.Width, Screen.FromControl(_frmMain).Bounds.Height, 0);
- _icaClient.FullScreenWindow();
- }
- else
- {
- var resolution = RdpProtocol.GetResolutionRectangle(_info.Resolution);
- _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, resolution.Width, resolution.Height, 0);
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaSetResolutionFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- private void SetColors()
- {
- // ReSharper disable once SwitchStatementMissingSomeCases
- switch (_info.Colors)
- {
- case RdpProtocol.RDPColors.Colors256:
- _icaClient.SetProp("DesiredColor", "2");
- break;
- case RdpProtocol.RDPColors.Colors15Bit:
- _icaClient.SetProp("DesiredColor", "4");
- break;
- case RdpProtocol.RDPColors.Colors16Bit:
- _icaClient.SetProp("DesiredColor", "4");
- break;
- default:
- _icaClient.SetProp("DesiredColor", "8");
- break;
- }
- }
-
- private void SetSecurity()
- {
- // ReSharper disable once SwitchStatementMissingSomeCases
- switch (_info.ICAEncryptionStrength)
- {
- case EncryptionStrength.Encr128BitLogonOnly:
- _icaClient.Encrypt = true;
- _icaClient.EncryptionLevelSession = "EncRC5-0";
- break;
- case EncryptionStrength.Encr40Bit:
- _icaClient.Encrypt = true;
- _icaClient.EncryptionLevelSession = "EncRC5-40";
- break;
- case EncryptionStrength.Encr56Bit:
- _icaClient.Encrypt = true;
- _icaClient.EncryptionLevelSession = "EncRC5-56";
- break;
- case EncryptionStrength.Encr128Bit:
- _icaClient.Encrypt = true;
- _icaClient.EncryptionLevelSession = "EncRC5-128";
- break;
- }
- }
-
- private void SetEventHandlers()
- {
- try
- {
- _icaClient.OnConnecting += ICAEvent_OnConnecting;
- _icaClient.OnConnect += ICAEvent_OnConnected;
- _icaClient.OnConnectFailed += ICAEvent_OnConnectFailed;
- _icaClient.OnDisconnect += ICAEvent_OnDisconnect;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strIcaSetEventHandlersFailed + Environment.NewLine + ex.Message, true);
- }
- }
- #endregion
-
- #region Private Events & Handlers
- private void ICAEvent_OnConnecting(object sender, EventArgs e)
- {
- Event_Connecting(this);
- }
-
- private void ICAEvent_OnConnected(object sender, EventArgs e)
- {
- Event_Connected(this);
- }
-
- private void ICAEvent_OnConnectFailed(object sender, EventArgs e)
- {
- Event_ErrorOccured(this, e.ToString(), null);
- }
-
- private void ICAEvent_OnDisconnect(object sender, EventArgs e)
- {
- Event_Disconnected(this, e.ToString(), null);
-
- if (Settings.Default.ReconnectOnDisconnect)
- {
- ReconnectGroup = new ReconnectGroup();
- //this.Load += ReconnectGroup_Load;
- ReconnectGroup.Left = (int) (((double) Control.Width / 2) - ((double) ReconnectGroup.Width / 2));
- ReconnectGroup.Top = (int) (((double) Control.Height / 2) - ((double) ReconnectGroup.Height / 2));
- ReconnectGroup.Parent = Control;
- ReconnectGroup.Show();
- tmrReconnect.Enabled = true;
- }
- else
- {
- Close();
- }
- }
- #endregion
-
- #region Reconnect Stuff
- public void tmrReconnect_Elapsed(object sender, ElapsedEventArgs e)
- {
- var srvReady = PortScanner.IsPortOpen(_info.Hostname, Convert.ToString(_info.Port));
-
- ReconnectGroup.ServerReady = srvReady;
+ }
+ }
+ }
+ else
+ {
+ _icaClient.SetProp("ClearPassword", pass);
+ }
+
+ if (string.IsNullOrEmpty(dom))
+ {
+ if (Settings.Default.EmptyCredentials == "windows")
+ {
+ _icaClient.Domain = Environment.UserDomainName;
+ }
+ else if (Settings.Default.EmptyCredentials == "custom")
+ {
+ _icaClient.Domain = Runtime.CredentialService.GetCredentialRecord(Settings.Default.DefaultCredentialRecord).Domain;
+ }
+ }
+ else
+ {
+ _icaClient.Domain = dom;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaSetCredentialsFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ private void SetResolution()
+ {
+ try
+ {
+ if (Force.HasFlag(ConnectionInfo.Force.Fullscreen))
+ {
+ _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient,
+ Screen.FromControl(_frmMain).Bounds.Width,
+ Screen.FromControl(_frmMain).Bounds.Height, 0);
+ _icaClient.FullScreenWindow();
+
+ return;
+ }
+
+ if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.FitToWindow)
+ {
+ _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width,
+ InterfaceControl.Size.Height, 0);
+ }
+ else if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.SmartSize)
+ {
+ _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, InterfaceControl.Size.Width,
+ InterfaceControl.Size.Height, 0);
+ }
+ else if (InterfaceControl.Info.Resolution == RdpProtocol.RDPResolutions.Fullscreen)
+ {
+ _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient,
+ Screen.FromControl(_frmMain).Bounds.Width,
+ Screen.FromControl(_frmMain).Bounds.Height, 0);
+ _icaClient.FullScreenWindow();
+ }
+ else
+ {
+ var resolution = RdpProtocol.GetResolutionRectangle(_info.Resolution);
+ _icaClient.SetWindowSize(WFICALib.ICAWindowType.WindowTypeClient, resolution.Width,
+ resolution.Height, 0);
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaSetResolutionFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ private void SetColors()
+ {
+ // ReSharper disable once SwitchStatementMissingSomeCases
+ switch (_info.Colors)
+ {
+ case RdpProtocol.RDPColors.Colors256:
+ _icaClient.SetProp("DesiredColor", "2");
+ break;
+ case RdpProtocol.RDPColors.Colors15Bit:
+ _icaClient.SetProp("DesiredColor", "4");
+ break;
+ case RdpProtocol.RDPColors.Colors16Bit:
+ _icaClient.SetProp("DesiredColor", "4");
+ break;
+ default:
+ _icaClient.SetProp("DesiredColor", "8");
+ break;
+ }
+ }
+
+ private void SetSecurity()
+ {
+ // ReSharper disable once SwitchStatementMissingSomeCases
+ switch (_info.ICAEncryptionStrength)
+ {
+ case EncryptionStrength.Encr128BitLogonOnly:
+ _icaClient.Encrypt = true;
+ _icaClient.EncryptionLevelSession = "EncRC5-0";
+ break;
+ case EncryptionStrength.Encr40Bit:
+ _icaClient.Encrypt = true;
+ _icaClient.EncryptionLevelSession = "EncRC5-40";
+ break;
+ case EncryptionStrength.Encr56Bit:
+ _icaClient.Encrypt = true;
+ _icaClient.EncryptionLevelSession = "EncRC5-56";
+ break;
+ case EncryptionStrength.Encr128Bit:
+ _icaClient.Encrypt = true;
+ _icaClient.EncryptionLevelSession = "EncRC5-128";
+ break;
+ }
+ }
+
+ private void SetEventHandlers()
+ {
+ try
+ {
+ _icaClient.OnConnecting += ICAEvent_OnConnecting;
+ _icaClient.OnConnect += ICAEvent_OnConnected;
+ _icaClient.OnConnectFailed += ICAEvent_OnConnectFailed;
+ _icaClient.OnDisconnect += ICAEvent_OnDisconnect;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strIcaSetEventHandlersFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
- if (!ReconnectGroup.ReconnectWhenReady || !srvReady) return;
- tmrReconnect.Enabled = false;
- ReconnectGroup.DisposeReconnectGroup();
- _icaClient.Connect();
- }
#endregion
-
+
+ #region Private Events & Handlers
+
+ private void ICAEvent_OnConnecting(object sender, EventArgs e)
+ {
+ Event_Connecting(this);
+ }
+
+ private void ICAEvent_OnConnected(object sender, EventArgs e)
+ {
+ Event_Connected(this);
+ }
+
+ private void ICAEvent_OnConnectFailed(object sender, EventArgs e)
+ {
+ Event_ErrorOccured(this, e.ToString(), null);
+ }
+
+ private void ICAEvent_OnDisconnect(object sender, EventArgs e)
+ {
+ Event_Disconnected(this, e.ToString(), null);
+
+ if (Settings.Default.ReconnectOnDisconnect)
+ {
+ ReconnectGroup = new ReconnectGroup();
+ //this.Load += ReconnectGroup_Load;
+ ReconnectGroup.Left = (int)(((double)Control.Width / 2) - ((double)ReconnectGroup.Width / 2));
+ ReconnectGroup.Top = (int)(((double)Control.Height / 2) - ((double)ReconnectGroup.Height / 2));
+ ReconnectGroup.Parent = Control;
+ ReconnectGroup.Show();
+ tmrReconnect.Enabled = true;
+ }
+ else
+ {
+ Close();
+ }
+ }
+
+ #endregion
+
+ #region Reconnect Stuff
+
+ public void tmrReconnect_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ var srvReady = PortScanner.IsPortOpen(_info.Hostname, Convert.ToString(_info.Port));
+
+ ReconnectGroup.ServerReady = srvReady;
+
+ if (!ReconnectGroup.ReconnectWhenReady || !srvReady) return;
+ tmrReconnect.Enabled = false;
+ ReconnectGroup.DisposeReconnectGroup();
+ _icaClient.Connect();
+ }
+
+ #endregion
+
#region Enums
- public enum Defaults
- {
- Port = 1494,
- EncryptionStrength = 0
- }
-
- public enum EncryptionStrength
- {
+
+ public enum Defaults
+ {
+ Port = 1494,
+ EncryptionStrength = 0
+ }
+
+ public enum EncryptionStrength
+ {
[LocalizedAttributes.LocalizedDescription("strEncBasic")]
EncrBasic = 1,
+
[LocalizedAttributes.LocalizedDescription("strEnc128BitLogonOnly")]
Encr128BitLogonOnly = 127,
+
[LocalizedAttributes.LocalizedDescription("strEnc40Bit")]
Encr40Bit = 40,
+
[LocalizedAttributes.LocalizedDescription("strEnc56Bit")]
Encr56Bit = 56,
+
[LocalizedAttributes.LocalizedDescription("strEnc128Bit")]
Encr128Bit = 128
- }
+ }
+
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/IntegratedProgram.cs b/mRemoteV1/Connection/Protocol/IntegratedProgram.cs
index 2954ee32..afe463da 100644
--- a/mRemoteV1/Connection/Protocol/IntegratedProgram.cs
+++ b/mRemoteV1/Connection/Protocol/IntegratedProgram.cs
@@ -10,175 +10,198 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol
{
- public class IntegratedProgram : ProtocolBase
- {
+ public class IntegratedProgram : ProtocolBase
+ {
#region Private Fields
+
private ExternalTool _externalTool;
private IntPtr _handle;
private Process _process;
+
#endregion
#region Public Methods
- public override bool Initialize()
- {
- if (InterfaceControl.Info == null)
- return base.Initialize();
- _externalTool = Runtime.ExternalToolsService.GetExtAppByName(InterfaceControl.Info.ExtApp);
+ public override bool Initialize()
+ {
+ if (InterfaceControl.Info == null)
+ return base.Initialize();
- if (_externalTool == null)
- {
- Runtime.MessageCollector?.AddMessage(MessageClass.ErrorMsg, string.Format(Language.CouldNotFindExternalTool, InterfaceControl.Info.ExtApp));
- return false;
- }
+ _externalTool = Runtime.ExternalToolsService.GetExtAppByName(InterfaceControl.Info.ExtApp);
- _externalTool.ConnectionInfo = InterfaceControl.Info;
+ if (_externalTool == null)
+ {
+ Runtime.MessageCollector?.AddMessage(MessageClass.ErrorMsg,
+ string.Format(Language.CouldNotFindExternalTool,
+ InterfaceControl.Info.ExtApp));
+ return false;
+ }
- return base.Initialize();
- }
-
- public override bool Connect()
- {
- try
- {
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, $"Attempting to start: {_externalTool.DisplayName}", true);
+ _externalTool.ConnectionInfo = InterfaceControl.Info;
+
+ return base.Initialize();
+ }
+
+ public override bool Connect()
+ {
+ try
+ {
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
+ $"Attempting to start: {_externalTool.DisplayName}", true);
if (_externalTool.TryIntegrate == false)
- {
- _externalTool.Start(InterfaceControl.Info);
+ {
+ _externalTool.Start(InterfaceControl.Info);
/* Don't call close here... There's nothing for the override to do in this case since
* _process is not created in this scenario. When returning false, ProtocolBase.Close()
* will be called - which is just going to call IntegratedProgram.Close() again anyway...
* Close();
*/
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, $"Assuming no other errors/exceptions occurred immediately before this message regarding {_externalTool.DisplayName}, the next \"closed by user\" message can be ignored", true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
+ $"Assuming no other errors/exceptions occurred immediately before this message regarding {_externalTool.DisplayName}, the next \"closed by user\" message can be ignored",
+ true);
return false;
- }
+ }
var argParser = new ExternalToolArgumentParser(_externalTool.ConnectionInfo, Runtime.CredentialService);
- _process = new Process
- {
- StartInfo =
- {
- UseShellExecute = true,
- FileName = argParser.ParseArguments(_externalTool.FileName),
- Arguments = argParser.ParseArguments(_externalTool.Arguments)
- },
- EnableRaisingEvents = true
- };
+ _process = new Process
+ {
+ StartInfo =
+ {
+ UseShellExecute = true,
+ FileName = argParser.ParseArguments(_externalTool.FileName),
+ Arguments = argParser.ParseArguments(_externalTool.Arguments)
+ },
+ EnableRaisingEvents = true
+ };
- _process.Exited += ProcessExited;
-
- _process.Start();
+ _process.Exited += ProcessExited;
+
+ _process.Start();
_process.WaitForInputIdle(Settings.Default.MaxPuttyWaitTime * 1000);
var startTicks = Environment.TickCount;
- while (_handle.ToInt32() == 0 & Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
- {
- _process.Refresh();
- if (_process.MainWindowTitle != "Default IME")
- {
- _handle = _process.MainWindowHandle;
- }
- if (_handle.ToInt32() == 0)
- {
- Thread.Sleep(0);
- }
- }
-
- NativeMethods.SetParent(_handle, InterfaceControl.Handle);
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, Language.strIntAppStuff, true);
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppHandle, _handle), true);
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppTitle, _process.MainWindowTitle), true);
- Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, string.Format(Language.strIntAppParentHandle, InterfaceControl.Parent.Handle), true);
-
- Resize(this, new EventArgs());
- base.Connect();
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector?.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
- return false;
- }
- }
-
- public override void Focus()
- {
- try
- {
- if (ConnectionWindow.InTabDrag) return;
- NativeMethods.SetForegroundWindow(_handle);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppFocusFailed, ex);
- }
- }
+ while (_handle.ToInt32() == 0 &
+ Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
+ {
+ _process.Refresh();
+ if (_process.MainWindowTitle != "Default IME")
+ {
+ _handle = _process.MainWindowHandle;
+ }
- protected override void Resize(object sender, EventArgs e)
- {
- try
- {
- if (InterfaceControl.Size == Size.Empty) return;
- NativeMethods.MoveWindow(_handle, -SystemInformation.FrameBorderSize.Width, -(SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height), InterfaceControl.Width + SystemInformation.FrameBorderSize.Width * 2, InterfaceControl.Height + SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height * 2, true);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppResizeFailed, ex);
- }
- }
-
- public override void Close()
- {
+ if (_handle.ToInt32() == 0)
+ {
+ Thread.Sleep(0);
+ }
+ }
+
+ NativeMethods.SetParent(_handle, InterfaceControl.Handle);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg, Language.strIntAppStuff, true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strIntAppHandle, _handle), true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strIntAppTitle, _process.MainWindowTitle),
+ true);
+ Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strIntAppParentHandle,
+ InterfaceControl.Parent.Handle), true);
+
+ Resize(this, new EventArgs());
+ base.Connect();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector?.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
+ return false;
+ }
+ }
+
+ public override void Focus()
+ {
+ try
+ {
+ NativeMethods.SetForegroundWindow(_handle);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppFocusFailed, ex);
+ }
+ }
+
+ public override void Resize(object sender, EventArgs e)
+ {
+ try
+ {
+ if (InterfaceControl.Size == Size.Empty) return;
+ NativeMethods.MoveWindow(_handle, -SystemInformation.FrameBorderSize.Width,
+ -(SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height),
+ InterfaceControl.Width + SystemInformation.FrameBorderSize.Width * 2,
+ InterfaceControl.Height + SystemInformation.CaptionHeight +
+ SystemInformation.FrameBorderSize.Height * 2, true);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppResizeFailed, ex);
+ }
+ }
+
+ public override void Close()
+ {
/* only attempt this if we have a valid process object
- * Non-integated tools will still call base.Close() and don't have a valid process object.
+ * Non-integrated tools will still call base.Close() and don't have a valid process object.
* See Connect() above... This just muddies up the log.
*/
if (_process != null)
- {
- try
- {
- if (!_process.HasExited)
- {
- _process.Kill();
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppKillFailed, ex);
- }
+ {
+ try
+ {
+ if (!_process.HasExited)
+ {
+ _process.Kill();
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppKillFailed, ex);
+ }
- try
- {
- if (!_process.HasExited)
- {
- _process.Dispose();
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppDisposeFailed, ex);
- }
- }
+ try
+ {
+ if (!_process.HasExited)
+ {
+ _process.Dispose();
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(Language.strIntAppDisposeFailed, ex);
+ }
+ }
+
+ base.Close();
+ }
- base.Close();
- }
#endregion
-
+
#region Private Methods
- private void ProcessExited(object sender, EventArgs e)
- {
- Event_Closed(this);
- }
+
+ private void ProcessExited(object sender, EventArgs e)
+ {
+ Event_Closed(this);
+ }
+
#endregion
-
+
#region Enumerations
- public enum Defaults
- {
- Port = 0
- }
+
+ public enum Defaults
+ {
+ Port = 0
+ }
+
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/ProtocolBase.cs b/mRemoteV1/Connection/Protocol/ProtocolBase.cs
index 3cb14011..a9c9023d 100644
--- a/mRemoteV1/Connection/Protocol/ProtocolBase.cs
+++ b/mRemoteV1/Connection/Protocol/ProtocolBase.cs
@@ -3,58 +3,64 @@ using mRemoteNG.Tools;
using System;
using System.Threading;
using System.Windows.Forms;
-using mRemoteNG.Credential;
+using mRemoteNG.UI.Tabs;
+// ReSharper disable UnusedMember.Local
namespace mRemoteNG.Connection.Protocol
{
- public abstract class ProtocolBase: IDisposable
+ public abstract class ProtocolBase
{
#region Private Variables
- private UI.Window.ConnectionWindow _connectionWindow;
+ private ConnectionTab _connectionTab;
private InterfaceControl _interfaceControl;
- private ConnectingEventHandler ConnectingEvent;
+ private ConnectingEventHandler ConnectingEvent;
private ConnectedEventHandler ConnectedEvent;
private DisconnectedEventHandler DisconnectedEvent;
private ErrorOccuredEventHandler ErrorOccuredEvent;
private ClosingEventHandler ClosingEvent;
private ClosedEventHandler ClosedEvent;
+
#endregion
#region Public Properties
+
#region Control
+
private string Name { get; }
- protected UI.Window.ConnectionWindow ConnectionWindow
- {
- get => _connectionWindow;
- private set
- {
- _connectionWindow = value;
- _connectionWindow.ResizeBegin += ResizeBegin;
- _connectionWindow.Resize += Resize;
- _connectionWindow.ResizeEnd += ResizeEnd;
- }
- }
+ private ConnectionTab ConnectionTab
+ {
+ get => _connectionTab;
+ set
+ {
+ _connectionTab = value;
+ _connectionTab.ResizeBegin += ResizeBegin;
+ _connectionTab.Resize += Resize;
+ _connectionTab.ResizeEnd += ResizeEnd;
+ }
+ }
public InterfaceControl InterfaceControl
- {
- get => _interfaceControl;
+ {
+ get => _interfaceControl;
set
- {
- _interfaceControl = value;
- ConnectionWindow = _interfaceControl.GetContainerControl() as UI.Window.ConnectionWindow;
- }
- }
+ {
+ _interfaceControl = value;
+
+ if (_interfaceControl.Parent is ConnectionTab ct)
+ ConnectionTab = ct;
+ }
+ }
protected Control Control { get; set; }
- #endregion
+ #endregion
public ConnectionInfo.Force Force { get; set; }
- public readonly System.Timers.Timer tmrReconnect = new System.Timers.Timer(2000);
+ public readonly System.Timers.Timer tmrReconnect = new System.Timers.Timer(2000);
protected ReconnectGroup ReconnectGroup;
protected ProtocolBase(string name)
@@ -69,254 +75,260 @@ namespace mRemoteNG.Connection.Protocol
#endregion
#region Methods
+
//public abstract int GetDefaultPort();
public virtual void Focus()
- {
- try
- {
- Control.Focus();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace("Couldn't focus Control (Connection.Protocol.Base)", ex);
- }
- }
-
- protected virtual void ResizeBegin(object sender, EventArgs e)
- {
- }
-
- protected virtual void Resize(object sender, EventArgs e)
- {
- }
-
- protected virtual void ResizeEnd(object sender, EventArgs e)
- {
- }
-
- public virtual bool Initialize()
- {
- try
- {
- _interfaceControl.Parent.Tag = _interfaceControl;
- _interfaceControl.Show();
-
- if (Control == null) return true;
- Control.Name = Name;
- Control.Parent = _interfaceControl;
- Control.Location = _interfaceControl.Location;
- Control.Size = InterfaceControl.Size;
- Control.Anchor = _interfaceControl.Anchor;
-
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace("Couldn't SetProps (Connection.Protocol.Base)", ex);
- return false;
- }
- }
-
- public virtual bool Connect()
- {
- if (InterfaceControl.Info.Protocol == ProtocolType.RDP) return false;
- if (ConnectedEvent == null) return false;
- ConnectedEvent(this);
- return true;
- }
-
- public virtual void Disconnect()
- {
- Close();
- }
-
- public virtual void Close()
- {
- var t = new Thread(CloseBG);
- t.SetApartmentState(ApartmentState.STA);
- t.IsBackground = true;
- t.Start();
- }
-
- private void CloseBG()
- {
- ClosedEvent?.Invoke(this);
- try
- {
- tmrReconnect.Enabled = false;
-
- if (Control != null)
- {
- try
- {
- DisposeControl();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't dispose control, probably form is already closed (Connection.Protocol.Base)", ex);
- }
- }
-
- if (_interfaceControl == null) return;
-
- try
- {
- if (_interfaceControl.Parent == null) return;
-
- if (_interfaceControl.Parent.Tag != null)
- {
- SetTagToNothing();
- }
-
- DisposeInterface();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't set InterfaceControl.Parent.Tag or Dispose Interface, probably form is already closed (Connection.Protocol.Base)", ex);
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector?.AddExceptionStackTrace("Couldn't Close InterfaceControl BG (Connection.Protocol.Base)", ex);
- }
- }
-
- private delegate void DisposeInterfaceCB();
- private void DisposeInterface()
- {
- if (_interfaceControl.InvokeRequired)
- {
- var s = new DisposeInterfaceCB(DisposeInterface);
- _interfaceControl.Invoke(s);
- }
- else
- {
- _interfaceControl.Dispose();
- }
- }
-
- private delegate void SetTagToNothingCB();
- private void SetTagToNothing()
- {
- if (_interfaceControl.Parent.InvokeRequired)
- {
- var s = new SetTagToNothingCB(SetTagToNothing);
- _interfaceControl.Parent.Invoke(s);
- }
- else
- {
- _interfaceControl.Parent.Tag = null;
- }
- }
-
- private delegate void DisposeControlCB();
- private void DisposeControl()
- {
- if (Control.InvokeRequired)
- {
- var s = new DisposeControlCB(DisposeControl);
- Control.Invoke(s);
- }
- else
- {
- Control.Dispose();
- }
- }
-
- protected virtual void Dispose(bool disposing)
{
- if (disposing)
+ try
{
- tmrReconnect.Dispose();
+ Control.Focus();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace("Couldn't focus Control (Connection.Protocol.Base)",
+ ex);
}
}
- public void Dispose()
+ public virtual void ResizeBegin(object sender, EventArgs e)
{
- Dispose(true);
- GC.SuppressFinalize(this);
}
+
+ public virtual void Resize(object sender, EventArgs e)
+ {
+ }
+
+ public virtual void ResizeEnd(object sender, EventArgs e)
+ {
+ }
+
+ public virtual bool Initialize()
+ {
+ try
+ {
+ _interfaceControl.Parent.Tag = _interfaceControl;
+ _interfaceControl.Show();
+
+ if (Control == null) return true;
+ Control.Name = Name;
+ Control.Parent = _interfaceControl;
+ Control.Location = _interfaceControl.Location;
+ Control.Size = InterfaceControl.Size;
+ Control.Anchor = _interfaceControl.Anchor;
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace("Couldn't SetProps (Connection.Protocol.Base)", ex);
+ return false;
+ }
+ }
+
+ public virtual bool Connect()
+ {
+ if (InterfaceControl.Info.Protocol == ProtocolType.RDP) return false;
+ if (ConnectedEvent == null) return false;
+ ConnectedEvent(this);
+ return true;
+ }
+
+ public virtual void Disconnect()
+ {
+ Close();
+ }
+
+ public virtual void Close()
+ {
+ var t = new Thread(CloseBG);
+ t.SetApartmentState(ApartmentState.STA);
+ t.IsBackground = true;
+ t.Start();
+ }
+
+ private void CloseBG()
+ {
+ ClosedEvent?.Invoke(this);
+ try
+ {
+ tmrReconnect.Enabled = false;
+
+ if (Control != null)
+ {
+ try
+ {
+ DisposeControl();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector?.AddExceptionStackTrace(
+ "Couldn't dispose control, probably form is already closed (Connection.Protocol.Base)",
+ ex);
+ }
+ }
+
+ if (_interfaceControl == null) return;
+
+ try
+ {
+ if (_interfaceControl.Parent == null) return;
+
+ if (_interfaceControl.Parent.Tag != null)
+ {
+ SetTagToNothing();
+ }
+
+ DisposeInterface();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector?.AddExceptionStackTrace(
+ "Couldn't set InterfaceControl.Parent.Tag or Dispose Interface, probably form is already closed (Connection.Protocol.Base)",
+ ex);
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector?.AddExceptionStackTrace(
+ "Couldn't Close InterfaceControl BG (Connection.Protocol.Base)",
+ ex);
+ }
+ }
+
+ private delegate void DisposeInterfaceCB();
+
+ private void DisposeInterface()
+ {
+ if (_interfaceControl.InvokeRequired)
+ {
+ var s = new DisposeInterfaceCB(DisposeInterface);
+ _interfaceControl.Invoke(s);
+ }
+ else
+ {
+ _interfaceControl.Dispose();
+ }
+ }
+
+ private delegate void SetTagToNothingCB();
+
+ private void SetTagToNothing()
+ {
+ if (_interfaceControl.Parent.InvokeRequired)
+ {
+ var s = new SetTagToNothingCB(SetTagToNothing);
+ _interfaceControl.Parent.Invoke(s);
+ }
+ else
+ {
+ _interfaceControl.Parent.Tag = null;
+ }
+ }
+
+ private delegate void DisposeControlCB();
+
+ private void DisposeControl()
+ {
+ if (Control.InvokeRequired)
+ {
+ var s = new DisposeControlCB(DisposeControl);
+ Control.Invoke(s);
+ }
+ else
+ {
+ Control.Dispose();
+ }
+ }
+
#endregion
#region Events
+
public delegate void ConnectingEventHandler(object sender);
- public event ConnectingEventHandler Connecting
- {
- add => ConnectingEvent = (ConnectingEventHandler) Delegate.Combine(ConnectingEvent, value);
- remove => ConnectingEvent = (ConnectingEventHandler) Delegate.Remove(ConnectingEvent, value);
- }
-
- public delegate void ConnectedEventHandler(object sender);
- public event ConnectedEventHandler Connected
- {
- add => ConnectedEvent = (ConnectedEventHandler) Delegate.Combine(ConnectedEvent, value);
- remove => ConnectedEvent = (ConnectedEventHandler) Delegate.Remove(ConnectedEvent, value);
- }
-
- public delegate void DisconnectedEventHandler(object sender, string disconnectedMessage, int? reasonCode);
- public event DisconnectedEventHandler Disconnected
- {
- add => DisconnectedEvent = (DisconnectedEventHandler) Delegate.Combine(DisconnectedEvent, value);
- remove => DisconnectedEvent = (DisconnectedEventHandler) Delegate.Remove(DisconnectedEvent, value);
- }
-
- public delegate void ErrorOccuredEventHandler(object sender, string errorMessage, int? errorCode);
- public event ErrorOccuredEventHandler ErrorOccured
- {
- add => ErrorOccuredEvent = (ErrorOccuredEventHandler) Delegate.Combine(ErrorOccuredEvent, value);
- remove => ErrorOccuredEvent = (ErrorOccuredEventHandler) Delegate.Remove(ErrorOccuredEvent, value);
- }
-
- public delegate void ClosingEventHandler(object sender);
- public event ClosingEventHandler Closing
- {
- add => ClosingEvent = (ClosingEventHandler) Delegate.Combine(ClosingEvent, value);
- remove => ClosingEvent = (ClosingEventHandler) Delegate.Remove(ClosingEvent, value);
- }
-
- public delegate void ClosedEventHandler(object sender);
- public event ClosedEventHandler Closed
- {
- add => ClosedEvent = (ClosedEventHandler) Delegate.Combine(ClosedEvent, value);
- remove => ClosedEvent = (ClosedEventHandler) Delegate.Remove(ClosedEvent, value);
- }
-
-
- public void Event_Closing(object sender)
- {
- ClosingEvent?.Invoke(sender);
- }
- protected void Event_Closed(object sender)
- {
- ClosedEvent?.Invoke(sender);
- }
+ public event ConnectingEventHandler Connecting
+ {
+ add => ConnectingEvent = (ConnectingEventHandler)Delegate.Combine(ConnectingEvent, value);
+ remove => ConnectingEvent = (ConnectingEventHandler)Delegate.Remove(ConnectingEvent, value);
+ }
- protected void Event_Connecting(object sender)
- {
- ConnectingEvent?.Invoke(sender);
- }
+ public delegate void ConnectedEventHandler(object sender);
- protected void Event_Connected(object sender)
- {
- ConnectedEvent?.Invoke(sender);
- }
+ public event ConnectedEventHandler Connected
+ {
+ add => ConnectedEvent = (ConnectedEventHandler)Delegate.Combine(ConnectedEvent, value);
+ remove => ConnectedEvent = (ConnectedEventHandler)Delegate.Remove(ConnectedEvent, value);
+ }
- protected void Event_Disconnected(object sender, string disconnectedMessage, int? reasonCode)
- {
- DisconnectedEvent?.Invoke(sender, disconnectedMessage, reasonCode);
- }
+ public delegate void DisconnectedEventHandler(object sender, string disconnectedMessage, int? reasonCode);
- protected void Event_ErrorOccured(object sender, string errorMsg, int? errorCode)
- {
- ErrorOccuredEvent?.Invoke(sender, errorMsg, errorCode);
- }
+ public event DisconnectedEventHandler Disconnected
+ {
+ add => DisconnectedEvent = (DisconnectedEventHandler)Delegate.Combine(DisconnectedEvent, value);
+ remove => DisconnectedEvent = (DisconnectedEventHandler)Delegate.Remove(DisconnectedEvent, value);
+ }
+
+ public delegate void ErrorOccuredEventHandler(object sender, string errorMessage, int? errorCode);
+
+ public event ErrorOccuredEventHandler ErrorOccured
+ {
+ add => ErrorOccuredEvent = (ErrorOccuredEventHandler)Delegate.Combine(ErrorOccuredEvent, value);
+ remove => ErrorOccuredEvent = (ErrorOccuredEventHandler)Delegate.Remove(ErrorOccuredEvent, value);
+ }
+
+ public delegate void ClosingEventHandler(object sender);
+
+ public event ClosingEventHandler Closing
+ {
+ add => ClosingEvent = (ClosingEventHandler)Delegate.Combine(ClosingEvent, value);
+ remove => ClosingEvent = (ClosingEventHandler)Delegate.Remove(ClosingEvent, value);
+ }
+
+ public delegate void ClosedEventHandler(object sender);
+
+ public event ClosedEventHandler Closed
+ {
+ add => ClosedEvent = (ClosedEventHandler)Delegate.Combine(ClosedEvent, value);
+ remove => ClosedEvent = (ClosedEventHandler)Delegate.Remove(ClosedEvent, value);
+ }
+
+
+ public void Event_Closing(object sender)
+ {
+ ClosingEvent?.Invoke(sender);
+ }
+
+ protected void Event_Closed(object sender)
+ {
+ ClosedEvent?.Invoke(sender);
+ }
+
+ protected void Event_Connecting(object sender)
+ {
+ ConnectingEvent?.Invoke(sender);
+ }
+
+ protected void Event_Connected(object sender)
+ {
+ ConnectedEvent?.Invoke(sender);
+ }
+
+ protected void Event_Disconnected(object sender, string disconnectedMessage, int? reasonCode)
+ {
+ DisconnectedEvent?.Invoke(sender, disconnectedMessage, reasonCode);
+ }
+
+ protected void Event_ErrorOccured(object sender, string errorMsg, int? errorCode)
+ {
+ ErrorOccuredEvent?.Invoke(sender, errorMsg, errorCode);
+ }
+
+ protected void Event_ReconnectGroupCloseClicked()
+ {
+ Close();
+ }
- protected void Event_ReconnectGroupCloseClicked()
- {
- Close();
- }
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/ProtocolFactory.cs b/mRemoteV1/Connection/Protocol/ProtocolFactory.cs
index c4f6ca99..6c7611f1 100644
--- a/mRemoteV1/Connection/Protocol/ProtocolFactory.cs
+++ b/mRemoteV1/Connection/Protocol/ProtocolFactory.cs
@@ -16,51 +16,53 @@ namespace mRemoteNG.Connection.Protocol
{
var newProtocol = default(ProtocolBase);
// ReSharper disable once SwitchStatementMissingSomeCases
- switch (connectionInfo.Protocol)
- {
- case ProtocolType.RDP:
- newProtocol = new RdpProtocol
- {
- LoadBalanceInfoUseUtf8 = Settings.Default.RdpLoadBalanceInfoUseUtf8
+ switch (connectionInfo.Protocol)
+ {
+ case ProtocolType.RDP:
+ newProtocol = new RdpProtocol
+ {
+ LoadBalanceInfoUseUtf8 = Settings.Default.RdpLoadBalanceInfoUseUtf8
};
- ((RdpProtocol) newProtocol).tmrReconnect.Elapsed += ((RdpProtocol) newProtocol).tmrReconnect_Elapsed;
- break;
- case ProtocolType.VNC:
- newProtocol = new ProtocolVNC();
- break;
- case ProtocolType.SSH1:
- newProtocol = new ProtocolSSH1();
- break;
- case ProtocolType.SSH2:
- newProtocol = new ProtocolSSH2();
- break;
- case ProtocolType.Telnet:
- newProtocol = new ProtocolTelnet();
- break;
- case ProtocolType.Rlogin:
- newProtocol = new ProtocolRlogin();
- break;
- case ProtocolType.RAW:
- newProtocol = new RawProtocol();
- break;
- case ProtocolType.HTTP:
- newProtocol = new ProtocolHTTP(connectionInfo.RenderingEngine);
- break;
- case ProtocolType.HTTPS:
- newProtocol = new ProtocolHTTPS(connectionInfo.RenderingEngine);
- break;
- case ProtocolType.ICA:
- newProtocol = new IcaProtocol();
- ((IcaProtocol) newProtocol).tmrReconnect.Elapsed += ((IcaProtocol) newProtocol).tmrReconnect_Elapsed;
- break;
- case ProtocolType.IntApp:
- newProtocol = new IntegratedProgram();
- if (connectionInfo.ExtApp == "")
- {
- throw (new Exception(Language.strNoExtAppDefined));
- }
- break;
- }
+ ((RdpProtocol)newProtocol).tmrReconnect.Elapsed += ((RdpProtocol)newProtocol).tmrReconnect_Elapsed;
+ break;
+ case ProtocolType.VNC:
+ newProtocol = new ProtocolVNC();
+ break;
+ case ProtocolType.SSH1:
+ newProtocol = new ProtocolSSH1();
+ break;
+ case ProtocolType.SSH2:
+ newProtocol = new ProtocolSSH2();
+ break;
+ case ProtocolType.Telnet:
+ newProtocol = new ProtocolTelnet();
+ break;
+ case ProtocolType.Rlogin:
+ newProtocol = new ProtocolRlogin();
+ break;
+ case ProtocolType.RAW:
+ newProtocol = new RawProtocol();
+ break;
+ case ProtocolType.HTTP:
+ newProtocol = new ProtocolHTTP(connectionInfo.RenderingEngine);
+ break;
+ case ProtocolType.HTTPS:
+ newProtocol = new ProtocolHTTPS(connectionInfo.RenderingEngine);
+ break;
+ case ProtocolType.ICA:
+ newProtocol = new IcaProtocol();
+ ((IcaProtocol)newProtocol).tmrReconnect.Elapsed += ((IcaProtocol)newProtocol).tmrReconnect_Elapsed;
+ break;
+ case ProtocolType.IntApp:
+ newProtocol = new IntegratedProgram();
+ if (connectionInfo.ExtApp == "")
+ {
+ throw (new Exception(Language.strNoExtAppDefined));
+ }
+
+ break;
+ }
+
return newProtocol;
}
}
diff --git a/mRemoteV1/Connection/Protocol/ProtocolList.cs b/mRemoteV1/Connection/Protocol/ProtocolList.cs
index 9eee86eb..0edbe325 100644
--- a/mRemoteV1/Connection/Protocol/ProtocolList.cs
+++ b/mRemoteV1/Connection/Protocol/ProtocolList.cs
@@ -1,69 +1,82 @@
using System;
using System.Collections;
using System.Collections.Specialized;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Connection.Protocol
{
- public class ProtocolList : CollectionBase, INotifyCollectionChanged
- {
+ public class ProtocolList : CollectionBase, INotifyCollectionChanged
+ {
public ProtocolBase this[object index]
- {
- get
- {
- var @base = index as ProtocolBase;
- if (@base != null)
+ {
+ get
+ {
+ var @base = index as ProtocolBase;
+ if (@base != null)
return @base;
- if (index is int)
- return (ProtocolBase) List[Convert.ToInt32(index)];
- return null;
- }
- }
-
+ if (index is int)
+ return (ProtocolBase)List[Convert.ToInt32(index)];
+ return null;
+ }
+ }
+
public new int Count
{
get { return List.Count; }
}
- public void Add(ProtocolBase cProt)
- {
- List.Add(cProt);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, cProt));
+ public void Add(ProtocolBase cProt)
+ {
+ List.Add(cProt);
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, cProt));
}
-
- public void AddRange(ProtocolBase[] cProt)
- {
- foreach (var cP in cProt)
- {
- List.Add(cP);
- }
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, cProt));
- }
-
- public void Remove(ProtocolBase cProt)
- {
- try
- {
- List.Remove(cProt);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, cProt));
- }
- catch (Exception)
- {
- }
- }
-
- public new void Clear()
- {
- if (Count == 0) return;
- List.Clear();
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
- }
- public event NotifyCollectionChangedEventHandler CollectionChanged;
- private void RaiseCollectionChangedEvent(object sender, NotifyCollectionChangedEventArgs args)
- {
- CollectionChanged?.Invoke(sender, args);
- }
+ public void AddRange(ProtocolBase[] cProt)
+ {
+ foreach (var cP in cProt)
+ {
+ List.Add(cP);
+ }
+
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, cProt));
+ }
+
+ public void Remove(ProtocolBase cProt)
+ {
+ try
+ {
+ if (!List.Contains(cProt))
+ return;
+
+ List.Remove(cProt);
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove,
+ cProt));
+ }
+ catch (Exception)
+ {
+ }
+ }
+
+ public new void Clear()
+ {
+ if (Count == 0)
+ return;
+
+ List.Clear();
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ }
+
+ public event NotifyCollectionChangedEventHandler CollectionChanged;
+
+ private void RaiseCollectionChangedEvent(object sender, NotifyCollectionChangedEventArgs args)
+ {
+ CollectionChanged?.Invoke(sender, args);
+ }
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/ProtocolType.cs b/mRemoteV1/Connection/Protocol/ProtocolType.cs
index 69d4fa6f..44aca2f9 100644
--- a/mRemoteV1/Connection/Protocol/ProtocolType.cs
+++ b/mRemoteV1/Connection/Protocol/ProtocolType.cs
@@ -2,29 +2,39 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol
{
- public enum ProtocolType
- {
+ public enum ProtocolType
+ {
[LocalizedAttributes.LocalizedDescription("strRDP")]
RDP = 0,
+
[LocalizedAttributes.LocalizedDescription("strVnc")]
VNC = 1,
+
[LocalizedAttributes.LocalizedDescription("strSsh1")]
SSH1 = 2,
+
[LocalizedAttributes.LocalizedDescription("strSsh2")]
SSH2 = 3,
+
[LocalizedAttributes.LocalizedDescription("strTelnet")]
Telnet = 4,
+
[LocalizedAttributes.LocalizedDescription("strRlogin")]
Rlogin = 5,
+
[LocalizedAttributes.LocalizedDescription("strRAW")]
RAW = 6,
+
[LocalizedAttributes.LocalizedDescription("strHttp")]
HTTP = 7,
+
[LocalizedAttributes.LocalizedDescription("strHttps")]
HTTPS = 8,
+
[LocalizedAttributes.LocalizedDescription("strICA")]
ICA = 9,
+
[LocalizedAttributes.LocalizedDescription("strExtApp")]
IntApp = 20
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/PuttyBase.cs b/mRemoteV1/Connection/Protocol/PuttyBase.cs
index 515bba51..ced700e9 100644
--- a/mRemoteV1/Connection/Protocol/PuttyBase.cs
+++ b/mRemoteV1/Connection/Protocol/PuttyBase.cs
@@ -18,9 +18,9 @@ using mRemoteNG.Security;
namespace mRemoteNG.Connection.Protocol
{
public class PuttyBase : ProtocolBase
- {
- private const int IDM_RECONF = 0x50; // PuTTY Settings Menu ID
- private bool _isPuttyNg;
+ {
+ private const int IDM_RECONF = 0x50; // PuTTY Settings Menu ID
+ private bool _isPuttyNg;
private readonly DisplayProperties _display = new DisplayProperties();
#region Public Properties
@@ -29,228 +29,258 @@ namespace mRemoteNG.Connection.Protocol
protected Putty_SSHVersion PuttySSHVersion { private get; set; }
- public IntPtr PuttyHandle { get; set; }
+ public IntPtr PuttyHandle { get; set; }
- private Process PuttyProcess { get; set; }
+ private Process PuttyProcess { get; set; }
- public static string PuttyPath { get; set; }
+ public static string PuttyPath { get; set; }
- public bool Focused
- {
- get { return NativeMethods.GetForegroundWindow() == PuttyHandle; }
- }
+ public bool Focused
+ {
+ get { return NativeMethods.GetForegroundWindow() == PuttyHandle; }
+ }
- #endregion
-
- #region Private Events & Handlers
- private void ProcessExited(object sender, EventArgs e)
- {
- Event_Closed(this);
- }
#endregion
-
+
+ #region Private Events & Handlers
+
+ private void ProcessExited(object sender, EventArgs e)
+ {
+ Event_Closed(this);
+ }
+
+ #endregion
+
#region Public Methods
- public override bool Connect()
- {
- try
- {
- _isPuttyNg = PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.PuttyNg;
- PuttyProcess = new Process
- {
- StartInfo =
- {
- UseShellExecute = false,
- FileName = PuttyPath
- }
- };
+ public override bool Connect()
+ {
+ try
+ {
+ _isPuttyNg = PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.PuttyNg;
- var arguments = new CommandLineArguments {EscapeForShell = false};
+ PuttyProcess = new Process
+ {
+ StartInfo =
+ {
+ UseShellExecute = false,
+ FileName = PuttyPath
+ }
+ };
+
+ var arguments = new CommandLineArguments {EscapeForShell = false};
+
+ arguments.Add("-load", InterfaceControl.Info.PuttySession);
+
+ if (!(InterfaceControl.Info is PuttySessionInfo))
+ {
+ arguments.Add("-" + PuttyProtocol);
+
+ if (PuttyProtocol == Putty_Protocol.ssh)
+ {
- arguments.Add("-load", InterfaceControl.Info.PuttySession);
- if (!(InterfaceControl.Info is PuttySessionInfo))
- {
- arguments.Add("-" + PuttyProtocol);
-
- if (PuttyProtocol == Putty_Protocol.ssh)
- {
- arguments.Add("-" + (int)PuttySSHVersion);
+
- if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials))
- {
+ arguments.Add("-" + (int)PuttySSHVersion);
+
+ if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials))
+ {
var cred = Runtime.CredentialService.GetEffectiveCredentialRecord(InterfaceControl?.Info.CredentialRecordId
.FirstOrDefault()).FirstOrDefault();
var username = cred.Username;
var password = cred.Password.ConvertToUnsecureString();
- if (!string.IsNullOrEmpty(username))
- {
- arguments.Add("-l", username);
- }
- if (!string.IsNullOrEmpty(password))
- {
- arguments.Add("-pw", password);
- }
- }
- }
-
- arguments.Add("-P", InterfaceControl.Info.Port.ToString());
- arguments.Add(InterfaceControl.Info.Hostname);
- }
-
- if (_isPuttyNg)
- {
- arguments.Add("-hwndparent", InterfaceControl.Handle.ToString());
- }
-
- PuttyProcess.StartInfo.Arguments = arguments.ToString();
-
- PuttyProcess.EnableRaisingEvents = true;
- PuttyProcess.Exited += ProcessExited;
-
- PuttyProcess.Start();
- PuttyProcess.WaitForInputIdle(Settings.Default.MaxPuttyWaitTime * 1000);
-
- var startTicks = Environment.TickCount;
- while (PuttyHandle.ToInt32() == 0 & Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
- {
- if (_isPuttyNg)
- {
- PuttyHandle = NativeMethods.FindWindowEx(
- InterfaceControl.Handle, new IntPtr(0), null, null);
- }
- else
- {
- PuttyProcess.Refresh();
- PuttyHandle = PuttyProcess.MainWindowHandle;
- }
- if (PuttyHandle.ToInt32() == 0)
- {
- Thread.Sleep(0);
- }
- }
-
- if (!_isPuttyNg)
- {
- NativeMethods.SetParent(PuttyHandle, InterfaceControl.Handle);
- }
-
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strPuttyStuff, true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strPuttyHandle, PuttyHandle), true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strPuttyTitle, PuttyProcess.MainWindowTitle), true);
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strPuttyParentHandle, InterfaceControl.Parent.Handle), true);
-
- Resize(this, new EventArgs());
- base.Connect();
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyConnectionFailed + Environment.NewLine + ex.Message);
- return false;
- }
- }
-
- public override void Focus()
- {
- try
- {
- if (ConnectionWindow.InTabDrag)
- {
- return;
- }
- NativeMethods.SetForegroundWindow(PuttyHandle);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyFocusFailed + Environment.NewLine + ex.Message, true);
- }
- }
+ if (!string.IsNullOrEmpty(username))
+ {
+ arguments.Add("-l", username);
+ }
- protected override void Resize(object sender, EventArgs e)
- {
- try
- {
- if (InterfaceControl.Size == Size.Empty)
- {
- return;
- }
+ if (!string.IsNullOrEmpty(password))
+ {
+ arguments.Add("-pw", password);
+ }
+ }
+ }
- var scaledFrameBorderHeight = _display.ScaleHeight(SystemInformation.FrameBorderSize.Height);
- var scaledFrameBorderWidth = _display.ScaleWidth(SystemInformation.FrameBorderSize.Width);
+ arguments.Add("-P", InterfaceControl.Info.Port.ToString());
+ arguments.Add(InterfaceControl.Info.Hostname);
+ }
- NativeMethods.MoveWindow(
- PuttyHandle,
- -scaledFrameBorderWidth,
- -(SystemInformation.CaptionHeight + scaledFrameBorderHeight),
- InterfaceControl.Width + scaledFrameBorderWidth * 2,
- InterfaceControl.Height + SystemInformation.CaptionHeight + scaledFrameBorderHeight * 2,
- true);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyResizeFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- public override void Close()
- {
- try
- {
- if (PuttyProcess.HasExited == false)
- {
- PuttyProcess.Kill();
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyKillFailed + Environment.NewLine + ex.Message, true);
- }
-
- try
- {
- PuttyProcess.Dispose();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyDisposeFailed + Environment.NewLine + ex.Message, true);
- }
-
- base.Close();
- }
-
- public void ShowSettingsDialog()
- {
- try
- {
+ if (_isPuttyNg)
+ {
+ arguments.Add("-hwndparent", InterfaceControl.Handle.ToString());
+ }
+
+ PuttyProcess.StartInfo.Arguments = arguments.ToString();
+
+ PuttyProcess.EnableRaisingEvents = true;
+ PuttyProcess.Exited += ProcessExited;
+
+ PuttyProcess.Start();
+ PuttyProcess.WaitForInputIdle(Settings.Default.MaxPuttyWaitTime * 1000);
+
+ var startTicks = Environment.TickCount;
+ while (PuttyHandle.ToInt32() == 0 &
+ Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
+ {
+ if (_isPuttyNg)
+ {
+ PuttyHandle = NativeMethods.FindWindowEx(
+ InterfaceControl.Handle, new IntPtr(0), null, null);
+ }
+ else
+ {
+ PuttyProcess.Refresh();
+ PuttyHandle = PuttyProcess.MainWindowHandle;
+ }
+
+ if (PuttyHandle.ToInt32() == 0)
+ {
+ Thread.Sleep(0);
+ }
+ }
+
+ if (!_isPuttyNg)
+ {
+ NativeMethods.SetParent(PuttyHandle, InterfaceControl.Handle);
+ }
+
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strPuttyStuff, true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strPuttyHandle, PuttyHandle), true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strPuttyTitle, PuttyProcess.MainWindowTitle),
+ true);
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strPuttyParentHandle,
+ InterfaceControl.Parent.Handle), true);
+
+ Resize(this, new EventArgs());
+ base.Connect();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyConnectionFailed + Environment.NewLine +
+ ex.Message);
+ return false;
+ }
+ }
+
+ public override void Focus()
+ {
+ try
+ {
+ NativeMethods.SetForegroundWindow(PuttyHandle);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyFocusFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+ }
+
+ public override void Resize(object sender, EventArgs e)
+ {
+ try
+ {
+ if (InterfaceControl.Size == Size.Empty)
+ return;
+
+ if (_isPuttyNg)
+ {
+ // PuTTYNG 0.70.0.1 and later doesn't have any window borders
+ NativeMethods.MoveWindow(PuttyHandle, 0, 0, InterfaceControl.Width, InterfaceControl.Height, true);
+ }
+ else
+ {
+ var scaledFrameBorderHeight = _display.ScaleHeight(SystemInformation.FrameBorderSize.Height);
+ var scaledFrameBorderWidth = _display.ScaleWidth(SystemInformation.FrameBorderSize.Width);
+
+ NativeMethods.MoveWindow(PuttyHandle, -scaledFrameBorderWidth,
+ -(SystemInformation.CaptionHeight + scaledFrameBorderHeight),
+ InterfaceControl.Width + scaledFrameBorderWidth * 2,
+ InterfaceControl.Height + SystemInformation.CaptionHeight +
+ scaledFrameBorderHeight * 2,
+ true);
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyResizeFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+ }
+
+ public override void Close()
+ {
+ try
+ {
+ if (PuttyProcess.HasExited == false)
+ {
+ PuttyProcess.Kill();
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyKillFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+
+ try
+ {
+ PuttyProcess.Dispose();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyDisposeFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+
+ base.Close();
+ }
+
+ public void ShowSettingsDialog()
+ {
+ try
+ {
NativeMethods.PostMessage(PuttyHandle, NativeMethods.WM_SYSCOMMAND, (IntPtr)IDM_RECONF, (IntPtr)0);
NativeMethods.SetForegroundWindow(PuttyHandle);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyShowSettingsDialogFailed + Environment.NewLine + ex.Message, true);
- }
- }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strPuttyShowSettingsDialogFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
#endregion
-
+
#region Enums
- protected enum Putty_Protocol
- {
- ssh = 0,
- telnet = 1,
- rlogin = 2,
- raw = 3,
- serial = 4
- }
+ protected enum Putty_Protocol
+ {
+ ssh = 0,
+ telnet = 1,
+ rlogin = 2,
+ raw = 3,
+ serial = 4
+ }
+
+ protected enum Putty_SSHVersion
+ {
+ ssh1 = 1,
+ ssh2 = 2
+ }
- protected enum Putty_SSHVersion
- {
- ssh1 = 1,
- ssh2 = 2
- }
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/RAW/RawProtocol.cs b/mRemoteV1/Connection/Protocol/RAW/RawProtocol.cs
index 4e9643e3..cb7f0a51 100644
--- a/mRemoteV1/Connection/Protocol/RAW/RawProtocol.cs
+++ b/mRemoteV1/Connection/Protocol/RAW/RawProtocol.cs
@@ -1,15 +1,15 @@
namespace mRemoteNG.Connection.Protocol.RAW
{
- public class RawProtocol : PuttyBase
- {
- public RawProtocol()
- {
- PuttyProtocol = Putty_Protocol.raw;
- }
-
- public enum Defaults
- {
- Port = 23
- }
- }
+ public class RawProtocol : PuttyBase
+ {
+ public RawProtocol()
+ {
+ PuttyProtocol = Putty_Protocol.raw;
+ }
+
+ public enum Defaults
+ {
+ Port = 23
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs b/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs
index e0836053..1f7a2e38 100644
--- a/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs
+++ b/mRemoteV1/Connection/Protocol/RDP/AzureLoadBalanceInfoEncoder.cs
@@ -37,4 +37,4 @@ namespace mRemoteNG.Connection.Protocol.RDP
return Encoding.Unicode.GetString(bytes);
}
}
-}
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/RDP/RdpClientWrap.cs b/mRemoteV1/Connection/Protocol/RDP/RdpClientWrap.cs
new file mode 100644
index 00000000..08ed2f85
--- /dev/null
+++ b/mRemoteV1/Connection/Protocol/RDP/RdpClientWrap.cs
@@ -0,0 +1,24 @@
+using mRemoteNG.App;
+using mRemoteNG.UI.Tabs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace mRemoteNG.Connection.Protocol.RDP
+{
+ class RdpClientWrap : AxMSTSCLib.AxMsRdpClient8NotSafeForScripting
+ {
+ public RdpClientWrap()
+ : base()
+ {
+ GotFocus += RdpClientWrap_GotFocus;
+ }
+
+ private void RdpClientWrap_GotFocus(object sender, EventArgs e)
+ {
+ ((ConnectionTab)Parent.Parent).Focus();
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/RDP/RdpErrorCodes.cs b/mRemoteV1/Connection/Protocol/RDP/RdpErrorCodes.cs
index aa963ffd..b20980c1 100644
--- a/mRemoteV1/Connection/Protocol/RDP/RdpErrorCodes.cs
+++ b/mRemoteV1/Connection/Protocol/RDP/RdpErrorCodes.cs
@@ -12,18 +12,18 @@ namespace mRemoteNG.Connection.Protocol.RDP
{
_description = new Hashtable
{
- { 0, "Language.strRdpErrorUnknown"},
- { 1, "Language.strRdpErrorCode1"},
- { 2, "Language.strRdpErrorOutOfMemory"},
- { 3, "Language.strRdpErrorWindowCreation"},
- { 4, "Language.strRdpErrorCode2"},
- { 5, "Language.strRdpErrorCode3"},
- { 6, "Language.strRdpErrorCode4"},
- { 7, "Language.strRdpErrorConnection"},
- { 100, "Language.strRdpErrorWinsock"}
+ {0, "Language.strRdpErrorUnknown"},
+ {1, "Language.strRdpErrorCode1"},
+ {2, "Language.strRdpErrorOutOfMemory"},
+ {3, "Language.strRdpErrorWindowCreation"},
+ {4, "Language.strRdpErrorCode2"},
+ {5, "Language.strRdpErrorCode3"},
+ {6, "Language.strRdpErrorCode4"},
+ {7, "Language.strRdpErrorConnection"},
+ {100, "Language.strRdpErrorWinsock"}
};
}
-
+
public static string GetError(int id)
{
try
diff --git a/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs b/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs
index 07019df7..7f0102ce 100644
--- a/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs
+++ b/mRemoteV1/Connection/Protocol/RDP/RdpProtocol.cs
@@ -18,7 +18,7 @@ using mRemoteNG.Security;
namespace mRemoteNG.Connection.Protocol.RDP
{
public class RdpProtocol : ProtocolBase
- {
+ {
/* RDP v8 requires Windows 7 with:
* https://support.microsoft.com/en-us/kb/2592687
* OR
@@ -32,99 +32,104 @@ namespace mRemoteNG.Connection.Protocol.RDP
private bool _loginComplete;
private bool _redirectKeys;
private bool _alertOnIdleDisconnect;
- private readonly DisplayProperties _displayProperties;
+ private readonly DisplayProperties _displayProperties;
private readonly FrmMain _frmMain = FrmMain.Default;
#region Properties
- public bool SmartSize
- {
- get => _rdpClient.AdvancedSettings2.SmartSizing;
- private set
- {
- _rdpClient.AdvancedSettings2.SmartSizing = value;
- ReconnectForResize();
- }
- }
-
- public bool Fullscreen
- {
- get => _rdpClient.FullScreen;
- private set
- {
- _rdpClient.FullScreen = value;
- ReconnectForResize();
- }
- }
- private bool RedirectKeys
- {
+ public bool SmartSize
+ {
+ get => _rdpClient.AdvancedSettings2.SmartSizing;
+ private set
+ {
+ _rdpClient.AdvancedSettings2.SmartSizing = value;
+ ReconnectForResize();
+ }
+ }
+
+ public bool Fullscreen
+ {
+ get => _rdpClient.FullScreen;
+ private set
+ {
+ _rdpClient.FullScreen = value;
+ ReconnectForResize();
+ }
+ }
+
+ private bool RedirectKeys
+ {
/*
get
{
return _redirectKeys;
}
*/
- set
- {
- _redirectKeys = value;
- try
- {
- if (!_redirectKeys)
- {
- return;
- }
-
- Debug.Assert(Convert.ToBoolean(_rdpClient.SecuredSettingsEnabled));
+ set
+ {
+ _redirectKeys = value;
+ try
+ {
+ if (!_redirectKeys)
+ {
+ return;
+ }
+
+ Debug.Assert(Convert.ToBoolean(_rdpClient.SecuredSettingsEnabled));
var msRdpClientSecuredSettings = _rdpClient.SecuredSettings2;
- msRdpClientSecuredSettings.KeyboardHookMode = 1; // Apply key combinations at the remote server.
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetRedirectKeysFailed, ex);
- }
- }
- }
+ msRdpClientSecuredSettings.KeyboardHookMode = 1; // Apply key combinations at the remote server.
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetRedirectKeysFailed, ex);
+ }
+ }
+ }
public bool LoadBalanceInfoUseUtf8 { get; set; }
+
#endregion
#region Constructors
+
public RdpProtocol()
{
- Control = new AxMsRdpClient8NotSafeForScripting();
+ Control = new RdpClientWrap();
_displayProperties = new DisplayProperties();
}
+
#endregion
#region Public Methods
- public override bool Initialize()
- {
- base.Initialize();
- try
- {
- Control.CreateControl();
- _connectionInfo = InterfaceControl.Info;
-
- try
- {
- while (!Control.Created)
- {
- Thread.Sleep(0);
- Application.DoEvents();
- }
- _rdpClient = (MsRdpClient8NotSafeForScripting)((AxMsRdpClient8NotSafeForScripting)Control).GetOcx();
- }
- catch (System.Runtime.InteropServices.COMException ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(Language.strRdpControlCreationFailed, ex);
- Control.Dispose();
- return false;
- }
-
- _rdpVersion = new Version(_rdpClient.Version);
-
- _rdpClient.Server = _connectionInfo.Hostname;
+ public override bool Initialize()
+ {
+ base.Initialize();
+ try
+ {
+ Control.CreateControl();
+ _connectionInfo = InterfaceControl.Info;
+
+ try
+ {
+ while (!Control.Created)
+ {
+ Thread.Sleep(0);
+ Application.DoEvents();
+ }
+
+ _rdpClient = (MsRdpClient8NotSafeForScripting)((AxMsRdpClient8NotSafeForScripting)Control).GetOcx();
+ }
+ catch (System.Runtime.InteropServices.COMException ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(Language.strRdpControlCreationFailed, ex);
+ Control.Dispose();
+ return false;
+ }
+
+ _rdpVersion = new Version(_rdpClient.Version);
+
+ _rdpClient.Server = _connectionInfo.Hostname;
SetCredentials();
SetResolution();
@@ -135,505 +140,534 @@ namespace mRemoteNG.Connection.Protocol.RDP
//not user changeable
_rdpClient.AdvancedSettings2.GrabFocusOnConnect = true;
- _rdpClient.AdvancedSettings3.EnableAutoReconnect = true;
- _rdpClient.AdvancedSettings3.MaxReconnectAttempts = Settings.Default.RdpReconnectionCount;
- _rdpClient.AdvancedSettings2.keepAliveInterval = 60000; //in milliseconds (10,000 = 10 seconds)
- _rdpClient.AdvancedSettings5.AuthenticationLevel = 0;
- _rdpClient.AdvancedSettings2.EncryptionEnabled = 1;
-
- _rdpClient.AdvancedSettings2.overallConnectionTimeout = Settings.Default.ConRDPOverallConnectionTimeout;
-
- _rdpClient.AdvancedSettings2.BitmapPeristence = Convert.ToInt32(_connectionInfo.CacheBitmaps);
- if (_rdpVersion >= Versions.RDC61)
- {
- _rdpClient.AdvancedSettings7.EnableCredSspSupport = _connectionInfo.UseCredSsp;
- _rdpClient.AdvancedSettings8.AudioQualityMode = (uint)_connectionInfo.SoundQuality;
- }
+ _rdpClient.AdvancedSettings3.EnableAutoReconnect = true;
+ _rdpClient.AdvancedSettings3.MaxReconnectAttempts = Settings.Default.RdpReconnectionCount;
+ _rdpClient.AdvancedSettings2.keepAliveInterval = 60000; //in milliseconds (10,000 = 10 seconds)
+ _rdpClient.AdvancedSettings5.AuthenticationLevel = 0;
+ _rdpClient.AdvancedSettings2.EncryptionEnabled = 1;
+
+ _rdpClient.AdvancedSettings2.overallConnectionTimeout = Settings.Default.ConRDPOverallConnectionTimeout;
+
+ _rdpClient.AdvancedSettings2.BitmapPeristence = Convert.ToInt32(_connectionInfo.CacheBitmaps);
+ if (_rdpVersion >= Versions.RDC61)
+ {
+ _rdpClient.AdvancedSettings7.EnableCredSspSupport = _connectionInfo.UseCredSsp;
+ _rdpClient.AdvancedSettings8.AudioQualityMode = (uint)_connectionInfo.SoundQuality;
+ }
SetUseConsoleSession();
SetPort();
- RedirectKeys = _connectionInfo.RedirectKeys;
+ RedirectKeys = _connectionInfo.RedirectKeys;
SetRedirection();
SetAuthenticationLevel();
- SetLoadBalanceInfo();
+ SetLoadBalanceInfo();
SetRdGateway();
_rdpClient.ColorDepth = (int)_connectionInfo.Colors;
SetPerformanceFlags();
-
- _rdpClient.ConnectingText = Language.strConnecting;
-
- Control.Anchor = AnchorStyles.None;
-
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPropsFailed, ex);
- return false;
- }
- }
- public override bool Connect()
- {
- _loginComplete = false;
- SetEventHandlers();
+ _rdpClient.ConnectingText = Language.strConnecting;
+
+ Control.Anchor = AnchorStyles.None;
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPropsFailed, ex);
+ return false;
+ }
+ }
+
+ public override bool Connect()
+ {
+ _loginComplete = false;
+ SetEventHandlers();
try
- {
- _rdpClient.Connect();
- base.Connect();
- return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionOpenFailed, ex);
- }
-
- return false;
- }
-
- public override void Disconnect()
- {
- try
- {
- _rdpClient.Disconnect();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpDisconnectFailed, ex);
- Close();
- }
- }
-
- public void ToggleFullscreen()
- {
- try
- {
+ {
+ _rdpClient.Connect();
+ base.Connect();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionOpenFailed, ex);
+ }
+
+ return false;
+ }
+
+ public override void Disconnect()
+ {
+ try
+ {
+ _rdpClient.Disconnect();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpDisconnectFailed, ex);
+ Close();
+ }
+ }
+
+ public void ToggleFullscreen()
+ {
+ try
+ {
Fullscreen = !Fullscreen;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpToggleFullscreenFailed, ex);
- }
- }
-
- public void ToggleSmartSize()
- {
- try
- {
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpToggleFullscreenFailed, ex);
+ }
+ }
+
+ public void ToggleSmartSize()
+ {
+ try
+ {
SmartSize = !SmartSize;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpToggleSmartSizeFailed, ex);
- }
- }
-
- public override void Focus()
- {
- try
- {
- if (Control.ContainsFocus == false)
- {
- Control.Focus();
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpFocusFailed, ex);
- }
- }
-
- private Size _controlBeginningSize;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpToggleSmartSizeFailed, ex);
+ }
+ }
- protected override void ResizeBegin(object sender, EventArgs e)
- {
- _controlBeginningSize = Control.Size;
- }
+ public override void Focus()
+ {
+ try
+ {
+ if (Control.ContainsFocus == false)
+ {
+ Control.Focus();
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpFocusFailed, ex);
+ }
+ }
- protected override void Resize(object sender, EventArgs e)
- {
- if (DoResize() && _controlBeginningSize.IsEmpty)
- {
- ReconnectForResize();
- }
- base.Resize(sender, e);
- }
+ private Size _controlBeginningSize;
+
+ public override void ResizeBegin(object sender, EventArgs e)
+ {
+ _controlBeginningSize = Control.Size;
+ }
+
+ public override void Resize(object sender, EventArgs e)
+ {
+ if (DoResize() && _controlBeginningSize.IsEmpty)
+ {
+ ReconnectForResize();
+ }
+
+ base.Resize(sender, e);
+ }
+
+ public override void ResizeEnd(object sender, EventArgs e)
+ {
+ DoResize();
+ if (!(Control.Size == _controlBeginningSize))
+ {
+ ReconnectForResize();
+ }
+
+ _controlBeginningSize = Size.Empty;
+ }
- protected override void ResizeEnd(object sender, EventArgs e)
- {
- DoResize();
- if (!(Control.Size == _controlBeginningSize))
- {
- ReconnectForResize();
- }
- _controlBeginningSize = Size.Empty;
- }
#endregion
-
- #region Private Methods
- private bool DoResize()
- {
- Control.Location = InterfaceControl.Location;
- if (!(Control.Size == InterfaceControl.Size) && !(InterfaceControl.Size == Size.Empty)) // kmscode - this doesn't look right to me. But I'm not aware of any functionality issues with this currently...
- {
- Control.Size = InterfaceControl.Size;
- return true;
- }
- else
- {
- return false;
- }
- }
-
- private void ReconnectForResize()
- {
- if (_rdpVersion < Versions.RDC80)
- {
- return;
- }
-
- if (!_loginComplete)
- {
- return;
- }
-
- if (!InterfaceControl.Info.AutomaticResize)
- {
- return;
- }
-
- if (!(InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow | InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen))
- {
- return;
- }
-
- if (SmartSize)
- {
- return;
- }
- try
- {
- Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Resizing RDP connection to host '{_connectionInfo.Hostname}'");
- var size = !Fullscreen ? Control.Size : Screen.FromControl(Control).Bounds.Size;
+ #region Private Methods
+
+ private bool DoResize()
+ {
+ Control.Location = InterfaceControl.Location;
+ if (!(Control.Size == InterfaceControl.Size) && !(InterfaceControl.Size == Size.Empty)
+ ) // kmscode - this doesn't look right to me. But I'm not aware of any functionality issues with this currently...
+ {
+ Control.Size = InterfaceControl.Size;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private void ReconnectForResize()
+ {
+ if (_rdpVersion < Versions.RDC80)
+ {
+ return;
+ }
+
+ if (!_loginComplete)
+ {
+ return;
+ }
+
+ if (!InterfaceControl.Info.AutomaticResize)
+ {
+ return;
+ }
+
+ if (!(InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow |
+ InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen))
+ {
+ return;
+ }
+
+ if (SmartSize)
+ {
+ return;
+ }
+
+ try
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
+ $"Resizing RDP connection to host '{_connectionInfo.Hostname}'");
+ var size = !Fullscreen ? Control.Size : Screen.FromControl(Control).Bounds.Size;
IMsRdpClient8 msRdpClient8 = _rdpClient;
- msRdpClient8.Reconnect((uint)size.Width, (uint)size.Height);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(string.Format(Language.ChangeConnectionResolutionError, _connectionInfo.Hostname),
- ex, MessageClass.WarningMsg, false);
- }
- }
-
- private void SetRdGateway()
- {
- try
- {
- if (_rdpClient.TransportSettings.GatewayIsSupported == 0)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strRdpGatewayNotSupported, true);
- return;
- }
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strRdpGatewayIsSupported, true);
+ msRdpClient8.Reconnect((uint)size.Width, (uint)size.Height);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(
+ string.Format(Language.ChangeConnectionResolutionError,
+ _connectionInfo.Hostname),
+ ex, MessageClass.WarningMsg, false);
+ }
+ }
- if (_connectionInfo.RDGatewayUsageMethod != RDGatewayUsageMethod.Never)
- {
- _rdpClient.TransportSettings.GatewayUsageMethod = (uint)_connectionInfo.RDGatewayUsageMethod;
- _rdpClient.TransportSettings.GatewayHostname = _connectionInfo.RDGatewayHostname;
- _rdpClient.TransportSettings.GatewayProfileUsageMethod = 1; // TSC_PROXY_PROFILE_MODE_EXPLICIT
- if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.SmartCard)
- {
- _rdpClient.TransportSettings.GatewayCredsSource = 1; // TSC_PROXY_CREDS_MODE_SMARTCARD
- }
- if (_rdpVersion >= Versions.RDC61 && !Force.HasFlag(ConnectionInfo.Force.NoCredentials))
- {
- if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.Yes)
- {
+ private void SetRdGateway()
+ {
+ try
+ {
+ if (_rdpClient.TransportSettings.GatewayIsSupported == 0)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strRdpGatewayNotSupported,
+ true);
+ return;
+ }
+
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strRdpGatewayIsSupported,
+ true);
+
+ if (_connectionInfo.RDGatewayUsageMethod != RDGatewayUsageMethod.Never)
+ {
+ _rdpClient.TransportSettings.GatewayUsageMethod = (uint)_connectionInfo.RDGatewayUsageMethod;
+ _rdpClient.TransportSettings.GatewayHostname = _connectionInfo.RDGatewayHostname;
+ _rdpClient.TransportSettings.GatewayProfileUsageMethod = 1; // TSC_PROXY_PROFILE_MODE_EXPLICIT
+ if (_connectionInfo.RDGatewayUseConnectionCredentials ==
+ RDGatewayUseConnectionCredentials.SmartCard)
+ {
+ _rdpClient.TransportSettings.GatewayCredsSource = 1; // TSC_PROXY_CREDS_MODE_SMARTCARD
+ }
+
+ if (_rdpVersion >= Versions.RDC61 && !Force.HasFlag(ConnectionInfo.Force.NoCredentials))
+ {
+ if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.Yes)
+ {
_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.CredentialRecord.Username;
_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.CredentialRecord.Password.ConvertToUnsecureString();
_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.CredentialRecord.Domain;
- }
- else if (_connectionInfo.RDGatewayUseConnectionCredentials == RDGatewayUseConnectionCredentials.SmartCard)
- {
- _rdpClient.TransportSettings2.GatewayCredSharing = 0;
- }
- else
- {
+ }
+ else if (_connectionInfo.RDGatewayUseConnectionCredentials ==
+ RDGatewayUseConnectionCredentials.SmartCard)
+ {
+ _rdpClient.TransportSettings2.GatewayCredSharing = 0;
+ }
+ else
+ {
_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.RDGatewayUsername;
_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.RDGatewayPassword;
_rdpClient.TransportSettings2.GatewayDomain = _connectionInfo.RDGatewayDomain;
_rdpClient.TransportSettings2.GatewayCredSharing = 0;
}
- }
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetGatewayFailed, ex);
- }
- }
-
- private void SetUseConsoleSession()
- {
- try
- {
- bool value;
-
- if (Force.HasFlag(ConnectionInfo.Force.UseConsoleSession))
- {
- value = true;
- }
- else if (Force.HasFlag(ConnectionInfo.Force.DontUseConsoleSession))
- {
- value = false;
- }
- else
- {
- value = _connectionInfo.UseConsoleSession;
- }
-
- if (_rdpVersion >= Versions.RDC61)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strRdpSetConsoleSwitch, _rdpVersion), true);
- _rdpClient.AdvancedSettings7.ConnectToAdministerServer = value;
- }
- else
- {
- Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, string.Format(Language.strRdpSetConsoleSwitch, _rdpVersion) + Environment.NewLine + "No longer supported in this RDP version. Reference: https://msdn.microsoft.com/en-us/library/aa380863(v=vs.85).aspx", true);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetGatewayFailed, ex);
+ }
+ }
+
+ private void SetUseConsoleSession()
+ {
+ try
+ {
+ bool value;
+
+ if (Force.HasFlag(ConnectionInfo.Force.UseConsoleSession))
+ {
+ value = true;
+ }
+ else if (Force.HasFlag(ConnectionInfo.Force.DontUseConsoleSession))
+ {
+ value = false;
+ }
+ else
+ {
+ value = _connectionInfo.UseConsoleSession;
+ }
+
+ if (_rdpVersion >= Versions.RDC61)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strRdpSetConsoleSwitch, _rdpVersion),
+ true);
+ _rdpClient.AdvancedSettings7.ConnectToAdministerServer = value;
+ }
+ else
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
+ string.Format(Language.strRdpSetConsoleSwitch, _rdpVersion) +
+ Environment.NewLine +
+ "No longer supported in this RDP version. Reference: https://msdn.microsoft.com/en-us/library/aa380863(v=vs.85).aspx",
+ true);
// ConnectToServerConsole is deprecated
//https://msdn.microsoft.com/en-us/library/aa380863(v=vs.85).aspx
//_rdpClient.AdvancedSettings2.ConnectToServerConsole = value;
}
}
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetConsoleSessionFailed, ex);
- }
- }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetConsoleSessionFailed, ex);
+ }
+ }
- private object GetExtendedProperty(string property)
- {
- try
- {
- // ReSharper disable once UseIndexedProperty
- return ((IMsRdpExtendedSettings)_rdpClient).get_Property(property);
- }
- catch (Exception e)
- {
- Runtime.MessageCollector.AddExceptionMessage($"Error getting extended RDP property '{property}'",
- e, MessageClass.WarningMsg, false);
- return null;
- }
- }
+ private object GetExtendedProperty(string property)
+ {
+ try
+ {
+ // ReSharper disable once UseIndexedProperty
+ return ((IMsRdpExtendedSettings)_rdpClient).get_Property(property);
+ }
+ catch (Exception e)
+ {
+ Runtime.MessageCollector.AddExceptionMessage($"Error getting extended RDP property '{property}'",
+ e, MessageClass.WarningMsg, false);
+ return null;
+ }
+ }
private void SetExtendedProperty(string property, object value)
- {
- try
- {
- // ReSharper disable once UseIndexedProperty
- ((IMsRdpExtendedSettings)_rdpClient).set_Property(property, ref value);
- }
- catch (Exception e)
- {
- Runtime.MessageCollector.AddExceptionMessage($"Error setting extended RDP property '{property}'",
- e, MessageClass.WarningMsg, false);
- }
- }
+ {
+ try
+ {
+ // ReSharper disable once UseIndexedProperty
+ ((IMsRdpExtendedSettings)_rdpClient).set_Property(property, ref value);
+ }
+ catch (Exception e)
+ {
+ Runtime.MessageCollector.AddExceptionMessage($"Error setting extended RDP property '{property}'",
+ e, MessageClass.WarningMsg, false);
+ }
+ }
- private void SetCredentials()
- {
- try
- {
- if (Force.HasFlag(ConnectionInfo.Force.NoCredentials))
- {
- return;
- }
+ private void SetCredentials()
+ {
+ try
+ {
+ if (Force.HasFlag(ConnectionInfo.Force.NoCredentials))
+ {
+ return;
+ }
var cred = Runtime.CredentialService.GetEffectiveCredentialRecord(_connectionInfo.CredentialRecordId
+
.FirstOrDefault()).FirstOrDefault();
_rdpClient.UserName = cred.Username ?? "";
- _rdpClient.AdvancedSettings2.ClearTextPassword = cred.Password?.ConvertToUnsecureString() ?? "";
+
+ _rdpClient.AdvancedSettings2.ClearTextPassword = cred.Password?.ConvertToUnsecureString() ?? "";
+
_rdpClient.Domain = cred.Domain ?? "";
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetCredentialsFailed, ex);
- }
- }
-
- private void SetResolution()
- {
- try
- {
- var scaleFactor = (uint)_displayProperties.ResolutionScalingFactor.Width * 100;
- SetExtendedProperty("DesktopScaleFactor", scaleFactor);
- SetExtendedProperty("DeviceScaleFactor", (uint)100);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetCredentialsFailed, ex);
+ }
+ }
+
+ private void SetResolution()
+ {
+ try
+ {
+ var scaleFactor = (uint)_displayProperties.ResolutionScalingFactor.Width * 100;
+ SetExtendedProperty("DesktopScaleFactor", scaleFactor);
+ SetExtendedProperty("DeviceScaleFactor", (uint)100);
if (Force.HasFlag(ConnectionInfo.Force.Fullscreen))
- {
- _rdpClient.FullScreen = true;
+ {
+ _rdpClient.FullScreen = true;
_rdpClient.DesktopWidth = Screen.FromControl(_frmMain).Bounds.Width;
_rdpClient.DesktopHeight = Screen.FromControl(_frmMain).Bounds.Height;
-
- return;
- }
-
- if ((InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow) || (InterfaceControl.Info.Resolution == RDPResolutions.SmartSize))
- {
- _rdpClient.DesktopWidth = InterfaceControl.Size.Width;
- _rdpClient.DesktopHeight = InterfaceControl.Size.Height;
- if (InterfaceControl.Info.Resolution == RDPResolutions.SmartSize)
- {
+ return;
+ }
+
+ if ((InterfaceControl.Info.Resolution == RDPResolutions.FitToWindow) ||
+ (InterfaceControl.Info.Resolution == RDPResolutions.SmartSize))
+ {
+ _rdpClient.DesktopWidth = InterfaceControl.Size.Width;
+ _rdpClient.DesktopHeight = InterfaceControl.Size.Height;
+
+ if (InterfaceControl.Info.Resolution == RDPResolutions.SmartSize)
+ {
_rdpClient.AdvancedSettings2.SmartSizing = true;
}
- }
- else if (InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen)
- {
- _rdpClient.FullScreen = true;
+ }
+ else if (InterfaceControl.Info.Resolution == RDPResolutions.Fullscreen)
+ {
+ _rdpClient.FullScreen = true;
_rdpClient.DesktopWidth = Screen.FromControl(_frmMain).Bounds.Width;
_rdpClient.DesktopHeight = Screen.FromControl(_frmMain).Bounds.Height;
- }
- else
- {
- var resolution = GetResolutionRectangle(_connectionInfo.Resolution);
- _rdpClient.DesktopWidth = resolution.Width;
- _rdpClient.DesktopHeight = resolution.Height;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetResolutionFailed, ex);
- }
- }
-
- private void SetPort()
- {
- try
- {
- if (_connectionInfo.Port != (int)Defaults.Port)
- {
- _rdpClient.AdvancedSettings2.RDPPort = _connectionInfo.Port;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPortFailed, ex);
- }
- }
-
- private void SetRedirection()
- {
- try
- {
- _rdpClient.AdvancedSettings2.RedirectDrives = _connectionInfo.RedirectDiskDrives;
- _rdpClient.AdvancedSettings2.RedirectPorts = _connectionInfo.RedirectPorts;
- _rdpClient.AdvancedSettings2.RedirectPrinters = _connectionInfo.RedirectPrinters;
- _rdpClient.AdvancedSettings2.RedirectSmartCards = _connectionInfo.RedirectSmartCards;
- _rdpClient.SecuredSettings2.AudioRedirectionMode = (int)_connectionInfo.RedirectSound;
+ }
+ else
+ {
+ var resolution = GetResolutionRectangle(_connectionInfo.Resolution);
+ _rdpClient.DesktopWidth = resolution.Width;
+ _rdpClient.DesktopHeight = resolution.Height;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetResolutionFailed, ex);
+ }
+ }
+
+ private void SetPort()
+ {
+ try
+ {
+ if (_connectionInfo.Port != (int)Defaults.Port)
+ {
+ _rdpClient.AdvancedSettings2.RDPPort = _connectionInfo.Port;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPortFailed, ex);
+ }
+ }
+
+ private void SetRedirection()
+ {
+ try
+ {
+ _rdpClient.AdvancedSettings2.RedirectDrives = _connectionInfo.RedirectDiskDrives;
+ _rdpClient.AdvancedSettings2.RedirectPorts = _connectionInfo.RedirectPorts;
+ _rdpClient.AdvancedSettings2.RedirectPrinters = _connectionInfo.RedirectPrinters;
+ _rdpClient.AdvancedSettings2.RedirectSmartCards = _connectionInfo.RedirectSmartCards;
+ _rdpClient.SecuredSettings2.AudioRedirectionMode = (int)_connectionInfo.RedirectSound;
_rdpClient.AdvancedSettings.DisableRdpdr = _connectionInfo.RedirectClipboard ? 0 : 1;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetRedirectionFailed, ex);
- }
- }
-
- private void SetPerformanceFlags()
- {
- try
- {
- var pFlags = 0;
- if (_connectionInfo.DisplayThemes == false)
- {
- pFlags += Convert.ToInt32(RDPPerformanceFlags.DisableThemes);
- }
-
- if (_connectionInfo.DisplayWallpaper == false)
- {
- pFlags += Convert.ToInt32(RDPPerformanceFlags.DisableWallpaper);
- }
-
- if (_connectionInfo.EnableFontSmoothing)
- {
- pFlags += Convert.ToInt32(RDPPerformanceFlags.EnableFontSmoothing);
- }
-
- if (_connectionInfo.EnableDesktopComposition)
- {
- pFlags += Convert.ToInt32(RDPPerformanceFlags.EnableDesktopComposition);
- }
-
- _rdpClient.AdvancedSettings2.PerformanceFlags = pFlags;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPerformanceFlagsFailed, ex);
- }
- }
-
- private void SetAuthenticationLevel()
- {
- try
- {
- _rdpClient.AdvancedSettings5.AuthenticationLevel = (uint)_connectionInfo.RDPAuthenticationLevel;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetAuthenticationLevelFailed, ex);
- }
- }
-
- private void SetLoadBalanceInfo()
- {
- if (string.IsNullOrEmpty(_connectionInfo.LoadBalanceInfo))
- {
- return;
- }
- try
- {
- _rdpClient.AdvancedSettings2.LoadBalanceInfo = LoadBalanceInfoUseUtf8
- ? new AzureLoadBalanceInfoEncoder().Encode(_connectionInfo.LoadBalanceInfo)
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetRedirectionFailed, ex);
+ }
+ }
+
+ private void SetPerformanceFlags()
+ {
+ try
+ {
+ var pFlags = 0;
+ if (_connectionInfo.DisplayThemes == false)
+ {
+ pFlags += Convert.ToInt32(RDPPerformanceFlags.DisableThemes);
+ }
+
+ if (_connectionInfo.DisplayWallpaper == false)
+ {
+ pFlags += Convert.ToInt32(RDPPerformanceFlags.DisableWallpaper);
+ }
+
+ if (_connectionInfo.EnableFontSmoothing)
+ {
+ pFlags += Convert.ToInt32(RDPPerformanceFlags.EnableFontSmoothing);
+ }
+
+ if (_connectionInfo.EnableDesktopComposition)
+ {
+ pFlags += Convert.ToInt32(RDPPerformanceFlags.EnableDesktopComposition);
+ }
+
+ _rdpClient.AdvancedSettings2.PerformanceFlags = pFlags;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPerformanceFlagsFailed, ex);
+ }
+ }
+
+ private void SetAuthenticationLevel()
+ {
+ try
+ {
+ _rdpClient.AdvancedSettings5.AuthenticationLevel = (uint)_connectionInfo.RDPAuthenticationLevel;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetAuthenticationLevelFailed, ex);
+ }
+ }
+
+ private void SetLoadBalanceInfo()
+ {
+ if (string.IsNullOrEmpty(_connectionInfo.LoadBalanceInfo))
+ {
+ return;
+ }
+
+ try
+ {
+ _rdpClient.AdvancedSettings2.LoadBalanceInfo = LoadBalanceInfoUseUtf8
+ ? new AzureLoadBalanceInfoEncoder().Encode(_connectionInfo.LoadBalanceInfo)
: _connectionInfo.LoadBalanceInfo;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace("Unable to set load balance info.", ex);
- }
- }
-
- private void SetEventHandlers()
- {
- try
- {
- _rdpClient.OnConnecting += RDPEvent_OnConnecting;
- _rdpClient.OnConnected += RDPEvent_OnConnected;
- _rdpClient.OnLoginComplete += RDPEvent_OnLoginComplete;
- _rdpClient.OnFatalError += RDPEvent_OnFatalError;
- _rdpClient.OnDisconnected += RDPEvent_OnDisconnected;
- _rdpClient.OnLeaveFullScreenMode += RDPEvent_OnLeaveFullscreenMode;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace("Unable to set load balance info.", ex);
+ }
+ }
+
+ private void SetEventHandlers()
+ {
+ try
+ {
+ _rdpClient.OnConnecting += RDPEvent_OnConnecting;
+ _rdpClient.OnConnected += RDPEvent_OnConnected;
+ _rdpClient.OnLoginComplete += RDPEvent_OnLoginComplete;
+ _rdpClient.OnFatalError += RDPEvent_OnFatalError;
+ _rdpClient.OnDisconnected += RDPEvent_OnDisconnected;
+ _rdpClient.OnLeaveFullScreenMode += RDPEvent_OnLeaveFullscreenMode;
_rdpClient.OnIdleTimeoutNotification += RDPEvent_OnIdleTimeoutNotification;
}
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetEventHandlersFailed, ex);
- }
- }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetEventHandlersFailed, ex);
+ }
+ }
+
#endregion
-
+
#region Private Events & Handlers
+
private void RDPEvent_OnIdleTimeoutNotification()
{
Close(); //Simply close the RDP Session if the idle timeout has been triggered.
if (!_alertOnIdleDisconnect) return;
- MessageBox.Show($"The {_connectionInfo.Name} session was disconnected due to inactivity", "Session Disconnected", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show($"The {_connectionInfo.Name} session was disconnected due to inactivity",
+ "Session Disconnected", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
@@ -641,233 +675,251 @@ namespace mRemoteNG.Connection.Protocol.RDP
{
var errorMsg = RdpErrorCodes.GetError(errorCode);
Event_ErrorOccured(this, errorMsg, errorCode);
- }
-
- private void RDPEvent_OnDisconnected(int discReason)
- {
- const int UI_ERR_NORMAL_DISCONNECT = 0xB08;
- if (discReason != UI_ERR_NORMAL_DISCONNECT)
- {
- var reason = _rdpClient.GetErrorDescription((uint)discReason, (uint) _rdpClient.ExtendedDisconnectReason);
- Event_Disconnected(this, reason, discReason);
- }
-
- if (Settings.Default.ReconnectOnDisconnect)
- {
- ReconnectGroup = new ReconnectGroup();
- ReconnectGroup.CloseClicked += Event_ReconnectGroupCloseClicked;
- ReconnectGroup.Left = (int) ((double) Control.Width / 2 - (double) ReconnectGroup.Width / 2);
- ReconnectGroup.Top = (int) ((double) Control.Height / 2 - (double) ReconnectGroup.Height / 2);
- ReconnectGroup.Parent = Control;
- ReconnectGroup.Show();
- tmrReconnect.Enabled = true;
- }
- else
- {
- Close();
- }
- }
-
- private void RDPEvent_OnConnecting()
- {
- Event_Connecting(this);
- }
-
- private void RDPEvent_OnConnected()
- {
- Event_Connected(this);
- }
-
- private void RDPEvent_OnLoginComplete()
- {
- _loginComplete = true;
- }
-
- private void RDPEvent_OnLeaveFullscreenMode()
- {
- Fullscreen = false;
+ }
+
+ private void RDPEvent_OnDisconnected(int discReason)
+ {
+ const int UI_ERR_NORMAL_DISCONNECT = 0xB08;
+ if (discReason != UI_ERR_NORMAL_DISCONNECT)
+ {
+ var reason =
+ _rdpClient.GetErrorDescription((uint)discReason, (uint)_rdpClient.ExtendedDisconnectReason);
+ Event_Disconnected(this, reason, discReason);
+ }
+
+ if (Settings.Default.ReconnectOnDisconnect)
+ {
+ ReconnectGroup = new ReconnectGroup();
+ ReconnectGroup.CloseClicked += Event_ReconnectGroupCloseClicked;
+ ReconnectGroup.Left = (int)((double)Control.Width / 2 - (double)ReconnectGroup.Width / 2);
+ ReconnectGroup.Top = (int)((double)Control.Height / 2 - (double)ReconnectGroup.Height / 2);
+ ReconnectGroup.Parent = Control;
+ ReconnectGroup.Show();
+ tmrReconnect.Enabled = true;
+ }
+ else
+ {
+ Close();
+ }
+ }
+
+ private void RDPEvent_OnConnecting()
+ {
+ Event_Connecting(this);
+ }
+
+ private void RDPEvent_OnConnected()
+ {
+ Event_Connected(this);
+ }
+
+ private void RDPEvent_OnLoginComplete()
+ {
+ _loginComplete = true;
+ }
+
+ private void RDPEvent_OnLeaveFullscreenMode()
+ {
+ Fullscreen = false;
_leaveFullscreenEvent?.Invoke(this, new EventArgs());
}
+
#endregion
-
+
#region Public Events & Handlers
- public delegate void LeaveFullscreenEventHandler(object sender, EventArgs e);
- private LeaveFullscreenEventHandler _leaveFullscreenEvent;
-
- public event LeaveFullscreenEventHandler LeaveFullscreen
- {
- add => _leaveFullscreenEvent = (LeaveFullscreenEventHandler)Delegate.Combine(_leaveFullscreenEvent, value);
- remove => _leaveFullscreenEvent = (LeaveFullscreenEventHandler)Delegate.Remove(_leaveFullscreenEvent, value);
+
+ public delegate void LeaveFullscreenEventHandler(object sender, EventArgs e);
+
+ private LeaveFullscreenEventHandler _leaveFullscreenEvent;
+
+ public event LeaveFullscreenEventHandler LeaveFullscreen
+ {
+ add => _leaveFullscreenEvent = (LeaveFullscreenEventHandler)Delegate.Combine(_leaveFullscreenEvent, value);
+ remove =>
+ _leaveFullscreenEvent = (LeaveFullscreenEventHandler)Delegate.Remove(_leaveFullscreenEvent, value);
}
+
#endregion
-
+
#region Enums
- public enum Defaults
- {
- Colors = RDPColors.Colors16Bit,
- Sounds = RDPSounds.DoNotPlay,
- Resolution = RDPResolutions.FitToWindow,
- Port = 3389
- }
-
- public enum RDPColors
- {
+
+ public enum Defaults
+ {
+ Colors = RDPColors.Colors16Bit,
+ Sounds = RDPSounds.DoNotPlay,
+ Resolution = RDPResolutions.FitToWindow,
+ Port = 3389
+ }
+
+ public enum RDPColors
+ {
[LocalizedAttributes.LocalizedDescription("strRDP256Colors")]
Colors256 = 8,
+
[LocalizedAttributes.LocalizedDescription("strRDP32768Colors")]
Colors15Bit = 15,
+
[LocalizedAttributes.LocalizedDescription("strRDP65536Colors")]
Colors16Bit = 16,
+
[LocalizedAttributes.LocalizedDescription("strRDP16777216Colors")]
Colors24Bit = 24,
+
[LocalizedAttributes.LocalizedDescription("strRDP4294967296Colors")]
Colors32Bit = 32
- }
-
- public enum RDPSounds
- {
+ }
+
+ public enum RDPSounds
+ {
[LocalizedAttributes.LocalizedDescription("strRDPSoundBringToThisComputer")]
BringToThisComputer = 0,
+
[LocalizedAttributes.LocalizedDescription("strRDPSoundLeaveAtRemoteComputer")]
LeaveAtRemoteComputer = 1,
+
[LocalizedAttributes.LocalizedDescription("strRDPSoundDoNotPlay")]
DoNotPlay = 2
- }
+ }
- public enum RDPSoundQuality
- {
+ public enum RDPSoundQuality
+ {
[LocalizedAttributes.LocalizedDescription("strRDPSoundQualityDynamic")]
Dynamic = 0,
+
[LocalizedAttributes.LocalizedDescription("strRDPSoundQualityMedium")]
Medium = 1,
+
[LocalizedAttributes.LocalizedDescription("strRDPSoundQualityHigh")]
High = 2
}
private enum RDPPerformanceFlags
- {
- [Description("strRDPDisableWallpaper")]DisableWallpaper = 0x1,
+ {
+ [Description("strRDPDisableWallpaper")]
+ DisableWallpaper = 0x1,
+
// [Description("strRDPDisableFullWindowdrag")]DisableFullWindowDrag = 0x2,
// [Description("strRDPDisableMenuAnimations")]DisableMenuAnimations = 0x4,
- [Description("strRDPDisableThemes")]DisableThemes = 0x8,
+ [Description("strRDPDisableThemes")] DisableThemes = 0x8,
+
// [Description("strRDPDisableCursorShadow")]DisableCursorShadow = 0x20,
// [Description("strRDPDisableCursorblinking")]DisableCursorBlinking = 0x40,
- [Description("strRDPEnableFontSmoothing")]EnableFontSmoothing = 0x80,
- [Description("strRDPEnableDesktopComposition")]EnableDesktopComposition = 0x100
- }
+ [Description("strRDPEnableFontSmoothing")]
+ EnableFontSmoothing = 0x80,
+
+ [Description("strRDPEnableDesktopComposition")]
+ EnableDesktopComposition = 0x100
+ }
public enum RDPResolutions
{
[LocalizedAttributes.LocalizedDescription("strRDPFitToPanel")]
FitToWindow,
+
[LocalizedAttributes.LocalizedDescription("strFullscreen")]
Fullscreen,
+
[LocalizedAttributes.LocalizedDescription("strRDPSmartSize")]
SmartSize,
- [Description("800x600")]
- Res800x600,
- [Description("1024x768")]
- Res1024x768,
- [Description("1152x864")]
- Res1152x864,
- [Description("1280x800")]
- Res1280x800,
- [Description("1280x1024")]
- Res1280x1024,
- [Description("1366x768")]
- Res1366x768,
- [Description("1440x900")]
- Res1440x900,
- [Description("1600x900")]
- Res1600x900,
- [Description("1600x1200")]
- Res1600x1200,
- [Description("1680x1050")]
- Res1680x1050,
- [Description("1920x1080")]
- Res1920x1080,
- [Description("1920x1200")]
- Res1920x1200,
- [Description("2048x1536")]
- Res2048x1536,
- [Description("2560x1440")]
- Res2560x1440,
- [Description("2560x1600")]
- Res2560x1600,
- [Description("2560x2048")]
- Res2560x2048,
- [Description("3840x2160")]
- Res3840x2160
+ [Description("800x600")] Res800x600,
+ [Description("1024x768")] Res1024x768,
+ [Description("1152x864")] Res1152x864,
+ [Description("1280x800")] Res1280x800,
+ [Description("1280x1024")] Res1280x1024,
+ [Description("1366x768")] Res1366x768,
+ [Description("1440x900")] Res1440x900,
+ [Description("1600x900")] Res1600x900,
+ [Description("1600x1200")] Res1600x1200,
+ [Description("1680x1050")] Res1680x1050,
+ [Description("1920x1080")] Res1920x1080,
+ [Description("1920x1200")] Res1920x1200,
+ [Description("2048x1536")] Res2048x1536,
+ [Description("2560x1440")] Res2560x1440,
+ [Description("2560x1600")] Res2560x1600,
+ [Description("2560x2048")] Res2560x2048,
+ [Description("3840x2160")] Res3840x2160
}
public enum AuthenticationLevel
- {
+ {
[LocalizedAttributes.LocalizedDescription("strAlwaysConnectEvenIfAuthFails")]
NoAuth = 0,
+
[LocalizedAttributes.LocalizedDescription("strDontConnectWhenAuthFails")]
AuthRequired = 1,
+
[LocalizedAttributes.LocalizedDescription("strWarnIfAuthFails")]
WarnOnFailedAuth = 2
- }
-
- public enum RDGatewayUsageMethod
- {
+ }
+
+ public enum RDGatewayUsageMethod
+ {
[LocalizedAttributes.LocalizedDescription("strNever")]
Never = 0, // TSC_PROXY_MODE_NONE_DIRECT
+
[LocalizedAttributes.LocalizedDescription("strAlways")]
Always = 1, // TSC_PROXY_MODE_DIRECT
+
[LocalizedAttributes.LocalizedDescription("strDetect")]
Detect = 2 // TSC_PROXY_MODE_DETECT
- }
-
- public enum RDGatewayUseConnectionCredentials
- {
+ }
+
+ public enum RDGatewayUseConnectionCredentials
+ {
[LocalizedAttributes.LocalizedDescription("strUseDifferentUsernameAndPassword")]
No = 0,
+
[LocalizedAttributes.LocalizedDescription("strUseSameUsernameAndPassword")]
Yes = 1,
+
[LocalizedAttributes.LocalizedDescription("strUseSmartCard")]
SmartCard = 2
- }
+ }
+
#endregion
-
+
#region Resolution
- public static Rectangle GetResolutionRectangle(RDPResolutions resolution)
- {
- string[] resolutionParts = null;
- if (resolution != RDPResolutions.FitToWindow & resolution != RDPResolutions.Fullscreen & resolution != RDPResolutions.SmartSize)
- {
- resolutionParts = resolution.ToString().Replace("Res", "").Split('x');
- }
- if (resolutionParts == null || resolutionParts.Length != 2)
- {
- return new Rectangle(0, 0, 0, 0);
- }
- else
- {
+
+ public static Rectangle GetResolutionRectangle(RDPResolutions resolution)
+ {
+ string[] resolutionParts = null;
+ if (resolution != RDPResolutions.FitToWindow & resolution != RDPResolutions.Fullscreen &
+ resolution != RDPResolutions.SmartSize)
+ {
+ resolutionParts = resolution.ToString().Replace("Res", "").Split('x');
+ }
+
+ if (resolutionParts == null || resolutionParts.Length != 2)
+ {
+ return new Rectangle(0, 0, 0, 0);
+ }
+ else
+ {
return new Rectangle(0, 0, Convert.ToInt32(resolutionParts[0]), Convert.ToInt32(resolutionParts[1]));
- }
- }
+ }
+ }
+
#endregion
public static class Versions
- {
- public static readonly Version RDC60 = new Version(6, 0, 6000);
- public static readonly Version RDC61 = new Version(6, 0, 6001);
- public static readonly Version RDC70 = new Version(6, 1, 7600);
- public static readonly Version RDC80 = new Version(6, 2, 9200);
+ {
+ public static readonly Version RDC60 = new Version(6, 0, 6000);
+ public static readonly Version RDC61 = new Version(6, 0, 6001);
+ public static readonly Version RDC70 = new Version(6, 1, 7600);
+ public static readonly Version RDC80 = new Version(6, 2, 9200);
public static readonly Version RDC81 = new Version(6, 3, 9600);
- }
-
+ }
+
#region Reconnect Stuff
- public void tmrReconnect_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
- {
- try
- {
- var srvReady = PortScanner.IsPortOpen(_connectionInfo.Hostname, Convert.ToString(_connectionInfo.Port));
-
- ReconnectGroup.ServerReady = srvReady;
+
+ public void tmrReconnect_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+ {
+ try
+ {
+ var srvReady = PortScanner.IsPortOpen(_connectionInfo.Hostname, Convert.ToString(_connectionInfo.Port));
+
+ ReconnectGroup.ServerReady = srvReady;
if (!ReconnectGroup.ReconnectWhenReady || !srvReady) return;
tmrReconnect.Enabled = false;
@@ -875,12 +927,15 @@ namespace mRemoteNG.Connection.Protocol.RDP
//SetProps()
_rdpClient.Connect();
}
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddExceptionMessage(string.Format(Language.AutomaticReconnectError, _connectionInfo.Hostname),
- ex, MessageClass.WarningMsg, false);
- }
- }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddExceptionMessage(
+ string.Format(Language.AutomaticReconnectError,
+ _connectionInfo.Hostname),
+ ex, MessageClass.WarningMsg, false);
+ }
+ }
+
#endregion
- }
+ }
}
diff --git a/mRemoteV1/Connection/Protocol/Rlogin/Connection.Protocol.Rlogin.cs b/mRemoteV1/Connection/Protocol/Rlogin/Connection.Protocol.Rlogin.cs
index 6a8b187b..e3fcba19 100644
--- a/mRemoteV1/Connection/Protocol/Rlogin/Connection.Protocol.Rlogin.cs
+++ b/mRemoteV1/Connection/Protocol/Rlogin/Connection.Protocol.Rlogin.cs
@@ -1,16 +1,15 @@
namespace mRemoteNG.Connection.Protocol.Rlogin
{
- public class ProtocolRlogin : PuttyBase
- {
-
- public ProtocolRlogin()
- {
- this.PuttyProtocol = Putty_Protocol.rlogin;
- }
-
- public enum Defaults
- {
- Port = 513
- }
- }
+ public class ProtocolRlogin : PuttyBase
+ {
+ public ProtocolRlogin()
+ {
+ this.PuttyProtocol = Putty_Protocol.rlogin;
+ }
+
+ public enum Defaults
+ {
+ Port = 513
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH1.cs b/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH1.cs
index 53d59a28..8472308d 100644
--- a/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH1.cs
+++ b/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH1.cs
@@ -1,19 +1,16 @@
-
-
namespace mRemoteNG.Connection.Protocol.SSH
{
- public class ProtocolSSH1 : PuttyBase
- {
-
- public ProtocolSSH1()
- {
- this.PuttyProtocol = Putty_Protocol.ssh;
- this.PuttySSHVersion = Putty_SSHVersion.ssh1;
- }
-
- public enum Defaults
- {
- Port = 22
- }
- }
-}
+ public class ProtocolSSH1 : PuttyBase
+ {
+ public ProtocolSSH1()
+ {
+ PuttyProtocol = Putty_Protocol.ssh;
+ PuttySSHVersion = Putty_SSHVersion.ssh1;
+ }
+
+ public enum Defaults
+ {
+ Port = 22
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH2.cs b/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH2.cs
index 2fa12b4f..d05c40fe 100644
--- a/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH2.cs
+++ b/mRemoteV1/Connection/Protocol/SSH/Connection.Protocol.SSH2.cs
@@ -1,17 +1,16 @@
namespace mRemoteNG.Connection.Protocol.SSH
{
- public class ProtocolSSH2 : PuttyBase
- {
-
- public ProtocolSSH2()
- {
- this.PuttyProtocol = Putty_Protocol.ssh;
- this.PuttySSHVersion = Putty_SSHVersion.ssh2;
- }
-
- public enum Defaults
- {
- Port = 22
- }
- }
-}
+ public class ProtocolSSH2 : PuttyBase
+ {
+ public ProtocolSSH2()
+ {
+ PuttyProtocol = Putty_Protocol.ssh;
+ PuttySSHVersion = Putty_SSHVersion.ssh2;
+ }
+
+ public enum Defaults
+ {
+ Port = 22
+ }
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/Serial/Connection.Protocol.Serial.cs b/mRemoteV1/Connection/Protocol/Serial/Connection.Protocol.Serial.cs
index 9e8d2ffd..0f4ca94d 100644
--- a/mRemoteV1/Connection/Protocol/Serial/Connection.Protocol.Serial.cs
+++ b/mRemoteV1/Connection/Protocol/Serial/Connection.Protocol.Serial.cs
@@ -1,16 +1,15 @@
namespace mRemoteNG.Connection.Protocol.Serial
{
- public class ProtocolSerial : PuttyBase
- {
-
- public ProtocolSerial()
- {
- this.PuttyProtocol = Putty_Protocol.serial;
- }
-
- public enum Defaults
- {
- Port = 9600
- }
- }
+ public class ProtocolSerial : PuttyBase
+ {
+ public ProtocolSerial()
+ {
+ this.PuttyProtocol = Putty_Protocol.serial;
+ }
+
+ public enum Defaults
+ {
+ Port = 9600
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/Telnet/Connection.Protocol.Telnet.cs b/mRemoteV1/Connection/Protocol/Telnet/Connection.Protocol.Telnet.cs
index 7fc93cbf..6f891c07 100644
--- a/mRemoteV1/Connection/Protocol/Telnet/Connection.Protocol.Telnet.cs
+++ b/mRemoteV1/Connection/Protocol/Telnet/Connection.Protocol.Telnet.cs
@@ -1,16 +1,15 @@
namespace mRemoteNG.Connection.Protocol.Telnet
{
- public class ProtocolTelnet : PuttyBase
- {
-
- public ProtocolTelnet()
- {
- this.PuttyProtocol = Putty_Protocol.telnet;
- }
-
- public enum Defaults
- {
- Port = 23
- }
- }
+ public class ProtocolTelnet : PuttyBase
+ {
+ public ProtocolTelnet()
+ {
+ this.PuttyProtocol = Putty_Protocol.telnet;
+ }
+
+ public enum Defaults
+ {
+ Port = 23
+ }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs
index d5eed46a..fc5ad63f 100644
--- a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs
+++ b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs
@@ -11,274 +11,307 @@ using System.ComponentModel;
namespace mRemoteNG.Connection.Protocol.VNC
{
public class ProtocolVNC : ProtocolBase
- {
+ {
#region Properties
+
public bool SmartSize
{
get { return _VNC.Scaled; }
set { _VNC.Scaled = value; }
}
- public bool ViewOnly
- {
- get { return _VNC.ViewOnly; }
- set { _VNC.ViewOnly = value; }
- }
+ public bool ViewOnly
+ {
+ get { return _VNC.ViewOnly; }
+ set { _VNC.ViewOnly = value; }
+ }
- #endregion
-
- #region Private Declarations
- private VncSharp.RemoteDesktop _VNC;
- private ConnectionInfo Info;
#endregion
-
+
+ #region Private Declarations
+
+ private VncSharp.RemoteDesktop _VNC;
+ private ConnectionInfo Info;
+
+ #endregion
+
#region Public Methods
- public ProtocolVNC()
- {
- Control = new VncSharp.RemoteDesktop();
- }
-
- public override bool Initialize()
- {
- base.Initialize();
-
- try
- {
+
+ public ProtocolVNC()
+ {
+ Control = new VncSharp.RemoteDesktop();
+ }
+
+ public override bool Initialize()
+ {
+ base.Initialize();
+
+ try
+ {
_VNC = (VncSharp.RemoteDesktop)Control;
-
- Info = InterfaceControl.Info;
-
- _VNC.VncPort = Info.Port;
+
+ Info = InterfaceControl.Info;
+
+ _VNC.VncPort = Info.Port;
return true;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetPropsFailed + Environment.NewLine + ex.Message, true);
- return false;
- }
- }
-
- public override bool Connect()
- {
- SetEventHandlers();
-
- try
- {
- _VNC.Connect(Info.Hostname, Info.VNCViewOnly, Info.VNCSmartSizeMode != SmartSizeMode.SmartSNo);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strConnectionOpenFailed + Environment.NewLine + ex.Message);
- return false;
- }
-
- return true;
- }
-
- public override void Disconnect()
- {
- try
- {
- _VNC.Disconnect();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncConnectionDisconnectFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- public void SendSpecialKeys(SpecialKeys Keys)
- {
- try
- {
- // ReSharper disable once SwitchStatementMissingSomeCases
- switch (Keys)
- {
- case SpecialKeys.CtrlAltDel:
- _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlAltDel);
- break;
- case SpecialKeys.CtrlEsc:
- _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlEsc);
- break;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSendSpecialKeysFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- public void ToggleSmartSize()
- {
- try
- {
- SmartSize = !SmartSize;
- RefreshScreen();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncToggleSmartSizeFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
- public void ToggleViewOnly()
- {
- try
- {
- ViewOnly = !ViewOnly;
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncToggleViewOnlyFailed + Environment.NewLine + ex.Message, true);
- }
- }
-
-
- public void StartChat()
- {
- throw new NotImplementedException();
- }
-
- public void StartFileTransfer()
- {
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncSetPropsFailed + Environment.NewLine + ex.Message,
+ true);
+ return false;
+ }
+ }
+
+ public override bool Connect()
+ {
+ SetEventHandlers();
+
+ try
+ {
+ _VNC.Connect(Info.Hostname, Info.VNCViewOnly, Info.VNCSmartSizeMode != SmartSizeMode.SmartSNo);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strConnectionOpenFailed + Environment.NewLine +
+ ex.Message);
+ return false;
+ }
+
+ return true;
+ }
+
+ public override void Disconnect()
+ {
+ try
+ {
+ _VNC.Disconnect();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncConnectionDisconnectFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ public void SendSpecialKeys(SpecialKeys Keys)
+ {
+ try
+ {
+ // ReSharper disable once SwitchStatementMissingSomeCases
+ switch (Keys)
+ {
+ case SpecialKeys.CtrlAltDel:
+ _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlAltDel);
+ break;
+ case SpecialKeys.CtrlEsc:
+ _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlEsc);
+ break;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncSendSpecialKeysFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ public void ToggleSmartSize()
+ {
+ try
+ {
+ SmartSize = !SmartSize;
+ RefreshScreen();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncToggleSmartSizeFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ public void ToggleViewOnly()
+ {
+ try
+ {
+ ViewOnly = !ViewOnly;
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncToggleViewOnlyFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+
+ public void StartChat()
+ {
throw new NotImplementedException();
}
-
- public void RefreshScreen()
- {
- try
- {
- _VNC.FullScreenUpdate();
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncRefreshFailed + Environment.NewLine + ex.Message, true);
- }
- }
- #endregion
-
- #region Private Methods
- private void SetEventHandlers()
- {
- try
- {
- _VNC.ConnectComplete += VNCEvent_Connected;
- _VNC.ConnectionLost += VNCEvent_Disconnected;
- FrmMain.ClipboardChanged += VNCEvent_ClipboardChanged;
- if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials) && Info?.CredentialRecord?.Password?.Length > 0)
- {
- _VNC.GetPassword = VNCEvent_Authenticate;
- }
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetEventHandlersFailed + Environment.NewLine + ex.Message, true);
- }
- }
- #endregion
-
- #region Private Events & Handlers
- private void VNCEvent_Connected(object sender, EventArgs e)
- {
- Event_Connected(this);
- _VNC.AutoScroll = Info.VNCSmartSizeMode == SmartSizeMode.SmartSNo;
- }
-
- private void VNCEvent_Disconnected(object sender, EventArgs e)
- {
- FrmMain.ClipboardChanged -= VNCEvent_ClipboardChanged;
- Event_Disconnected(sender, @"VncSharp Disconnected.", null);
- Close();
- }
-
- private void VNCEvent_ClipboardChanged()
- {
- _VNC.FillServerClipboard();
- }
-
- private string VNCEvent_Authenticate()
- {
- return Info.CredentialRecord.Password.ConvertToUnsecureString();
- }
- #endregion
-
+ public void StartFileTransfer()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void RefreshScreen()
+ {
+ try
+ {
+ _VNC.FullScreenUpdate();
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncRefreshFailed + Environment.NewLine + ex.Message,
+ true);
+ }
+ }
+
+ #endregion
+
+ #region Private Methods
+
+ private void SetEventHandlers()
+ {
+ try
+ {
+ _VNC.ConnectComplete += VNCEvent_Connected;
+ _VNC.ConnectionLost += VNCEvent_Disconnected;
+ FrmMain.ClipboardChanged += VNCEvent_ClipboardChanged;
+ if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials) && Info?.CredentialRecord?.Password?.Length > 0)
+ {
+ _VNC.GetPassword = VNCEvent_Authenticate;
+ }
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
+ Language.strVncSetEventHandlersFailed + Environment.NewLine +
+ ex.Message, true);
+ }
+ }
+
+ #endregion
+
+ #region Private Events & Handlers
+
+ private void VNCEvent_Connected(object sender, EventArgs e)
+ {
+ Event_Connected(this);
+ _VNC.AutoScroll = Info.VNCSmartSizeMode == SmartSizeMode.SmartSNo;
+ }
+
+ private void VNCEvent_Disconnected(object sender, EventArgs e)
+ {
+ FrmMain.ClipboardChanged -= VNCEvent_ClipboardChanged;
+ Event_Disconnected(sender, @"VncSharp Disconnected.", null);
+ Close();
+ }
+
+ private void VNCEvent_ClipboardChanged()
+ {
+ _VNC.FillServerClipboard();
+ }
+
+ private string VNCEvent_Authenticate()
+ {
+ return Info.CredentialRecord.Password.ConvertToUnsecureString();
+ }
+
+ #endregion
+
#region Enums
- public enum Defaults
- {
- Port = 5900
- }
-
- public enum SpecialKeys
- {
- CtrlAltDel,
- CtrlEsc
- }
-
- public enum Compression
- {
- [LocalizedAttributes.LocalizedDescription("strNoCompression")]CompNone = 99,
- [Description("0")]Comp0 = 0,
- [Description("1")]Comp1 = 1,
- [Description("2")]Comp2 = 2,
- [Description("3")]Comp3 = 3,
- [Description("4")]Comp4 = 4,
- [Description("5")]Comp5 = 5,
- [Description("6")]Comp6 = 6,
- [Description("7")]Comp7 = 7,
- [Description("8")]Comp8 = 8,
- [Description("9")]Comp9 = 9
- }
-
- public enum Encoding
- {
- [Description("Raw")]EncRaw,
- [Description("RRE")]EncRRE,
- [Description("CoRRE")]EncCorre,
- [Description("Hextile")]EncHextile,
- [Description("Zlib")]EncZlib,
- [Description("Tight")]EncTight,
- [Description("ZlibHex")]EncZLibHex,
- [Description("ZRLE")]EncZRLE
- }
-
- public enum AuthMode
- {
+
+ public enum Defaults
+ {
+ Port = 5900
+ }
+
+ public enum SpecialKeys
+ {
+ CtrlAltDel,
+ CtrlEsc
+ }
+
+ public enum Compression
+ {
+ [LocalizedAttributes.LocalizedDescription("strNoCompression")]
+ CompNone = 99,
+ [Description("0")] Comp0 = 0,
+ [Description("1")] Comp1 = 1,
+ [Description("2")] Comp2 = 2,
+ [Description("3")] Comp3 = 3,
+ [Description("4")] Comp4 = 4,
+ [Description("5")] Comp5 = 5,
+ [Description("6")] Comp6 = 6,
+ [Description("7")] Comp7 = 7,
+ [Description("8")] Comp8 = 8,
+ [Description("9")] Comp9 = 9
+ }
+
+ public enum Encoding
+ {
+ [Description("Raw")] EncRaw,
+ [Description("RRE")] EncRRE,
+ [Description("CoRRE")] EncCorre,
+ [Description("Hextile")] EncHextile,
+ [Description("Zlib")] EncZlib,
+ [Description("Tight")] EncTight,
+ [Description("ZlibHex")] EncZLibHex,
+ [Description("ZRLE")] EncZRLE
+ }
+
+ public enum AuthMode
+ {
[LocalizedAttributes.LocalizedDescription("VNC")]
AuthVNC,
+
[LocalizedAttributes.LocalizedDescription("Windows")]
AuthWin
- }
-
- public enum ProxyType
- {
+ }
+
+ public enum ProxyType
+ {
[LocalizedAttributes.LocalizedDescription("strNone")]
ProxyNone,
+
[LocalizedAttributes.LocalizedDescription("strHttp")]
ProxyHTTP,
+
[LocalizedAttributes.LocalizedDescription("strSocks5")]
ProxySocks5,
+
[LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
ProxyUltra
- }
-
- public enum Colors
- {
+ }
+
+ public enum Colors
+ {
[LocalizedAttributes.LocalizedDescription("strNormal")]
ColNormal,
- [Description("8-bit")]Col8Bit
- }
-
- public enum SmartSizeMode
- {
+ [Description("8-bit")] Col8Bit
+ }
+
+ public enum SmartSizeMode
+ {
[LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
SmartSNo,
+
[LocalizedAttributes.LocalizedDescription("strFree")]
SmartSFree,
+
[LocalizedAttributes.LocalizedDescription("strAspect")]
SmartSAspect
- }
+ }
+
#endregion
- }
+ }
}
diff --git a/mRemoteV1/Connection/Protocol/VNC/VNCEnum.cs b/mRemoteV1/Connection/Protocol/VNC/VNCEnum.cs
index c7267613..0ff96f11 100644
--- a/mRemoteV1/Connection/Protocol/VNC/VNCEnum.cs
+++ b/mRemoteV1/Connection/Protocol/VNC/VNCEnum.cs
@@ -4,77 +4,84 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol.VNC
{
public enum Defaults
- {
- Port = 5900
- }
-
- public enum SpecialKeys
- {
- CtrlAltDel,
- CtrlEsc
- }
-
- public enum Compression
- {
- [LocalizedAttributes.LocalizedDescription("strNoCompression")]CompNone = 99,
- [Description("0")]Comp0 = 0,
- [Description("1")]Comp1 = 1,
- [Description("2")]Comp2 = 2,
- [Description("3")]Comp3 = 3,
- [Description("4")]Comp4 = 4,
- [Description("5")]Comp5 = 5,
- [Description("6")]Comp6 = 6,
- [Description("7")]Comp7 = 7,
- [Description("8")]Comp8 = 8,
- [Description("9")]Comp9 = 9
- }
-
- public enum Encoding
- {
- [Description("Raw")]EncRaw,
- [Description("RRE")]EncRRE,
- [Description("CoRRE")]EncCorre,
- [Description("Hextile")]EncHextile,
- [Description("Zlib")]EncZlib,
- [Description("Tight")]EncTight,
- [Description("ZlibHex")]EncZLibHex,
- [Description("ZRLE")]EncZRLE
- }
-
- public enum AuthMode
- {
- [LocalizedAttributes.LocalizedDescription("VNC")]
- AuthVNC,
- [LocalizedAttributes.LocalizedDescription("Windows")]
- AuthWin
- }
-
- public enum ProxyType
- {
- [LocalizedAttributes.LocalizedDescription("strNone")]
- ProxyNone,
- [LocalizedAttributes.LocalizedDescription("strHttp")]
- ProxyHTTP,
- [LocalizedAttributes.LocalizedDescription("strSocks5")]
- ProxySocks5,
- [LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
- ProxyUltra
- }
-
- public enum Colors
- {
- [LocalizedAttributes.LocalizedDescription("strNormal")]
- ColNormal,
- [Description("8-bit")]Col8Bit
- }
-
- public enum SmartSizeMode
- {
- [LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
- SmartSNo,
- [LocalizedAttributes.LocalizedDescription("strFree")]
- SmartSFree,
- [LocalizedAttributes.LocalizedDescription("strAspect")]
- SmartSAspect
- }
-}
+ {
+ Port = 5900
+ }
+
+ public enum SpecialKeys
+ {
+ CtrlAltDel,
+ CtrlEsc
+ }
+
+ public enum Compression
+ {
+ [LocalizedAttributes.LocalizedDescription("strNoCompression")]
+ CompNone = 99,
+ [Description("0")] Comp0 = 0,
+ [Description("1")] Comp1 = 1,
+ [Description("2")] Comp2 = 2,
+ [Description("3")] Comp3 = 3,
+ [Description("4")] Comp4 = 4,
+ [Description("5")] Comp5 = 5,
+ [Description("6")] Comp6 = 6,
+ [Description("7")] Comp7 = 7,
+ [Description("8")] Comp8 = 8,
+ [Description("9")] Comp9 = 9
+ }
+
+ public enum Encoding
+ {
+ [Description("Raw")] EncRaw,
+ [Description("RRE")] EncRRE,
+ [Description("CoRRE")] EncCorre,
+ [Description("Hextile")] EncHextile,
+ [Description("Zlib")] EncZlib,
+ [Description("Tight")] EncTight,
+ [Description("ZlibHex")] EncZLibHex,
+ [Description("ZRLE")] EncZRLE
+ }
+
+ public enum AuthMode
+ {
+ [LocalizedAttributes.LocalizedDescription("VNC")]
+ AuthVNC,
+
+ [LocalizedAttributes.LocalizedDescription("Windows")]
+ AuthWin
+ }
+
+ public enum ProxyType
+ {
+ [LocalizedAttributes.LocalizedDescription("strNone")]
+ ProxyNone,
+
+ [LocalizedAttributes.LocalizedDescription("strHttp")]
+ ProxyHTTP,
+
+ [LocalizedAttributes.LocalizedDescription("strSocks5")]
+ ProxySocks5,
+
+ [LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
+ ProxyUltra
+ }
+
+ public enum Colors
+ {
+ [LocalizedAttributes.LocalizedDescription("strNormal")]
+ ColNormal,
+ [Description("8-bit")] Col8Bit
+ }
+
+ public enum SmartSizeMode
+ {
+ [LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
+ SmartSNo,
+
+ [LocalizedAttributes.LocalizedDescription("strFree")]
+ SmartSFree,
+
+ [LocalizedAttributes.LocalizedDescription("strAspect")]
+ SmartSAspect
+ }
+}
\ No newline at end of file
diff --git a/mRemoteV1/Connection/PuttySessionInfo.cs b/mRemoteV1/Connection/PuttySessionInfo.cs
index 4578f0ba..03ca7d88 100644
--- a/mRemoteV1/Connection/PuttySessionInfo.cs
+++ b/mRemoteV1/Connection/PuttySessionInfo.cs
@@ -11,19 +11,16 @@ using System.ComponentModel;
namespace mRemoteNG.Connection
{
public sealed class PuttySessionInfo : ConnectionInfo, IComponent
- {
+ {
#region Properties
- [Browsable(false)]
- public RootPuttySessionsNodeInfo RootRootPuttySessionsInfo { get; set; }
- [ReadOnly(true)]
- public override string PuttySession { get; set; }
+ [Browsable(false)] public RootPuttySessionsNodeInfo RootRootPuttySessionsInfo { get; set; }
- [ReadOnly(true)]
- public override string Name { get; set; }
+ [ReadOnly(true)] public override string PuttySession { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string Description { get; set; }
+ [ReadOnly(true)] public override string Name { get; set; }
+
+ [ReadOnly(true), Browsable(false)] public override string Description { get; set; }
[ReadOnly(true), Browsable(false)]
public override string Icon
@@ -39,56 +36,52 @@ namespace mRemoteNG.Connection
set { }
}
- [ReadOnly(true)]
- public override string Hostname { get; set; }
+ [ReadOnly(true)] public override string Hostname { get; set; }
- [ReadOnly(true)]
- public override string Username { get; set; }
+ [ReadOnly(true)] public override string Username { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string Password { get; set; }
+ [ReadOnly(true), Browsable(false)] public override string Password { get; set; }
- [ReadOnly(true)]
- public override ProtocolType Protocol { get; set; }
+ [ReadOnly(true)] public override ProtocolType Protocol { get; set; }
- [ReadOnly(true)]
- public override int Port { get; set; }
+ [ReadOnly(true)] public override int Port { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string PreExtApp { get; set; }
+ [ReadOnly(true), Browsable(false)] public override string PreExtApp { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string PostExtApp { get; set; }
+ [ReadOnly(true), Browsable(false)] public override string PostExtApp { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string MacAddress { get; set; }
+ [ReadOnly(true), Browsable(false)] public override string MacAddress { get; set; }
+
+ [ReadOnly(true), Browsable(false)] public override string UserField { get; set; }
- [ReadOnly(true), Browsable(false)]
- public override string UserField { get; set; }
#endregion
- [Command(),LocalizedAttributes.LocalizedDisplayName("strPuttySessionSettings")]
+ [Command(), LocalizedAttributes.LocalizedDisplayName("strPuttySessionSettings")]
public void SessionSettings()
- {
- try
- {
- var puttyProcess = new PuttyProcessController();
- if (!puttyProcess.Start())
- {
- return;
- }
- if (puttyProcess.SelectListBoxItem(PuttySession))
- {
- puttyProcess.ClickButton("&Load");
- }
- puttyProcess.SetControlText("Button", "&Cancel", "&Close");
- puttyProcess.SetControlVisible("Button", "&Open", false);
- }
- catch (Exception ex)
- {
- Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorCouldNotLaunchPutty + Environment.NewLine + ex.Message);
- }
- }
+ {
+ try
+ {
+ var puttyProcess = new PuttyProcessController();
+ if (!puttyProcess.Start())
+ {
+ return;
+ }
+
+ if (puttyProcess.SelectListBoxItem(PuttySession))
+ {
+ puttyProcess.ClickButton("&Load");
+ }
+
+ puttyProcess.SetControlText("Button", "&Cancel", "&Close");
+ puttyProcess.SetControlVisible("Button", "&Open", false);
+ }
+ catch (Exception ex)
+ {
+ Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
+ Language.strErrorCouldNotLaunchPutty + Environment.NewLine +
+ ex.Message);
+ }
+ }
public override TreeNodeType GetTreeNodeType()
{
@@ -96,19 +89,21 @@ namespace mRemoteNG.Connection
}
#region IComponent
+
[Browsable(false)]
public ISite Site
- {
- get => new PropertyGridCommandSite(this);
+ {
+ get => new PropertyGridCommandSite(this);
set => throw (new NotImplementedException());
}
public void Dispose()
- {
+ {
Disposed?.Invoke(this, EventArgs.Empty);
}
public event EventHandler Disposed;
+
#endregion
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Container/ContainerInfo.cs b/mRemoteV1/Container/ContainerInfo.cs
index 989fc911..69c9c1dd 100644
--- a/mRemoteV1/Container/ContainerInfo.cs
+++ b/mRemoteV1/Container/ContainerInfo.cs
@@ -9,34 +9,37 @@ using mRemoteNG.Tree;
namespace mRemoteNG.Container
{
- [DefaultProperty("Name")]
+ [DefaultProperty("Name")]
public class ContainerInfo : ConnectionInfo, INotifyCollectionChanged
- {
- private bool _isExpanded;
+ {
+ private bool _isExpanded;
- [Browsable(false)]
- public List Children { get; } = new List();
+ [Browsable(false)] public List Children { get; } = new List();
- [Category(""), Browsable(false), ReadOnly(false), Bindable(false), DefaultValue(""), DesignOnly(false)]
- public bool IsExpanded
- {
- get => _isExpanded;
- set => SetField(ref _isExpanded, value, "IsExpanded");
- }
+ [Category(""), Browsable(false), ReadOnly(false), Bindable(false), DefaultValue(""), DesignOnly(false)]
+ public bool IsExpanded
+ {
+ get => _isExpanded;
+ set => SetField(ref _isExpanded, value, "IsExpanded");
+ }
- [Browsable(false)]
- public override bool IsContainer { get { return true; } set {} }
+ [Browsable(false)]
+ public override bool IsContainer
+ {
+ get { return true; }
+ set { }
+ }
- public ContainerInfo(string uniqueId)
- : base(uniqueId)
+ public ContainerInfo(string uniqueId)
+ : base(uniqueId)
{
SetDefaults();
}
- public ContainerInfo()
- : this(Guid.NewGuid().ToString())
- {
- }
+ public ContainerInfo()
+ : this(Guid.NewGuid().ToString())
+ {
+ }
public override TreeNodeType GetTreeNodeType()
{
@@ -76,7 +79,9 @@ namespace mRemoteNG.Container
newChildItem.Parent = this;
Children.Insert(index, newChildItem);
SubscribeToChildEvents(newChildItem);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, newChildItem));
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add,
+ newChildItem));
}
public void AddChildRange(IEnumerable newChildren)
@@ -93,7 +98,9 @@ namespace mRemoteNG.Container
removalTarget.Parent = null;
Children.Remove(removalTarget);
UnsubscribeToChildEvents(removalTarget);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removalTarget));
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove,
+ removalTarget));
}
public void RemoveChildRange(IEnumerable removalTargets)
@@ -111,7 +118,10 @@ namespace mRemoteNG.Container
Children.Remove(child);
if (newIndex > Children.Count) newIndex = Children.Count;
Children.Insert(newIndex, child);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, child, newIndex, originalIndex));
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, child,
+ newIndex,
+ originalIndex));
}
public void SetChildAbove(ConnectionInfo childToPromote, ConnectionInfo reference)
@@ -161,7 +171,8 @@ namespace mRemoteNG.Container
SortOn(connectionInfo => connectionInfo.Name, sortDirection);
}
- public void SortOn(Func propertyToCompare, ListSortDirection sortDirection = ListSortDirection.Ascending)
+ public void SortOn(Func propertyToCompare,
+ ListSortDirection sortDirection = ListSortDirection.Ascending)
where TProperty : IComparable
{
var connectionComparer = new ConnectionInfoComparer(propertyToCompare)
@@ -169,7 +180,8 @@ namespace mRemoteNG.Container
SortDirection = sortDirection
};
Children.Sort(connectionComparer);
- RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ RaiseCollectionChangedEvent(this,
+ new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
public void SortRecursive(ListSortDirection sortDirection = ListSortDirection.Ascending)
@@ -177,7 +189,8 @@ namespace mRemoteNG.Container
SortOnRecursive(connectionInfo => connectionInfo.Name, sortDirection);
}
- public void SortOnRecursive(Func propertyToCompare, ListSortDirection sortDirection = ListSortDirection.Ascending)
+ public void SortOnRecursive(Func propertyToCompare,
+ ListSortDirection sortDirection = ListSortDirection.Ascending)
where TProperty : IComparable
{
foreach (var child in Children.OfType())
@@ -187,7 +200,7 @@ namespace mRemoteNG.Container
// Deep clone, recursive
public override ConnectionInfo Clone()
- {
+ {
var newContainer = new ContainerInfo();
newContainer.CopyFrom(this);
newContainer.OpenConnections = new ProtocolList();
@@ -198,14 +211,15 @@ namespace mRemoteNG.Container
newChild.RemoveParent();
newContainer.AddChild(newChild);
}
+
return newContainer;
- }
-
- private void SetDefaults()
- {
- Name = "New Folder";
+ }
+
+ private void SetDefaults()
+ {
+ Name = "New Folder";
IsExpanded = true;
- }
+ }
public IEnumerable GetRecursiveChildList()
{
@@ -217,6 +231,7 @@ namespace mRemoteNG.Container
if (childContainer != null)
childList.AddRange(GetRecursiveChildList(childContainer));
}
+
return childList;
}
@@ -230,6 +245,7 @@ namespace mRemoteNG.Container
if (childContainer != null)
childList.AddRange(GetRecursiveChildList(childContainer));
}
+
return childList;
}
@@ -250,9 +266,10 @@ namespace mRemoteNG.Container
}
public event NotifyCollectionChangedEventHandler CollectionChanged;
+
private void RaiseCollectionChangedEvent(object sender, NotifyCollectionChangedEventArgs args)
{
CollectionChanged?.Invoke(sender, args);
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Credential/CredentialDeletionMsgBoxConfirmer.cs b/mRemoteV1/Credential/CredentialDeletionMsgBoxConfirmer.cs
index 7fe3dcd2..f433371d 100644
--- a/mRemoteV1/Credential/CredentialDeletionMsgBoxConfirmer.cs
+++ b/mRemoteV1/Credential/CredentialDeletionMsgBoxConfirmer.cs
@@ -11,7 +11,8 @@ namespace mRemoteNG.Credential
{
private readonly Func _confirmationFunc;
- public CredentialDeletionMsgBoxConfirmer(Func confirmationFunc)
+ public CredentialDeletionMsgBoxConfirmer(
+ Func confirmationFunc)
{
if (confirmationFunc == null)
throw new ArgumentNullException(nameof(confirmationFunc));
@@ -25,18 +26,19 @@ namespace mRemoteNG.Credential
if (targetsArray.Length == 0) return false;
if (targetsArray.Length > 1)
return PromptUser(
- string.Format(
- "Are you sure you want to delete these {0} selected credentials?",
- targetsArray.Length));
+ string.Format(
+ "Are you sure you want to delete these {0} selected credentials?",
+ targetsArray.Length));
return PromptUser(
- string.Format(
- Language.strConfirmDeleteCredentialRecord,
- targetsArray.First().Title));
+ string.Format(
+ Language.strConfirmDeleteCredentialRecord,
+ targetsArray.First().Title));
}
private bool PromptUser(string promptMessage)
{
- var msgBoxResponse = _confirmationFunc.Invoke(promptMessage, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+ var msgBoxResponse = _confirmationFunc.Invoke(promptMessage, Application.ProductName,
+ MessageBoxButtons.YesNo, MessageBoxIcon.Question);
return msgBoxResponse == DialogResult.Yes;
}
}
diff --git a/mRemoteV1/Credential/CredentialRecordTypeConverter.cs b/mRemoteV1/Credential/CredentialRecordTypeConverter.cs
index e19a6d99..df5c1672 100644
--- a/mRemoteV1/Credential/CredentialRecordTypeConverter.cs
+++ b/mRemoteV1/Credential/CredentialRecordTypeConverter.cs
@@ -11,21 +11,24 @@ namespace mRemoteNG.Credential
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
- return sourceType == typeof(Guid) ||
- base.CanConvertFrom(context, sourceType);
+ return sourceType == typeof(Guid) ||
+ base.CanConvertFrom(context, sourceType);
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(Guid) ||
- destinationType == typeof(ICredentialRecord) ||
- base.CanConvertTo(context, destinationType);
+ destinationType == typeof(ICredentialRecord) ||
+ base.CanConvertTo(context, destinationType);
}
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ public override object ConvertTo(ITypeDescriptorContext context,
+ CultureInfo culture,
+ object value,
+ Type destinationType)
{
if (value is ICredentialRecord && destinationType == typeof(Guid))
- return ((ICredentialRecord) value).Id;
+ return ((ICredentialRecord)value).Id;
if (value is ICredentialRecord && destinationType == typeof(ICredentialRecord))
return value;
return base.ConvertTo(context, culture, value, destinationType);
@@ -34,7 +37,8 @@ namespace mRemoteNG.Credential
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (!(value is Guid)) return base.ConvertFrom(context, culture, value);
- var matchedCredentials = Runtime.CredentialService.RepositoryList.GetCredentialRecords().Where(record => record.Id.Equals(value)).ToArray();
+ var matchedCredentials = Runtime.CredentialService.RepositoryList.GetCredentialRecords()
+ .Where(record => record.Id.Equals(value)).ToArray();
return matchedCredentials.Any() ? matchedCredentials.First() : null;
}
}
diff --git a/mRemoteV1/Credential/Repositories/CredentialRepositoryConfig.cs b/mRemoteV1/Credential/Repositories/CredentialRepositoryConfig.cs
index 7a7575bd..1b3575e8 100644
--- a/mRemoteV1/Credential/Repositories/CredentialRepositoryConfig.cs
+++ b/mRemoteV1/Credential/Repositories/CredentialRepositoryConfig.cs
@@ -39,7 +39,7 @@ namespace mRemoteNG.Credential.Repositories
get { return _source; }
set
{
- _source = value;
+ _source = value;
RaisePropertyChangedEvent(nameof(Source));
}
}
@@ -49,7 +49,7 @@ namespace mRemoteNG.Credential.Repositories
get { return _key; }
set
{
- _key = value;
+ _key = value;
RaisePropertyChangedEvent(nameof(Key));
}
}
@@ -74,6 +74,7 @@ namespace mRemoteNG.Credential.Repositories
}
public event PropertyChangedEventHandler PropertyChanged;
+
protected virtual void RaisePropertyChangedEvent(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
diff --git a/mRemoteV1/Credential/Repositories/CredentialRepositoryList.cs b/mRemoteV1/Credential/Repositories/CredentialRepositoryList.cs
index 87552e0d..521ffaf6 100644
--- a/mRemoteV1/Credential/Repositories/CredentialRepositoryList.cs
+++ b/mRemoteV1/Credential/Repositories/CredentialRepositoryList.cs
@@ -22,7 +22,7 @@ namespace mRemoteNG.Credential.Repositories
_credentialProviders.Add(credentialProvider);
credentialProvider.CredentialsUpdated += RaiseCredentialsUpdatedEvent;
credentialProvider.RepositoryConfigUpdated += OnRepoConfigChanged;
- RaiseRepositoriesUpdatedEvent(ActionType.Added, new[] { credentialProvider });
+ RaiseRepositoriesUpdatedEvent(ActionType.Added, new[] {credentialProvider});
}
public void RemoveProvider(ICredentialRepository credentialProvider)
@@ -33,7 +33,7 @@ namespace mRemoteNG.Credential.Repositories
credentialProvider.CredentialsUpdated -= RaiseCredentialsUpdatedEvent;
credentialProvider.RepositoryConfigUpdated -= OnRepoConfigChanged;
_credentialProviders.Remove(credentialProvider);
- RaiseRepositoriesUpdatedEvent(ActionType.Removed, new[] { credentialProvider });
+ RaiseRepositoriesUpdatedEvent(ActionType.Removed, new[] {credentialProvider});
}
public Optional GetProvider(Guid id)
@@ -57,12 +57,14 @@ namespace mRemoteNG.Credential.Repositories
{
list.AddRange(repository.CredentialRecords);
}
+
return list;
}
public ICredentialRecord GetCredentialRecord(Guid id)
{
- return CredentialProviders.SelectMany(repo => repo.CredentialRecords).FirstOrDefault(record => record.Id.Equals(id));
+ return CredentialProviders.SelectMany(repo => repo.CredentialRecords)
+ .FirstOrDefault(record => record.Id.Equals(id));
}
public IEnumerator GetEnumerator()
@@ -80,7 +82,8 @@ namespace mRemoteNG.Credential.Repositories
private void RaiseRepositoriesUpdatedEvent(ActionType action, IEnumerable changedItems)
{
- RepositoriesUpdated?.Invoke(this, new CollectionUpdatedEventArgs(action, changedItems));
+ RepositoriesUpdated?.Invoke(this,
+ new CollectionUpdatedEventArgs(action, changedItems));
}
private void RaiseCredentialsUpdatedEvent(object sender, CollectionUpdatedEventArgs args)
@@ -92,7 +95,7 @@ namespace mRemoteNG.Credential.Repositories
{
var repo = sender as ICredentialRepository;
if (repo == null) return;
- RaiseRepositoriesUpdatedEvent(ActionType.Updated, new[] { repo });
+ RaiseRepositoriesUpdatedEvent(ActionType.Updated, new[] {repo});
}
}
}
\ No newline at end of file
diff --git a/mRemoteV1/Credential/Repositories/XmlCredentialRepository.cs b/mRemoteV1/Credential/Repositories/XmlCredentialRepository.cs
index 864c15d2..a32d2cf1 100644
--- a/mRemoteV1/Credential/Repositories/XmlCredentialRepository.cs
+++ b/mRemoteV1/Credential/Repositories/XmlCredentialRepository.cs
@@ -90,7 +90,8 @@ namespace mRemoteNG.Credential.Repositories
RepositoryConfigUpdated?.Invoke(this, args);
}
- protected virtual void RaiseCredentialsUpdatedEvent(object sender, CollectionUpdatedEventArgs args)
+ protected virtual void RaiseCredentialsUpdatedEvent(object sender,
+ CollectionUpdatedEventArgs args)
{
CredentialsUpdated?.Invoke(this, args);
}
diff --git a/mRemoteV1/Messages/Message.cs b/mRemoteV1/Messages/Message.cs
index 45dc0699..5888e579 100644
--- a/mRemoteV1/Messages/Message.cs
+++ b/mRemoteV1/Messages/Message.cs
@@ -2,12 +2,12 @@ using System;
namespace mRemoteNG.Messages
{
- public class Message : IMessage
- {
- public MessageClass Class { get; set; }
- public string Text { get; set; }
- public DateTime Date { get; set; }
- public bool OnlyLog { get; set; }
+ public class Message : IMessage
+ {
+ public MessageClass Class { get; set; }
+ public string Text { get; set; }
+ public DateTime Date { get; set; }
+ public bool OnlyLog { get; set; }
public Message(MessageClass messageClass, string messageText, bool onlyLog = false)
{
@@ -16,5 +16,5 @@ namespace mRemoteNG.Messages
Date = DateTime.Now;
OnlyLog = onlyLog;
}
- }
+ }
}
\ No newline at end of file
diff --git a/mRemoteV1/Messages/MessageCollector.cs b/mRemoteV1/Messages/MessageCollector.cs
index b156cc12..9a89be74 100644
--- a/mRemoteV1/Messages/MessageCollector.cs
+++ b/mRemoteV1/Messages/MessageCollector.cs
@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
+
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Messages
@@ -26,7 +27,7 @@ namespace mRemoteNG.Messages
public void AddMessage(IMessage message)
{
- AddMessages(new [] {message});
+ AddMessages(new[] {message});
}
public void AddMessages(IEnumerable messages)
@@ -38,18 +39,27 @@ namespace mRemoteNG.Messages
_messageList.Add(message);
newMessages.Add(message);
}
+
if (newMessages.Any())
RaiseCollectionChangedEvent(NotifyCollectionChangedAction.Add, newMessages);
}
- public void AddExceptionMessage(string message, Exception ex, MessageClass msgClass = MessageClass.ErrorMsg, bool logOnly = true)
+ public void AddExceptionMessage(string message,
+ Exception ex,
+ MessageClass msgClass = MessageClass.ErrorMsg,
+ bool logOnly = true)
{
- AddMessage(msgClass, message + Environment.NewLine + Tools.MiscTools.GetExceptionMessageRecursive(ex), logOnly);
+ AddMessage(msgClass, message + Environment.NewLine + Tools.MiscTools.GetExceptionMessageRecursive(ex),
+ logOnly);
}
- public void AddExceptionStackTrace(string message, Exception ex, MessageClass msgClass = MessageClass.ErrorMsg, bool logOnly = true)
+ public void AddExceptionStackTrace(string message,
+ Exception ex,
+ MessageClass msgClass = MessageClass.ErrorMsg,
+ bool logOnly = true)
{
- AddMessage(msgClass, message + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace, logOnly);
+ AddMessage(msgClass, message + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace,
+ logOnly);
}
public void ClearMessages()
diff --git a/mRemoteV1/Messages/MessageWriters/NotificationPanelMessageWriter.cs b/mRemoteV1/Messages/MessageWriters/NotificationPanelMessageWriter.cs
index 7ec99de3..29cb3d44 100644
--- a/mRemoteV1/Messages/MessageWriters/NotificationPanelMessageWriter.cs
+++ b/mRemoteV1/Messages/MessageWriters/NotificationPanelMessageWriter.cs
@@ -26,7 +26,7 @@ namespace mRemoteNG.Messages.MessageWriters
private void AddToList(ListViewItem lvItem)
{
if (_messageWindow.lvErrorCollector.InvokeRequired)
- _messageWindow.lvErrorCollector.Invoke((MethodInvoker) (() => AddToList(lvItem)));
+ _messageWindow.lvErrorCollector.Invoke((MethodInvoker)(() => AddToList(lvItem)));
else
_messageWindow.lvErrorCollector.Items.Insert(0, lvItem);
}
diff --git a/mRemoteV1/Messages/MessageWriters/PopupMessageWriter.cs b/mRemoteV1/Messages/MessageWriters/PopupMessageWriter.cs
index 93602d50..2e6a0495 100644
--- a/mRemoteV1/Messages/MessageWriters/PopupMessageWriter.cs
+++ b/mRemoteV1/Messages/MessageWriters/PopupMessageWriter.cs
@@ -10,16 +10,20 @@ namespace mRemoteNG.Messages.MessageWriters
switch (message.Class)
{
case MessageClass.DebugMsg:
- MessageBox.Show(message.Text, string.Format(Language.strTitleInformation, message.Date), MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show(message.Text, string.Format(Language.strTitleInformation, message.Date),
+ MessageBoxButtons.OK, MessageBoxIcon.Information);
break;
case MessageClass.InformationMsg:
- MessageBox.Show(message.Text, string.Format(Language.strTitleInformation, message.Date), MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show(message.Text, string.Format(Language.strTitleInformation, message.Date),
+ MessageBoxButtons.OK, MessageBoxIcon.Information);
break;
case MessageClass.WarningMsg:
- MessageBox.Show(message.Text, string.Format(Language.strTitleWarning, message.Date), MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ MessageBox.Show(message.Text, string.Format(Language.strTitleWarning, message.Date),
+ MessageBoxButtons.OK, MessageBoxIcon.Warning);
break;
case MessageClass.ErrorMsg:
- MessageBox.Show(message.Text, string.Format(Language.strTitleError, message.Date), MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(message.Text, string.Format(Language.strTitleError, message.Date),
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
default:
throw new ArgumentOutOfRangeException();
diff --git a/mRemoteV1/Messages/WriterDecorators/MessageFocusDecorator.cs b/mRemoteV1/Messages/WriterDecorators/MessageFocusDecorator.cs
index c9d7d9dc..a3e30c68 100644
--- a/mRemoteV1/Messages/WriterDecorators/MessageFocusDecorator.cs
+++ b/mRemoteV1/Messages/WriterDecorators/MessageFocusDecorator.cs
@@ -15,7 +15,9 @@ namespace mRemoteNG.Messages.WriterDecorators
private readonly ErrorAndInfoWindow _messageWindow;
private readonly FrmMain _frmMain = FrmMain.Default;
- public MessageFocusDecorator(ErrorAndInfoWindow messageWindow, IMessageTypeFilteringOptions filter, IMessageWriter decoratedWriter)
+ public MessageFocusDecorator(ErrorAndInfoWindow messageWindow,
+ IMessageTypeFilteringOptions filter,
+ IMessageWriter decoratedWriter)
{
_filter = filter ?? throw new ArgumentNullException(nameof(filter));
_messageWindow = messageWindow ?? throw new ArgumentNullException(nameof(messageWindow));
@@ -46,14 +48,15 @@ namespace mRemoteNG.Messages.WriterDecorators
if (_filter.AllowErrorMessages) return true;
break;
}
+
return false;
}
private async Task SwitchToMessageAsync()
{
await Task
- .Delay(TimeSpan.FromMilliseconds(300))
- .ContinueWith(task => SwitchToMessage());
+ .Delay(TimeSpan.FromMilliseconds(300))
+ .ContinueWith(task => SwitchToMessage());
}
private void SwitchToMessage()
diff --git a/mRemoteV1/Messages/WriterDecorators/MessageTypeFilterDecorator.cs b/mRemoteV1/Messages/WriterDecorators/MessageTypeFilterDecorator.cs
index cf92b577..ed8a4be2 100644
--- a/mRemoteV1/Messages/WriterDecorators/MessageTypeFilterDecorator.cs
+++ b/mRemoteV1/Messages/WriterDecorators/MessageTypeFilterDecorator.cs
@@ -43,6 +43,7 @@ namespace mRemoteNG.Messages.WriterDecorators
if (_filter.AllowDebugMessages) return true;
break;
}
+
return false;
}
}
diff --git a/mRemoteV1/Properties/AssemblyInfo.cs b/mRemoteV1/Properties/AssemblyInfo.cs
index 78e360d6..2f15b6a7 100644
--- a/mRemoteV1/Properties/AssemblyInfo.cs
+++ b/mRemoteV1/Properties/AssemblyInfo.cs
@@ -3,7 +3,6 @@ using System.Resources;
using System.Runtime.InteropServices;
-
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@@ -14,7 +13,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("Multi-protocol remote connections manager")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("mRemoteNG")]
-[assembly: AssemblyCopyright("Copyright © 2018 mRemoteNG Dev Team; 2010-2013 Riley McArdle; 2007-2009 Felix Deimel")]
+[assembly: AssemblyCopyright("Copyright © 2019 mRemoteNG Dev Team; 2010-2013 Riley McArdle; 2007-2009 Felix Deimel")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
diff --git a/mRemoteV1/Properties/Resources.Designer.cs b/mRemoteV1/Properties/Resources.Designer.cs
index 1b038fe6..edab3f50 100644
--- a/mRemoteV1/Properties/Resources.Designer.cs
+++ b/mRemoteV1/Properties/Resources.Designer.cs
@@ -1347,6 +1347,36 @@ namespace mRemoteNG {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap tab_add {
+ get {
+ object obj = ResourceManager.GetObject("tab_add", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap tab_delete {
+ get {
+ object obj = ResourceManager.GetObject("tab_delete", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap tab_edit {
+ get {
+ object obj = ResourceManager.GetObject("tab_edit", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
///
@@ -1357,6 +1387,36 @@ namespace mRemoteNG {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TabExit {
+ get {
+ object obj = ResourceManager.GetObject("TabExit", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TabOption {
+ get {
+ object obj = ResourceManager.GetObject("TabOption", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap TabOverflow {
+ get {
+ object obj = ResourceManager.GetObject("TabOverflow", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/mRemoteV1/Properties/Resources.resx b/mRemoteV1/Properties/Resources.resx
index 3289c14e..3797bb98 100644
--- a/mRemoteV1/Properties/Resources.resx
+++ b/mRemoteV1/Properties/Resources.resx
@@ -538,6 +538,15 @@
..\Resources\Icons\Tab_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Images\TabOption.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Images\TabOverflow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Images\TabExit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\Icons\Update_Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -547,4 +556,13 @@
..\Resources\Images\mRemoteNG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Images\tab_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Images\tab_delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\Images\tab_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/mRemoteV1/Properties/Settings.Designer.cs b/mRemoteV1/Properties/Settings.Designer.cs
index dd602bde..c4dc26bc 100644
--- a/mRemoteV1/Properties/Settings.Designer.cs
+++ b/mRemoteV1/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace mRemoteNG {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -2533,7 +2533,7 @@ namespace mRemoteNG {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ThemingActive {
get {
return ((bool)(this["ThemingActive"]));
@@ -2770,5 +2770,17 @@ namespace mRemoteNG {
this["AlwaysShowConnectionTabs"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool OverrideFIPSCheck {
+ get {
+ return ((bool)(this["OverrideFIPSCheck"]));
+ }
+ set {
+ this["OverrideFIPSCheck"] = value;
+ }
+ }
}
}
diff --git a/mRemoteV1/Properties/Settings.settings b/mRemoteV1/Properties/Settings.settings
index 82244aac..78279bf4 100644
--- a/mRemoteV1/Properties/Settings.settings
+++ b/mRemoteV1/Properties/Settings.settings
@@ -1,693 +1,698 @@
-
-
-
-
- 0, 0
-
-
- 0, 0
-
-
- Normal
-
-
- False
-
-
- True
-
-
-
-
-
- True
-
-
- True
-
-
- True
-
-
- False
-
-
- False
-
-
-
-
-
- True
-
-
- True
-
-
- False
-
-
- False
-
-
- True
-
-
- False
-
-
- False
-
-
- noinfo
-
-
- False
-
-
- True
-
-
- False
-
-
- False
-
-
- False
-
-
-
-
-
- 80
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
- RDP
-
-
- Default Settings
-
-
- False
-
-
- FitToWindow
-
-
- Colors16Bit
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- DoNotPlay
-
-
- 2
-
-
- False
-
-
- False
-
-
- False
-
-
- 0
-
-
- False
-
-
- True
-
-
- 0, 0
-
-
- Bottom
-
-
- True
-
-
- 3, 24
-
-
- Top
-
-
- False
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- EncrBasic
-
-
- False
-
-
-
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- True
-
-
- False
-
-
- False
-
-
- AuthVNC
-
-
- ColNormal
-
-
- SmartSAspect
-
-
- False
-
-
- CompNone
-
-
- EncHextile
-
-
-
-
-
-
-
-
- 0
-
-
- ProxyNone
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- NoAuth
-
-
- False
-
-
- 5500
-
-
- False
-
-
-
-
-
- IE
-
-
- False
-
-
-
-
-
- False
-
-
- False
-
-
-
-
-
- False
-
-
-
-
-
- False
-
-
- False
-
-
- 14
-
-
- 1980-01-01
-
-
- False
-
-
- Never
-
-
- Yes
-
-
- mRemoteNG
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- 5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- 4
-
-
-
-
-
-
-
-
- mRemoteNG
-
-
- 10
-
-
- {0}.{1:yyyyMMdd-HHmmssffff}.backup
-
-
- False
-
-
- True
-
-
- False
-
-
- False
-
-
- release
-
-
-
-
-
- True
-
-
-
-
-
-
-
-
- True
-
-
- https://mremoteng.org/
-
-
-
-
-
- True
-
-
- False
-
-
- False
-
-
- RDP
-
-
- 9/9, 33/8
-
-
- 9/8, 34/8
-
-
- False
-
-
- 20
-
-
- AES
-
-
- GCM
-
-
- 1000
-
-
- Dynamic
-
-
- False
-
-
- 0
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- 00000000-0000-0000-0000-000000000000
-
-
-
-
-
- False
-
-
- True
-
-
- True
-
-
- True
-
-
- False
-
-
- False
-
-
- True
-
-
- True
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- True
-
-
- True
-
-
- cs-CZ,de,el,en,en-US,es-AR,es,fr,hu,it,ja-JP,ko-KR,nb-NO,nl,pt,pt-BR,pl,ru,uk,tr-TR,zh-CN,zh-TW
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
- General
-
-
- True
-
-
- False
-
-
- False
-
-
- False
-
-
- False
-
-
- 0, 0
-
-
-
-
-
- False
-
-
- False
-
-
- General
-
+
+
+
+
+
+ 0, 0
+
+
+ 0, 0
+
+
+ Normal
+
+
+ False
+
+
+ True
+
+
+
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ noinfo
+
+
+ False
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+
+
+
+ 80
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+ RDP
+
+
+ Default Settings
+
+
+ False
+
+
+ FitToWindow
+
+
+ Colors16Bit
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ DoNotPlay
+
+
+ 2
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 0
+
+
+ False
+
+
+ True
+
+
+ 0, 0
+
+
+ Bottom
+
+
+ True
+
+
+ 3, 24
+
+
+ Top
+
+
+ False
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ EncrBasic
+
+
+ False
+
+
+
+
+
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ AuthVNC
+
+
+ ColNormal
+
+
+ SmartSAspect
+
+
+ False
+
+
+ CompNone
+
+
+ EncHextile
+
+
+
+
+
+
+
+
+ 0
+
+
+ ProxyNone
+
+
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ NoAuth
+
+
+ False
+
+
+ 5500
+
+
+ False
+
+
+
+
+
+ IE
+
+
+ False
+
+
+
+
+
+ False
+
+
+ False
+
+
+
+
+
+ False
+
+
+
+
+
+ False
+
+
+ False
+
+
+ 14
+
+
+ 1980-01-01
+
+
+ False
+
+
+ Never
+
+
+ Yes
+
+
+ mRemoteNG
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 4
+
+
+
+
+
+
+
+
+ mRemoteNG
+
+
+ 10
+
+
+ {0}.{1:yyyyMMdd-HHmmssffff}.backup
+
+
+ False
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ release
+
+
+
+
+
+ True
+
+
+
+
+
+
+
+
+ True
+
+
+ https://mremoteng.org/
+
+
+
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ RDP
+
+
+ 9/9, 33/8
+
+
+ 9/8, 34/8
+
+
+ False
+
+
+ 20
+
+
+ AES
+
+
+ GCM
+
+
+ 1000
+
+
+ Dynamic
+
+
+ False
+
+
+ 0
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 00000000-0000-0000-0000-000000000000
+
+
+
+
+
+ False
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ True
+
+
+ cs-CZ,de,el,en,en-US,es-AR,es,fr,hu,it,ja-JP,ko-KR,nb-NO,nl,pt,pt-BR,pl,ru,uk,tr-TR,zh-CN,zh-TW
+
+
+ True
+
+
+
+
+
+
+
+
+
+
+
+ General
+
+
+ True
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ 0, 0
+
+
+
+
+
+ False
+
+
+ False
+
+
+ General
+
True
-
- False
-
-
- False
-
+
+ False
+
+
+ False
+
00000000-0000-0000-0000-000000000000
-
- True
-
-
+
+ True
+
+
+ False
+
+
\ No newline at end of file
diff --git a/mRemoteV1/References/MagicLibrary.dll b/mRemoteV1/References/MagicLibrary.dll
deleted file mode 100644
index 24cfa5d0..00000000
Binary files a/mRemoteV1/References/MagicLibrary.dll and /dev/null differ
diff --git a/mRemoteV1/Resources/Help/Index.htm b/mRemoteV1/Resources/Help/Index.htm
index cfa50ca0..cc9cad1d 100644
--- a/mRemoteV1/Resources/Help/Index.htm
+++ b/mRemoteV1/Resources/Help/Index.htm
@@ -1,48 +1,86 @@
-
- mRemoteNG Help
-
+
+ mRemoteNG Help
+
-
+
Done from nmat, please remove this div after review.
-
-
Welcome to mRemoteNG
-
-
+
+Welcome to mRemoteNG
+
+
This documentation is written and based on version 1.76 of mRemoteNG. If you find anything to improve or wrong with the documentation then please report it to github.
Also note that documentation can be found on github pages that are updated more frequently then information provided here.
-
- Getting Started
-
- User Interface
-
- Special Topics
- Connections
-
+
+Getting Started
+
+User Interface
+
+Special Topics
+Connections
+
-
+