Compare commits

..

14 Commits

Author SHA1 Message Date
David Sparer
7305bc4441 Merge branch 'develop' into bug/ssh_focus
# Conflicts:
#	mRemoteV1/UI/Forms/frmMain.cs
2019-09-01 18:58:16 -05:00
David Sparer
2c47c857ec fixed array out of bounds exception when clicking in tab area 2019-09-01 17:16:07 -05:00
David Sparer
19f1770eda minor cleanup 2019-09-01 17:15:00 -05:00
David Sparer
40e878a517 resolved focus bug on first-connect 2019-09-01 16:38:11 -05:00
David Sparer
d09e9b10a0 fixed issue with mrng being in weird positions in the alt-tab lineup when extapp has focus 2019-09-01 16:07:58 -05:00
David Sparer
0d727338f0 moved a number of focus logic window events out of frmmain 2019-09-01 14:54:49 -05:00
David Sparer
e9838960fa improved ability to determine if external proc has focus 2019-09-01 12:30:11 -05:00
David Sparer
74611e9db6 refactored some alt-tab focus logic to a new class 2019-08-25 17:19:06 -05:00
David Sparer
f7dc0918eb fixed most focus issues when working with putty
still need to resolve refocusing putty in some cases
2019-08-25 15:59:51 -05:00
David Sparer
26d9e3c2ff debug putty focus issues 2019-08-25 10:42:13 -05:00
David Sparer
53c534aa93 use a single instance of IConnectionInitiator everywhere 2019-08-25 10:42:13 -05:00
David Sparer
dfd02e7b9a removed unused webhelper class 2019-08-25 10:42:13 -05:00
David Sparer
65eac21471 minor cleanup 2019-08-25 10:42:13 -05:00
David Sparer
5f776a3525 minor cleanup of the connection tab class 2019-08-25 10:42:13 -05:00
200 changed files with 10597 additions and 9676 deletions

View File

@@ -15,19 +15,18 @@
## Screenshots (if appropriate): ## Screenshots (if appropriate):
## Types of changes ## Types of changes
<!--- What types of changes does your code introduce? --> <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
<!--- Uncomment the line(s) that apply(s) to you pull request --> - [ ] Bug fix (non-breaking change which fixes an issue)
<!--- - Bug fix (non-breaking change which fixes an issue) --> - [ ] New feature (non-breaking change which adds functionality)
<!--- - New feature (non-breaking change which adds functionality) --> - [ ] Breaking change (fix or feature that would cause existing functionality to change)
<!--- - Breaking change (fix or feature that would cause existing functionality to change) --> - [ ] Updated translation
<!--- - Updated translation -->
## Checklist: ## Checklist:
<!--- Go over all the following points. All of them must apply to your pull request to be merged. --> <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have read the **CONTRIBUTING** document. - [ ] I have read the **CONTRIBUTING** document.
- [ ] My code follows the code style of this project. - [ ] My code follows the code style of this project.
- [ ] All Tests within VisualStudio are passing
- [ ] This pull request does not target the master branch. - [ ] This pull request does not target the master branch.
- [ ] I have updated the changelog file accordingly, if necessary. - [ ] I have updated the changelog file accordingly.
- [ ] I have updated the documentation accordingly, if necessary. - [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.

View File

@@ -5,39 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [Unreleased]
### Added ### Added
- #545: Option to minimize to system tray on closing
- #283: Support for native PowerShell remoting as new protocol
### Changed
- #1460: Updated GeckoFX to v60
### Fixed
- #1610: Menu bar changes to english when cancelling options form
- #1595: Unhandled exception when trying to browse through non existent multi ssh history with keyboard key strokes
- #1589: Update SQL tables instead of rewriting them
- #1337: Unhandled exception after closing mRemoteNG
- #359: Making a VNC connection to an unreachable host causes the application to not respond for 20-30 seconds
## [1.77.1] - 2019-09-02
### Added
- #1512: Added option to close panel from right click menu - #1512: Added option to close panel from right click menu
- #1434: Revised sort button in connection tree to be able to sort in both orders - #1434: Revised sort button in connection tree to be able to sort in both orders
- #1400: Added file download handling to HTTP(S) connections using Gecko - #1400: Added file download handling to HTTP(S) connections using Gecko
- #1385: Added option to start mRemoteNG minimized - #1385: Added option to start mRemoteNG minimized
- #826: Allow selecting RDP version to use when connecting - #826: Allow selecting RDP version to use when connecting
### Changed ### Changed
- #1544: Improved Polish translations
- #1518: Inheritance is no longer automatically enabled when importing nodes from Active Directory
- #1468: Improved mRemoteNG startup time - #1468: Improved mRemoteNG startup time
- #1443: Chinese (simplified) translation improvements - #1443: Chinese (simplified) translation improvements
- #1437: Norwegian translation improvements - #1437: Norwegian translation improvements
- #1378: Hyperlinks embedded within mRemoteNG now open in the system default browser
- #1239: Increased default key derivation function (KDF) iterations from 1000 to 10000 - #1239: Increased default key derivation function (KDF) iterations from 1000 to 10000
- #718: Moved port property from 'protocol' to 'connection' section - #718: Moved port property from 'protocol' to 'connection' section
- Moved most RDP enums outside of the RDP protocol class. Scripts which reference these enums will need to be updated. - Moved most RDP enums outside of the RDP protocol class. Scripts which reference these enums will need to be updated.
- Removed the "Automatically get session info" from the advanced options screen since it is no longer used.
### Fixed ### Fixed
- #1505: About screen now better follows theme colors
- #1493: Updated database setup scripts for MSSQL and MySQL
- #1470: The "Favorite" setting is now properly saved in the local connection settings file (not saved in database)
- #1447: Exception occurs when resetting layout - #1447: Exception occurs when resetting layout
- #1439: Searching in hosts tree loses first keystroke - #1439: Searching in hosts tree loses first keystroke
- #1428: Fixed a rare error when checking for FIPS - #1428: Fixed a rare error when checking for FIPS

View File

@@ -1,38 +1,37 @@
# Contributors # Contributors
## Current mRemoteNG dev team ## Current mRemoteNG dev team
David Sparer (http://github.com/sparerd) David Sparer (github.com/sparerd)
Sean Kaim (http://github.com/kmscode) Sean Kaim (github.com/kmscode)
Faryan Rezagholi (http://github.com/farosch) Faryan Rezagholi (github.com/farosch)
Thanks for the awesome new website! Thanks for the awesome new website!
Bennett Blodinger (http://github.com/benwa) Bennett Blodinger (github.com/benwa)
Joe Cefoli (http://github.com/jcefoli) Joe Cefoli (github.com/jcefoli)
countchappy (http://github.com/countchappy) countchappy (github.com/countchappy)
Tony Lambert Tony Lambert
Julien Roncaglia (http://github.com/vbfox) Julien Roncaglia (github.com/vbfox)
http://github.com/peterchenadded github.com/peterchenadded
Brandon Wulf (http://github.com/mrwulf) Brandon Wulf (github.com/mrwulf)
Pedro Rodrigues (http://github.com/pedro2555) Pedro Rodrigues (github.com/pedro2555)
http://github.com/dekelMP github.com/dekelMP
Bruce (http://github.com/brucetp) Bruce (github.com/brucetp)
Camilo Alvarez (http://github.com/jotatsu) Camilo Alvarez (github.com/jotatsu)
http://github.com/DamianBis github.com/DamianBis
http://github.com/pfjason github.com/pfjason
http://github.com/sirLoaf github.com/sirLoaf
http://github.com/Fyers github.com/Fyers
Vladimir Semenov (http://github.com/sli-pro) Vladimir Semenov (github.com/sli-pro)
Stephan (http://github.com/st-schuler) Stephan (github.com/st-schuler)
Aleksey Reytsman (http://github.com/areytsman) Aleksey Reytsman (github.com/areytsman)
Cristian Abelleira (http://github.com/CrAbelleira) Cristian Abelleira (github.com/CrAbelleira)
http://github.com/MitchellBot github.com/MitchellBot
Filippo Ferrazini (http://github.com/Filippo125)
## Past Contributors ## Past Contributors
Felix Deimel - mRemote original developer Felix Deimel - mRemote original developer
Riley McArdle - mRemoteNG original developer Riley McArdle - mRemoteNG original developer
Hayato Iriumi (http://github.com/hiriumi) Hayato Iriumi (github.com/hiriumi)
Jason Barbier Jason Barbier
Wiktor Beryt Wiktor Beryt
Lionel Caignec Lionel Caignec
@@ -42,8 +41,8 @@ Tom Hiller
Apisitt Rattana Apisitt Rattana
Andreas Rehm Andreas Rehm
David Vidmar David Vidmar
http://github.com/Brandhor github.com/Brandhor
Dimitrij (http://github.com/Kvarkas) Dimitrij (github.com/Kvarkas)
## Translators ## Translators
Eugenio "Ryo567" Martínez Eugenio "Ryo567" Martínez
@@ -51,19 +50,17 @@ Mathieu Pape
Emanuel Silva Emanuel Silva
Robert Siwiec Robert Siwiec
Hayato Iriumi Hayato Iriumi
Sebastien Thieury (http://github.com/SebThieu) Sebastien Thieury (github.com/SebThieu)
Riza Emet Riza Emet
Lukas Plachy (http://github.com/rheingold) Lukas Plachy (github.com/rheingold)
Gyuha Shin Gyuha Shin
Stefan (http://github.com/polluks) Stefan (github.com/polluks)
http://github.com/emazv72 github.com/emazv72
Vladimir Semenov (http://github.com/sli-pro) Vladimir Semenov (github.com/sli-pro)
Marco Sousa (http://github.com/marcomsousa) Marco Sousa (github.com/marcomsousa)
http://github.com/wwj402 github.com/wwj402
http://github.com/Fyers github.com/Fyers
http://github.com/pablomh github.com/pablomh
Damian Szczepanik (http://github.com/damianszczepanik)
Mant1kor (http://github.com/Mant1kor)
## Included Source Code ## Included Source Code
Command Line Arguments Parser Command Line Arguments Parser
@@ -132,7 +129,7 @@ https://github.com/sshnet/SSH.NET
VncSharp VncSharp
Copyright © 2004-2009 David Humphrey Copyright © 2004-2009 David Humphrey
GNU General Public License (GPL) Version 2 GNU General Public License (GPL) Version 2
https://github.com/humphd/VncSharp [Archived] https://github.com/humphd/VncSharp
ObjectListView ObjectListView
Copyright © 2006-2016 Phillip Piper Copyright © 2006-2016 Phillip Piper
@@ -143,8 +140,3 @@ Markdig
Copyright © 2016-2019 Alexandre Mutel Copyright © 2016-2019 Alexandre Mutel
BSD 2-Clause "Simplified" BSD 2-Clause "Simplified"
https://github.com/lunet-io/markdig https://github.com/lunet-io/markdig
ConsoleControl
Copyright © 2015 Dave Kerr
MIT License
https://github.com/dwmkerr/consolecontrol

View File

@@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@@ -109,6 +109,18 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Portable|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Portable|x86' ">
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants> <DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<PreBuildEvent>REM Clean the TargetDir
rmdir /S /Q "$(TargetDir)"
echo $(ConfigurationName) &gt; buildenv.tmp
REM Harvest bin directory of the mRemoteV1 project
"$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -nologo -dr INSTALLDIR -var var.HarvestPath -srd -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt"
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
"$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>:: When passing paths to powershell scripts, check if the path ends with a backslash "\" <PostBuildEvent>:: When passing paths to powershell scripts, check if the path ends with a backslash "\"
:: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one. :: If it does, then the backslash may be interpreted as an escape character. Add another backslash to cancel the first one.
@@ -123,16 +135,4 @@ set /p buildenv=&lt;buildenv.tmp
:: Call the post build powershell script :: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_installer.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "%25cd%25" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"</PostBuildEvent> powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_installer.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "%25cd%25" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<PreBuildEvent>REM Clean the TargetDir
rmdir /S /Q "$(TargetDir)"
echo $(ConfigurationName) &gt; buildenv.tmp
REM Harvest bin directory of the mRemoteV1 project
"$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag -nologo -dr INSTALLDIR -var var.HarvestPath -srd -scom -sreg -cg MandatoryComponents -template fragment -out "$(ProjectDir)Fragments\FilesFragment.wxs" -t "$(ProjectDir)Filters\Harvest_Filter.xslt"
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
"$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
</PropertyGroup>
</Project> </Project>

View File

@@ -2,7 +2,7 @@ node('windows') {
def jobDir = pwd() def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\"" def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe" def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.10.0\\tools\\nunit3-console.exe" def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.7.0\\tools\\nunit3-console.exe"
def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe" def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe"
def testResultFilePrefix = "TestResult" def testResultFilePrefix = "TestResult"
def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml" def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml"

View File

@@ -13,7 +13,7 @@
| ---------------|--------------|-----------| | ---------------|--------------|-----------|
| Stable | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/master?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/master) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) | | Stable | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/master?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/master) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) |
| Beta | | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) | | Beta | | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) |
| Development | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.77.1/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.77.1) | | Development | [![Build status](https://ci.appveyor.com/api/projects/status/k0sdbxmq90fgdmj6/branch/develop?svg=true)](https://ci.appveyor.com/project/mremoteng/mremoteng/branch/develop) | [![Github Releases (by Release)](https://img.shields.io/github/downloads/mRemoteNG/mRemoteNG/v1.76.15/total.svg)](https://github.com/mRemoteNG/mRemoteNG/releases/tag/v1.76.15) |
mRemoteNG is the next generation of mRemote, a full-featured, multi-tab remote connections manager. mRemoteNG is the next generation of mRemote, a full-featured, multi-tab remote connections manager.

View File

@@ -17,7 +17,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -25,16 +25,12 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" /> <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.2.0" newVersion="3.9.2.0" /> <bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup> </startup>
</configuration> </configuration>

View File

@@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props')" /> <Import Project="..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.props" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.props')" />
<Import Project="..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mRemoteNG.Specs</RootNamespace> <RootNamespace>mRemoteNG.Specs</RootNamespace>
<AssemblyName>mRemoteNG.Specs</AssemblyName> <AssemblyName>mRemoteNG.Specs</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
@@ -51,11 +51,11 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath> <HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
@@ -67,10 +67,10 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="TechTalk.SpecFlow, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL"> <Reference Include="TechTalk.SpecFlow, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.3.0.225\lib\net45\TechTalk.SpecFlow.dll</HintPath> <HintPath>..\packages\SpecFlow.3.0.224\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference> </Reference>
<Reference Include="TechTalk.SpecFlow.NUnit.SpecFlowPlugin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL"> <Reference Include="TechTalk.SpecFlow.NUnit.SpecFlowPlugin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.NUnit.3.0.225\lib\net45\TechTalk.SpecFlow.NUnit.SpecFlowPlugin.dll</HintPath> <HintPath>..\packages\SpecFlow.NUnit.3.0.224\lib\net45\TechTalk.SpecFlow.NUnit.SpecFlowPlugin.dll</HintPath>
</Reference> </Reference>
<Reference Include="Utf8Json, Version=1.3.7.0, Culture=neutral, PublicKeyToken=8a73d3ba7e392e27, processorArchitecture=MSIL"> <Reference Include="Utf8Json, Version=1.3.7.0, Culture=neutral, PublicKeyToken=8a73d3ba7e392e27, processorArchitecture=MSIL">
<HintPath>..\packages\Utf8Json.1.3.7\lib\net45\Utf8Json.dll</HintPath> <HintPath>..\packages\Utf8Json.1.3.7\lib\net45\Utf8Json.dll</HintPath>
@@ -120,12 +120,12 @@
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props'))" /> <Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.props'))" />
<Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.props'))" /> <Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.targets'))" />
<Error Condition="!Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets'))" />
</Target> </Target>
<Import Project="..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets')" /> <Import Project="..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.targets" Condition="Exists('..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@@ -9,17 +9,17 @@
<package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.7" targetFramework="net472" /> <package id="NUnit.Extension.TeamCityEventListener" version="1.0.6" targetFramework="net46" />
<package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net46" /> <package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net46" />
<package id="NUnit.Runners" version="3.10.0" targetFramework="net46" /> <package id="NUnit.Runners" version="3.10.0" targetFramework="net46" />
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net472" /> <package id="NUnit3TestAdapter" version="3.13.0" targetFramework="net46" />
<package id="SpecFlow" version="3.0.225" targetFramework="net472" /> <package id="SpecFlow" version="3.0.224" targetFramework="net46" />
<package id="SpecFlow.NUnit" version="3.0.225" targetFramework="net472" /> <package id="SpecFlow.NUnit" version="3.0.224" targetFramework="net46" />
<package id="SpecFlow.NUnit.Runners" version="3.0.225" targetFramework="net472" /> <package id="SpecFlow.NUnit.Runners" version="3.0.224" targetFramework="net46" />
<package id="System.Reflection.Emit" version="4.6.0" targetFramework="net472" /> <package id="System.Reflection.Emit" version="4.3.0" targetFramework="net46" />
<package id="System.Reflection.Emit.Lightweight" version="4.6.0" targetFramework="net472" /> <package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net46" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net46" requireReinstallation="true" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net46" />
<package id="Utf8Json" version="1.3.7" targetFramework="net46" requireReinstallation="true" /> <package id="Utf8Json" version="1.3.7" targetFramework="net46" />
</packages> </packages>

View File

@@ -98,7 +98,6 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
UseConsoleSession = true, UseConsoleSession = true,
UseCredSsp = true, UseCredSsp = true,
UseVmId = false, UseVmId = false,
UseEnhancedMode = false,
RenderingEngine = HTTPBase.RenderingEngine.Gecko, RenderingEngine = HTTPBase.RenderingEngine.Gecko,
ICAEncryptionStrength = IcaProtocol.EncryptionStrength.Encr40Bit, ICAEncryptionStrength = IcaProtocol.EncryptionStrength.Encr40Bit,
RDPAuthenticationLevel = AuthenticationLevel.WarnOnFailedAuth, RDPAuthenticationLevel = AuthenticationLevel.WarnOnFailedAuth,

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Linq; using System.Linq;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Csv; using mRemoteNG.Config.Serializers.Csv;
using mRemoteNG.Connection; using mRemoteNG.Connection;
using mRemoteNG.Container; using mRemoteNG.Container;

View File

@@ -6,6 +6,7 @@ using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption; using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree; using mRemoteNG.Tree;
using mRemoteNGTests.TestHelpers; using mRemoteNGTests.TestHelpers;
using NSubstitute;
using NUnit.Framework; using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers namespace mRemoteNGTests.Config.Serializers

View File

@@ -1,11 +1,15 @@
using System.Linq; using System.Linq;
using System.Security; using System.Security;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.MsSql; using mRemoteNG.Config.Serializers.MsSql;
using mRemoteNG.Connection; using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security; using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption; using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree; using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNGTests.TestHelpers; using mRemoteNGTests.TestHelpers;
using NSubstitute;
using NUnit.Framework; using NUnit.Framework;
namespace mRemoteNGTests.Config.Serializers namespace mRemoteNGTests.Config.Serializers

View File

@@ -1,200 +0,0 @@
using mRemoteNG.Config.Serializers.MiscSerializers;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNGTests.Properties;
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;
namespace mRemoteNGTests.Config.Serializers.MiscSerializers
{
public class RemoteDesktopManagerDeserializerTests
{
private readonly RemoteDesktopManagerDeserializer _sut = new RemoteDesktopManagerDeserializer();
private readonly Dictionary<ProtocolType, string> _rdmExports = new Dictionary<ProtocolType, string>
{
{ProtocolType.RDP, Resources.rdp_rdm_export},
{ProtocolType.SSH2, Resources.ssh_rdm_export},
{ProtocolType.VNC, Resources.vnc_rdm_export},
{ProtocolType.Telnet, Resources.telnet_rdm_export},
{ProtocolType.HTTPS, Resources.website_rdm_export},
};
[TestCaseSource(nameof(RdpPropertiesAndValues))]
public void CorrectlyImportsRdpProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.RDP]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.RDP);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(SshPropertiesAndValues))]
public void CorrectlyImportsSshProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.SSH2]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.SSH2);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(VncPropertiesAndValues))]
public void CorrectlyImportsVncProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.VNC]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.VNC);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(TelnetPropertiesAndValues))]
public void CorrectlyImportsTelnetProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.Telnet]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.Telnet);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
[TestCaseSource(nameof(WebsitePropertiesAndValues))]
public void CorrectlyImportsWebsiteProperties(string propertyName, object expectedValue)
{
var rootContainer = _sut.Deserialize(_rdmExports[ProtocolType.HTTPS]);
var node = rootContainer.RootNodes[0].Children.FirstOrDefault(i => i.Protocol == ProtocolType.HTTPS);
Assert.That(node, Is.Not.Null);
var actualValue = node.GetType().GetProperty(propertyName)?.GetValue(node);
Assert.That(actualValue, Is.EqualTo(expectedValue));
}
private static IEnumerable<TestCaseData> RdpPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "1f36e6f0-90ca-4607-b6ec-86227738486d"),
new TestCaseData(nameof(ConnectionInfo.Name), "rdp connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.RDP),
new TestCaseData(nameof(ConnectionInfo.Hostname), "my.rdp.host.com"),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a general description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "domain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.Resolution), RDPResolutions.FitToWindow),
new TestCaseData(nameof(ConnectionInfo.AutomaticResize), true),
new TestCaseData(nameof(ConnectionInfo.CacheBitmaps), false),
new TestCaseData(nameof(ConnectionInfo.DisplayThemes), false),
new TestCaseData(nameof(ConnectionInfo.DisplayWallpaper), false),
new TestCaseData(nameof(ConnectionInfo.EnableDesktopComposition), true),
new TestCaseData(nameof(ConnectionInfo.EnableFontSmoothing), true),
new TestCaseData(nameof(ConnectionInfo.RedirectSound), RDPSounds.DoNotPlay),
new TestCaseData(nameof(ConnectionInfo.RedirectAudioCapture), true),
new TestCaseData(nameof(ConnectionInfo.RedirectClipboard), false),
new TestCaseData(nameof(ConnectionInfo.RedirectDiskDrives), false),
new TestCaseData(nameof(ConnectionInfo.RedirectPrinters), true),
new TestCaseData(nameof(ConnectionInfo.RedirectPorts), false),
new TestCaseData(nameof(ConnectionInfo.RedirectSmartCards), true),
new TestCaseData(nameof(ConnectionInfo.RDPMinutesToIdleTimeout), 17),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "mac-add-goes-here"),
new TestCaseData(nameof(ConnectionInfo.UseCredSsp), true),
new TestCaseData(nameof(ConnectionInfo.Port), 1234),
new TestCaseData(nameof(ConnectionInfo.RdpVersion), RdpVersion.Rdc7),
new TestCaseData(nameof(ConnectionInfo.RedirectKeys), true),
new TestCaseData(nameof(ConnectionInfo.UseConsoleSession), true),
new TestCaseData(nameof(ConnectionInfo.RDPAuthenticationLevel), AuthenticationLevel.WarnOnFailedAuth),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUsageMethod), RDGatewayUsageMethod.Always),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUseConnectionCredentials), RDGatewayUseConnectionCredentials.Yes),
new TestCaseData(nameof(ConnectionInfo.RDGatewayHostname), "rdhost1"),
new TestCaseData(nameof(ConnectionInfo.RDGatewayUsername), "rduser1"),
new TestCaseData(nameof(ConnectionInfo.RDGatewayDomain), "rddomain1"),
//new TestCaseData(nameof(ConnectionInfo.RDGatewayPassword), "rdpassword1"),
new TestCaseData(nameof(ConnectionInfo.UseEnhancedMode), true),
new TestCaseData(nameof(ConnectionInfo.UseVmId), true),
new TestCaseData(nameof(ConnectionInfo.VmId), "instance-id-here"),
};
}
private static IEnumerable<TestCaseData> SshPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "44ae261f-0094-48a2-93cb-bc5abcfcc394"),
new TestCaseData(nameof(ConnectionInfo.Name), "ssh connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.SSH2),
new TestCaseData(nameof(ConnectionInfo.Hostname), "mysshhost"),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a linux host description"),
new TestCaseData(nameof(ConnectionInfo.Username), "linuxuser1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "linuxpassword1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.Port), 4321),
};
}
private static IEnumerable<TestCaseData> VncPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00"),
new TestCaseData(nameof(ConnectionInfo.Name), "vnc connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.VNC),
new TestCaseData(nameof(ConnectionInfo.Hostname), "vnchost1"),
new TestCaseData(nameof(ConnectionInfo.Port), 9987),
new TestCaseData(nameof(ConnectionInfo.Description), "This is a VNC description"),
new TestCaseData(nameof(ConnectionInfo.Username), "winuser1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "windomain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "vncpassword1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.VNCEncoding), ProtocolVNC.Encoding.EncTight),
new TestCaseData(nameof(ConnectionInfo.VNCAuthMode), ProtocolVNC.AuthMode.AuthWin),
new TestCaseData(nameof(ConnectionInfo.VNCCompression), ProtocolVNC.Compression.Comp4),
new TestCaseData(nameof(ConnectionInfo.VNCViewOnly), true),
new TestCaseData(nameof(ConnectionInfo.VNCProxyIP), "proxyhost"),
new TestCaseData(nameof(ConnectionInfo.VNCProxyPort), 7777),
};
}
private static IEnumerable<TestCaseData> TelnetPropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "8d77d3ac-b414-4b51-ac10-60304d63cc6f"),
new TestCaseData(nameof(ConnectionInfo.Name), "telnet connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.Telnet),
new TestCaseData(nameof(ConnectionInfo.Hostname), "telnethost1"),
new TestCaseData(nameof(ConnectionInfo.Description), "Telnet description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.MacAddress), "some-mac-here"),
new TestCaseData(nameof(ConnectionInfo.Port), 7648),
};
}
private static IEnumerable<TestCaseData> WebsitePropertiesAndValues()
{
return new[]
{
new TestCaseData(nameof(ConnectionInfo.ConstantID), "65092747-6870-42c9-b8bc-35ec9fb5b3fb"),
new TestCaseData(nameof(ConnectionInfo.Name), "website connection"),
new TestCaseData(nameof(ConnectionInfo.Protocol), ProtocolType.HTTPS),
new TestCaseData(nameof(ConnectionInfo.Hostname), "www.google.com"),
new TestCaseData(nameof(ConnectionInfo.Description), "Website description"),
new TestCaseData(nameof(ConnectionInfo.Username), "user1"),
new TestCaseData(nameof(ConnectionInfo.Domain), "domain1"),
//new TestCaseData(nameof(ConnectionInfo.Password), "password1"),
new TestCaseData(nameof(ConnectionInfo.Port), 8080),
new TestCaseData(nameof(ConnectionInfo.RenderingEngine), HTTPBase.RenderingEngine.Gecko),
};
}
}
}

View File

@@ -1,4 +1,5 @@
using mRemoteNG.App; using System.Collections.ObjectModel;
using mRemoteNG.App;
using mRemoteNG.Connection; using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection.Protocol;
using mRemoteNG.Tools; using mRemoteNG.Tools;
@@ -11,7 +12,7 @@ namespace mRemoteNGTests.Connection.Protocol
{ {
public class IntegratedProgramTests public class IntegratedProgramTests
{ {
private readonly ExternalTool _extTool = new ExternalTool private readonly ExternalTool _extTool = new ExternalTool(new ConnectionInitiator(new ProtocolFactory()))
{ {
DisplayName = "notepad", DisplayName = "notepad",
FileName = @"%windir%\system32\notepad.exe", FileName = @"%windir%\system32\notepad.exe",
@@ -49,7 +50,7 @@ namespace mRemoteNGTests.Connection.Protocol
private InterfaceControl BuildInterfaceControl(string extAppName, ProtocolBase sut) private InterfaceControl BuildInterfaceControl(string extAppName, ProtocolBase sut)
{ {
var connectionWindow = new ConnectionWindow(new DockContent()); var connectionWindow = new ConnectionWindow(new DockContent(), new ConnectionInitiator(new ProtocolFactory()));
var connectionInfo = new ConnectionInfo {ExtApp = extAppName, Protocol = ProtocolType.IntApp}; var connectionInfo = new ConnectionInfo {ExtApp = extAppName, Protocol = ProtocolType.IntApp};
return new InterfaceControl(connectionWindow, sut, connectionInfo); return new InterfaceControl(connectionWindow, sut, connectionInfo);
} }

View File

@@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@@ -19,7 +19,7 @@ namespace mRemoteNGTests.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@@ -194,71 +194,6 @@ namespace mRemoteNGTests.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;AuthentificationLevel&gt;WarnMe&lt;/AuthentificationLevel&gt;
/// &lt;AutomaticallyClose&gt;true&lt;/AutomaticallyClose&gt;
/// &lt;AutomaticallyCloseInterval&gt;17&lt;/AutomaticallyCloseInterval&gt;
/// &lt;ConnectionType&gt;RDPConfigured&lt;/ConnectionType&gt;
/// &lt;Console&gt;true&lt;/Console&gt;
/// &lt;Description&gt;This is a general description&lt;/Description&gt;
/// &lt;DesktopComposition&gt;true&lt;/DesktopComposition&gt;
/// &lt;DisableBitmapCache&gt;true&lt;/DisableBitmapCache&gt;
/// &lt;DisableThemes&gt;true&lt;/Disable [rest of string was truncated]&quot;;.
/// </summary>
internal static string rdp_rdm_export {
get {
return ResourceManager.GetString("rdp_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionType&gt;SSHShell&lt;/ConnectionType&gt;
/// &lt;Description&gt;This is a linux host description&lt;/Description&gt;
/// &lt;ID&gt;44ae261f-0094-48a2-93cb-bc5abcfcc394&lt;/ID&gt;
/// &lt;Name&gt;ssh connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;ab007011-2836-426f-a8e0-9fef1ff88865&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;LoggedModifiedBy&gt;LEVIATHAN\David&lt;/LoggedMo [rest of string was truncated]&quot;;.
/// </summary>
internal static string ssh_rdm_export {
get {
return ResourceManager.GetString("ssh_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionType&gt;Telnet&lt;/ConnectionType&gt;
/// &lt;Description&gt;Telnet description&lt;/Description&gt;
/// &lt;ID&gt;8d77d3ac-b414-4b51-ac10-60304d63cc6f&lt;/ID&gt;
/// &lt;Name&gt;telnet connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;08aaa9ff-3583-4dc0-8622-3a0f4d37a7c4&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;LoggedModifiedBy&gt;LEVIATHAN\David&lt;/LoggedModifiedBy&gt;
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string telnet_rdm_export {
get {
return ResourceManager.GetString("telnet_rdm_export", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; /// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
///&lt;!-- ****************************************************************--&gt; ///&lt;!-- ****************************************************************--&gt;
@@ -481,48 +416,5 @@ namespace mRemoteNGTests.Properties {
return ResourceManager.GetString("update_portable", resourceCulture); return ResourceManager.GetString("update_portable", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionSubType&gt;UltraVNC&lt;/ConnectionSubType&gt;
/// &lt;ConnectionType&gt;VNC&lt;/ConnectionType&gt;
/// &lt;Description&gt;This is a VNC description&lt;/Description&gt;
/// &lt;ID&gt;16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00&lt;/ID&gt;
/// &lt;Name&gt;vnc connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;a44e3b58-2e14-47bf-8a79-0646b1e4ba46&lt;/Stamp&gt;
/// &lt;MetaInformation&gt;
/// &lt;MAC&gt;some-mac-here&lt;/MAC&gt;
/// &lt;PasswordHistory&gt;
/// &lt;PasswordHistory&gt;
/// &lt;L [rest of string was truncated]&quot;;.
/// </summary>
internal static string vnc_rdm_export {
get {
return ResourceManager.GetString("vnc_rdm_export", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot;?&gt;
///&lt;ArrayOfConnection&gt;
/// &lt;Connection&gt;
/// &lt;ConnectionSubType&gt;FireFox&lt;/ConnectionSubType&gt;
/// &lt;ConnectionType&gt;WebBrowser&lt;/ConnectionType&gt;
/// &lt;Description&gt;Website description&lt;/Description&gt;
/// &lt;ID&gt;65092747-6870-42c9-b8bc-35ec9fb5b3fb&lt;/ID&gt;
/// &lt;Name&gt;website connection&lt;/Name&gt;
/// &lt;OpenEmbedded&gt;true&lt;/OpenEmbedded&gt;
/// &lt;Stamp&gt;d04a9abb-4d4c-4ba5-8ef8-1699bd84b734&lt;/Stamp&gt;
/// &lt;WebBrowserApplication&gt;FireFox&lt;/WebBrowserApplication&gt;
/// &lt;WebBrowserUrl&gt;https://www.google.com:8080&lt;/WebBrow [rest of string was truncated]&quot;;.
/// </summary>
internal static string website_rdm_export {
get {
return ResourceManager.GetString("website_rdm_export", resourceCulture);
}
}
} }
} }

View File

@@ -190,19 +190,4 @@
<data name="update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> <value>..\Resources\update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data> </data>
<data name="rdp_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\rdp.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="ssh_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ssh.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
</data>
<data name="telnet_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\telnet.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="vnc_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\vnc.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="website_rdm_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\website.rdm;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root> </root>

View File

@@ -1,65 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<AuthentificationLevel>WarnMe</AuthentificationLevel>
<AutomaticallyClose>true</AutomaticallyClose>
<AutomaticallyCloseInterval>17</AutomaticallyCloseInterval>
<ConnectionType>RDPConfigured</ConnectionType>
<Console>true</Console>
<Description>This is a general description</Description>
<DesktopComposition>true</DesktopComposition>
<DisableBitmapCache>true</DisableBitmapCache>
<DisableThemes>true</DisableThemes>
<DisableWallpaper>true</DisableWallpaper>
<FontSmoothing>true</FontSmoothing>
<ID>1f36e6f0-90ca-4607-b6ec-86227738486d</ID>
<KeyboardHook>OnTheRemoteComputer</KeyboardHook>
<Name>rdp connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<ScreenColor>C256</ScreenColor>
<ScreenSize>CurrentScreenSize</ScreenSize>
<SoundHook>DoNotPlay</SoundHook>
<Stamp>22400949-a0b8-46c1-8f27-49232ac1fb27</Stamp>
<Url>my.rdp.host.com:1234</Url>
<UsesClipboard>false</UsesClipboard>
<UsesHardDrives>false</UsesHardDrives>
<UsesPrinters>true</UsesPrinters>
<UsesSerialPorts>false</UsesSerialPorts>
<UsesSmartDevices>true</UsesSmartDevices>
<MetaInformation>
<MAC>mac-add-goes-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T14:40:54</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<RDP>
<AudioCaptureRedirectionMode>true</AudioCaptureRedirectionMode>
<Domain>domain1</Domain>
<EnableCredSSPSupport>True</EnableCredSSPSupport>
<GatewayCredentialsSource>UserPassword</GatewayCredentialsSource>
<GatewayDomain>rddomain1</GatewayDomain>
<GatewayHostname>rdhost1</GatewayHostname>
<GatewayProfileUsageMethod>Explicit</GatewayProfileUsageMethod>
<GatewaySafePassword>kLaEwH4EDrZEaaK21HgqHg==</GatewaySafePassword>
<GatewayUsageMethod>ModeDirect</GatewayUsageMethod>
<GatewayUserName>rduser1</GatewayUserName>
<HyperVInstanceID>instance-id-here</HyperVInstanceID>
<KeepAliveInterval>6</KeepAliveInterval>
<KeyboardLayoutText>Default</KeyboardLayoutText>
<NetworkLevelAuthentication>true</NetworkLevelAuthentication>
<PromptCredentialOnce>true</PromptCredentialOnce>
<RDPType>HyperV</RDPType>
<SafePassword>tW7TUhUf1KUzuzuAdANJvg==</SafePassword>
<ScreenSizingMode>AutoScale</ScreenSizingMode>
<ShadowSessionConsentPrompt>false</ShadowSessionConsentPrompt>
<UseEnhancedSessionMode>true</UseEnhancedSessionMode>
<UserName>user1</UserName>
<Version>RDP70</Version>
</RDP>
</Connection>
</ArrayOfConnection>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>SSHShell</ConnectionType>
<Description>This is a linux host description</Description>
<ID>44ae261f-0094-48a2-93cb-bc5abcfcc394</ID>
<Name>ssh connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>ab007011-2836-426f-a8e0-9fef1ff88865</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T20:46:26</ModifiedDateTime>
<SafePassword>rV4oZM9LrfZ6SYHIlwTwvA==</SafePassword>
</PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T14:42:38</ModifiedDateTime>
<SafePassword>rV4oZM9LrfbUvSh5Y2lNDw==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Terminal>
<Host>mysshhost</Host>
<HostPort>4321</HostPort>
<PrivateKeyPromptForPassPhrase>false</PrivateKeyPromptForPassPhrase>
<SafePassword>/et4Enc7v6HUQXJP6chuhA==</SafePassword>
<Username>linuxuser1</Username>
</Terminal>
<TerminalMac />
</Connection>
</ArrayOfConnection>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>Telnet</ConnectionType>
<Description>Telnet description</Description>
<ID>8d77d3ac-b414-4b51-ac10-60304d63cc6f</ID>
<Name>telnet connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>08aaa9ff-3583-4dc0-8622-3a0f4d37a7c4</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:50:48</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Terminal>
<Host>telnethost1</Host>
<HostPort>7648</HostPort>
<ProxyMode>Custom</ProxyMode>
<SafePassword>yLHh9AVRl8TilluPKnidMw==</SafePassword>
<Username>user1</Username>
</Terminal>
<TerminalMac />
</Connection>
</ArrayOfConnection>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionSubType>UltraVNC</ConnectionSubType>
<ConnectionType>VNC</ConnectionType>
<Description>This is a VNC description</Description>
<ID>16ff7dd6-2ac3-4e27-96cf-435b5bfe5a00</ID>
<Name>vnc connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>a44e3b58-2e14-47bf-8a79-0646b1e4ba46</Stamp>
<MetaInformation>
<MAC>some-mac-here</MAC>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:12:44</ModifiedDateTime>
<SafePassword>aHjuKKmVmbivKM+wovI3aA==</SafePassword>
</PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T21:08:16</ModifiedDateTime>
<SafePassword>uEGtwH/QfjSvKM+wovI3aA==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<VNC>
<CustomCompressionLevel>4</CustomCompressionLevel>
<DisableClipboard>true</DisableClipboard>
<Host>vnchost1</Host>
<JPEGCompressionLevel>3</JPEGCompressionLevel>
<MsDomain>windomain1</MsDomain>
<MsSafePassword>bUWiWCi7qod7YQ5XXK5LFQ==</MsSafePassword>
<MsUser>winuser1</MsUser>
<Port>9987</Port>
<PreferredEncoding>Tight</PreferredEncoding>
<ProxyHost>proxyhost:7777</ProxyHost>
<SafePassword>oGzaL3q/dK17YQ5XXK5LFQ==</SafePassword>
<ScreenColorDepth>C8</ScreenColorDepth>
<ViewOnly>true</ViewOnly>
<VNCEmbeddedType>UltraVNC</VNCEmbeddedType>
</VNC>
</Connection>
</ArrayOfConnection>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionSubType>FireFox</ConnectionSubType>
<ConnectionType>WebBrowser</ConnectionType>
<Description>Website description</Description>
<ID>65092747-6870-42c9-b8bc-35ec9fb5b3fb</ID>
<Name>website connection</Name>
<OpenEmbedded>true</OpenEmbedded>
<Stamp>d04a9abb-4d4c-4ba5-8ef8-1699bd84b734</Stamp>
<WebBrowserApplication>FireFox</WebBrowserApplication>
<WebBrowserUrl>https://www.google.com:8080</WebBrowserUrl>
<MetaInformation>
<PasswordHistory>
<PasswordHistory>
<LoggedModifiedBy>LEVIATHAN\David</LoggedModifiedBy>
<ModifiedBy>LEVIATHAN\David</ModifiedBy>
<ModifiedDateTime>2020-01-26T22:01:26</ModifiedDateTime>
<SafePassword>T2/JO7Aps+GMZG0vk5Jo8A==</SafePassword>
</PasswordHistory>
</PasswordHistory>
</MetaInformation>
<Web>
<Domain>domain1</Domain>
<SafePassword>24ifhl01e7Le3Aj8NxM4ww==</SafePassword>
<UserName>user1</UserName>
</Web>
</Connection>
</ArrayOfConnection>

View File

@@ -64,7 +64,6 @@
public TType VNCColors { get; set; } public TType VNCColors { get; set; }
public TType VNCSmartSizeMode { get; set; } public TType VNCSmartSizeMode { get; set; }
public TType VNCViewOnly { get; set; } public TType VNCViewOnly { get; set; }
public TType RdpVersion { get; set; } public TType RdpVersion { get; set; }
public TType UseEnhancedMode { get; set; } }
}
} }

View File

@@ -1,6 +1,7 @@
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using mRemoteNG.UI.Controls.PageSequence; using mRemoteNG.UI.Controls.PageSequence;
using NSubstitute;
using NUnit.Framework; using NUnit.Framework;
namespace mRemoteNGTests.UI.Controls namespace mRemoteNGTests.UI.Controls

View File

@@ -1,4 +1,11 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace mRemoteNGTests.UI.Controls namespace mRemoteNGTests.UI.Controls

View File

@@ -1,4 +1,6 @@
using NUnit.Framework; using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using NUnit.Framework;
using mRemoteNG.UI.Forms; using mRemoteNG.UI.Forms;
namespace mRemoteNGTests.UI.Forms namespace mRemoteNGTests.UI.Forms
@@ -15,7 +17,7 @@ namespace mRemoteNGTests.UI.Forms
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {
_optionsForm = new FrmOptions(); _optionsForm = new FrmOptions(new ConnectionInitiator(new ProtocolFactory()));
_optionsForm.Show(); _optionsForm.Show();
} }

View File

@@ -30,8 +30,8 @@ namespace mRemoteNGTests.UI.Forms
[SetUICulture("en-US")] [SetUICulture("en-US")]
public void PasswordFormText() public void PasswordFormText()
{ {
var formTester = new FormTester("PasswordForm"); FormTester formTester = new FormTester("PasswordForm");
Assert.That(formTester.Text, Does.Match("mRemoteNG password")); Assert.That(formTester.Text, Does.Match("Password"));
} }
[Test] [Test]

View File

@@ -342,15 +342,6 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
nameof(ConnectionInfo.CacheBitmaps), nameof(ConnectionInfo.CacheBitmaps),
}); });
break; break;
case ProtocolType.PowerShell:
expectedProperties.AddRange(new[]
{
nameof(ConnectionInfo.Username),
nameof(ConnectionInfo.Password),
nameof(ConnectionInfo.Domain),
nameof(ConnectionInfo.Port),
});
break;
case ProtocolType.IntApp: case ProtocolType.IntApp:
expectedProperties.AddRange(new[] expectedProperties.AddRange(new[]
{ {

View File

@@ -1,4 +1,5 @@
using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.RDP; using mRemoteNG.Connection.Protocol.RDP;
using NUnit.Framework; using NUnit.Framework;

View File

@@ -1,4 +1,6 @@
using System.Threading; using System.Threading;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.UI.Window; using mRemoteNG.UI.Window;
using NUnit.Framework; using NUnit.Framework;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
@@ -13,7 +15,7 @@ namespace mRemoteNGTests.UI.Window
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {
_connectionTreeWindow = new ConnectionTreeWindow(new DockContent()); _connectionTreeWindow = new ConnectionTreeWindow(new DockContent(), new ConnectionInitiator(new ProtocolFactory()));
} }
[TearDown] [TearDown]

View File

@@ -8,7 +8,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
@@ -16,12 +16,8 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" /> <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.2.0" newVersion="3.9.2.0" /> <bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /></startup></configuration>

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\ReportGenerator.4.3.0\build\netstandard2.0\ReportGenerator.props" Condition="Exists('..\packages\ReportGenerator.4.3.0\build\netstandard2.0\ReportGenerator.props')" />
<Import Project="..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mRemoteNGTests</RootNamespace> <RootNamespace>mRemoteNGTests</RootNamespace>
<AssemblyName>mRemoteNGTests</AssemblyName> <AssemblyName>mRemoteNGTests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -71,7 +70,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL"> <Reference Include="NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.4.2.1\lib\net46\NSubstitute.dll</HintPath> <HintPath>..\packages\NSubstitute.4.2.0\lib\net46\NSubstitute.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
@@ -87,11 +86,11 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" /> <Reference Include="System.DirectoryServices" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
@@ -123,7 +122,6 @@
<Compile Include="Config\DataProviders\FileBackupCreatorTests.cs" /> <Compile Include="Config\DataProviders\FileBackupCreatorTests.cs" />
<Compile Include="Config\DataProviders\FileDataProviderTests.cs" /> <Compile Include="Config\DataProviders\FileDataProviderTests.cs" />
<Compile Include="Config\DataProviders\FileDataProviderWithRollingBackupTests.cs" /> <Compile Include="Config\DataProviders\FileDataProviderWithRollingBackupTests.cs" />
<Compile Include="Config\Serializers\MiscSerializers\RemoteDesktopManagerDeserializerTests.cs" />
<Compile Include="Config\Serializers\ConnectionSerializers\Xml\ValidateXmlSchemas.cs" /> <Compile Include="Config\Serializers\ConnectionSerializers\Xml\ValidateXmlSchemas.cs" />
<Compile Include="Config\Serializers\DataTableDeserializerTests.cs" /> <Compile Include="Config\Serializers\DataTableDeserializerTests.cs" />
<Compile Include="Config\CredentialHarvesterTests.cs" /> <Compile Include="Config\CredentialHarvesterTests.cs" />
@@ -255,10 +253,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="Resources\rdp.rdm" />
<None Include="Resources\ssh.rdm" />
<None Include="Resources\vnc.rdm" />
<None Include="Resources\website.rdm" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
@@ -278,7 +272,6 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Resources\confCons_v2_5.xml" /> <None Include="Resources\confCons_v2_5.xml" />
<None Include="Resources\telnet.rdm" />
<None Include="Resources\test_puttyConnectionManager_database.dat" /> <None Include="Resources\test_puttyConnectionManager_database.dat" />
<None Include="Resources\test_rdcman_badVersionNumber.rdg" /> <None Include="Resources\test_rdcman_badVersionNumber.rdg" />
<None Include="Resources\test_rdcman_noversion.rdg" /> <None Include="Resources\test_rdcman_noversion.rdg" />
@@ -349,9 +342,8 @@
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\ReportGenerator.4.3.0\build\netstandard2.0\ReportGenerator.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ReportGenerator.4.3.0\build\netstandard2.0\ReportGenerator.props'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -4,19 +4,19 @@
<package id="Castle.Core" version="4.4.0" targetFramework="net46" /> <package id="Castle.Core" version="4.4.0" targetFramework="net46" />
<package id="DockPanelSuite" version="3.0.6" targetFramework="net46" /> <package id="DockPanelSuite" version="3.0.6" targetFramework="net46" />
<package id="log4net" version="2.0.8" targetFramework="net46" /> <package id="log4net" version="2.0.8" targetFramework="net46" />
<package id="NSubstitute" version="4.2.1" targetFramework="net472" /> <package id="NSubstitute" version="4.2.0" targetFramework="net46" />
<package id="NUnit" version="3.12.0" targetFramework="net46" /> <package id="NUnit" version="3.12.0" targetFramework="net46" />
<package id="NUnit.Console" version="3.10.0" targetFramework="net46" /> <package id="NUnit.Console" version="3.10.0" targetFramework="net46" />
<package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net46" /> <package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net46" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net46" /> <package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net46" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.7" targetFramework="net472" /> <package id="NUnit.Extension.TeamCityEventListener" version="1.0.6" targetFramework="net46" />
<package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net46" /> <package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net46" />
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net472" /> <package id="NUnit3TestAdapter" version="3.13.0" targetFramework="net46" />
<package id="ObjectListView.Official" version="2.9.1" targetFramework="net46" /> <package id="ObjectListView.Official" version="2.9.1" targetFramework="net46" />
<package id="OpenCover" version="4.7.922" targetFramework="net46" /> <package id="OpenCover" version="4.7.922" targetFramework="net46" />
<package id="ReportGenerator" version="4.3.0" targetFramework="net472" /> <package id="ReportGenerator" version="3.0.2" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net46" />
</packages> </packages>

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
@@ -23,12 +23,11 @@ namespace mRemoteNG.App
openFileDialog.Multiselect = true; openFileDialog.Multiselect = true;
var fileTypes = new List<string>(); var fileTypes = new List<string>();
fileTypes.AddRange(new[] {Language.strFilterAllImportable, "*.xml;*.rdp;*.rdg;*.dat;*.csv;*.rdm"}); fileTypes.AddRange(new[] {Language.strFilterAllImportable, "*.xml;*.rdp;*.rdg;*.dat;*.csv"});
fileTypes.AddRange(new[] {Language.strFiltermRemoteXML, "*.xml"}); fileTypes.AddRange(new[] {Language.strFiltermRemoteXML, "*.xml"});
fileTypes.AddRange(new[] {Language.strFiltermRemoteCSV, "*.csv"}); fileTypes.AddRange(new[] {Language.strFiltermRemoteCSV, "*.csv"});
fileTypes.AddRange(new[] {Language.strFilterRDP, "*.rdp"}); fileTypes.AddRange(new[] {Language.strFilterRDP, "*.rdp"});
fileTypes.AddRange(new[] {Language.strFilterRdgFiles, "*.rdg"}); fileTypes.AddRange(new[] {Language.strFilterRdgFiles, "*.rdg"});
fileTypes.AddRange(new[] {Language.RemoteDesktopManagerFiles, "*.rdm"});
fileTypes.AddRange(new[] {Language.strFilterPuttyConnectionManager, "*.dat"}); fileTypes.AddRange(new[] {Language.strFilterPuttyConnectionManager, "*.dat"});
fileTypes.AddRange(new[] {Language.strFilterAll, "*.*"}); fileTypes.AddRange(new[] {Language.strFilterAll, "*.*"});
@@ -126,8 +125,6 @@ namespace mRemoteNG.App
return new RemoteDesktopConnectionManagerImporter(); return new RemoteDesktopConnectionManagerImporter();
case ".dat": case ".dat":
return new PuttyConnectionManagerImporter(); return new PuttyConnectionManagerImporter();
case ".rdm":
return new RemoteDesktopManagerImporter();
default: default:
throw new FileFormatException("Unrecognized file format."); throw new FileFormatException("Unrecognized file format.");
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
using mRemoteNG.App.Info; using mRemoteNG.App.Info;
using mRemoteNG.Config.Putty; using mRemoteNG.Config.Putty;
using mRemoteNG.Connection; using mRemoteNG.Connection;
using mRemoteNG.Credential; using mRemoteNG.Credential;

View File

@@ -1,4 +1,5 @@
using System; using System;
using mRemoteNG.Connection;
using mRemoteNG.Messages; using mRemoteNG.Messages;
using mRemoteNG.UI; using mRemoteNG.UI;
using mRemoteNG.UI.Forms; using mRemoteNG.UI.Forms;
@@ -20,7 +21,7 @@ namespace mRemoteNG.App
internal static ConnectionTreeWindow TreeForm internal static ConnectionTreeWindow TreeForm
{ {
get => _treeForm ?? (_treeForm = new ConnectionTreeWindow()); get => _treeForm ?? (_treeForm = new ConnectionTreeWindow(ConnectionInitiator));
set => _treeForm = value; set => _treeForm = value;
} }
@@ -29,6 +30,7 @@ namespace mRemoteNG.App
internal static ScreenshotManagerWindow ScreenshotForm { get; set; } = new ScreenshotManagerWindow(); internal static ScreenshotManagerWindow ScreenshotForm { get; set; } = new ScreenshotManagerWindow();
private static UpdateWindow UpdateForm { get; set; } = new UpdateWindow(); private static UpdateWindow UpdateForm { get; set; } = new UpdateWindow();
internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow(); internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow();
internal static IConnectionInitiator ConnectionInitiator { get; set; }
public static void Show(WindowType windowType) public static void Show(WindowType windowType)
@@ -50,7 +52,7 @@ namespace mRemoteNG.App
_adimportForm.Show(dockPanel); _adimportForm.Show(dockPanel);
break; break;
case WindowType.Options: case WindowType.Options:
using (var optionsForm = new FrmOptions()) using (var optionsForm = new FrmOptions(ConnectionInitiator))
{ {
optionsForm.ShowDialog(dockPanel); optionsForm.ShowDialog(dockPanel);
} }
@@ -73,7 +75,7 @@ namespace mRemoteNG.App
break; break;
case WindowType.ExternalApps: case WindowType.ExternalApps:
if (_externalappsForm == null || _externalappsForm.IsDisposed) if (_externalappsForm == null || _externalappsForm.IsDisposed)
_externalappsForm = new ExternalToolsWindow(); _externalappsForm = new ExternalToolsWindow(ConnectionInitiator);
_externalappsForm.Show(dockPanel); _externalappsForm.Show(dockPanel);
break; break;
case WindowType.PortScan: case WindowType.PortScan:

View File

@@ -1,6 +1,7 @@
using System; using System;
using mRemoteNG.App; using mRemoteNG.App;
using mRemoteNG.Config.DataProviders; using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Csv; using mRemoteNG.Config.Serializers.Csv;
using mRemoteNG.Security; using mRemoteNG.Security;
using mRemoteNG.Tree; using mRemoteNG.Tree;

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.SqlClient;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using mRemoteNG.App; using mRemoteNG.App;
@@ -153,16 +154,14 @@ namespace mRemoteNG.Config.Connections
private void UpdateConnectionsTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector) private void UpdateConnectionsTable(RootNodeInfo rootTreeNode, IDatabaseConnector databaseConnector)
{ {
var dataProvider = new SqlDataProvider(databaseConnector);
var currentDataTable = dataProvider.Load();
var cryptoProvider = new LegacyRijndaelCryptographyProvider(); var cryptoProvider = new LegacyRijndaelCryptographyProvider();
var serializer = new DataTableSerializer(_saveFilter, cryptoProvider, var serializer = new DataTableSerializer(_saveFilter, cryptoProvider,
rootTreeNode.PasswordString.ConvertToSecureString()); rootTreeNode.PasswordString.ConvertToSecureString());
serializer.SetSourceDataTable(currentDataTable);
var dataTable = serializer.Serialize(rootTreeNode); var dataTable = serializer.Serialize(rootTreeNode);
//var dbQuery = databaseConnector.DbCommand("DELETE FROM tblCons"); var dataProvider = new SqlDataProvider(databaseConnector);
//dbQuery.ExecuteNonQuery();
var dbQuery = databaseConnector.DbCommand("DELETE FROM tblCons");
dbQuery.ExecuteNonQuery();
dataProvider.Save(dataTable); dataProvider.Save(dataTable);
} }

View File

@@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using mRemoteNG.App; using mRemoteNG.App;
using mRemoteNG.Config.DataProviders; using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml; using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Security; using mRemoteNG.Security;
using mRemoteNG.Security.Factories; using mRemoteNG.Security.Factories;

View File

@@ -44,31 +44,12 @@ namespace mRemoteNG.Config.DataProviders
OpenConnection(); OpenConnection();
if (DatabaseConnector.GetType() == typeof(MSSqlDatabaseConnector)) if (DatabaseConnector.GetType() == typeof(MSSqlDatabaseConnector))
{ {
SqlConnection sqlConnection = (SqlConnection)DatabaseConnector.DbConnection(); using (var sqlBulkCopy = new SqlBulkCopy((SqlConnection)DatabaseConnector.DbConnection()))
using (SqlTransaction transaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.Serializable))
{ {
using (SqlCommand sqlCommand = new SqlCommand()) foreach (DataColumn col in dataTable.Columns)
{ sqlBulkCopy.ColumnMappings.Add(col.ColumnName, col.ColumnName);
sqlCommand.Connection = sqlConnection; sqlBulkCopy.DestinationTableName = "dbo.tblCons";
sqlCommand.Transaction = transaction; sqlBulkCopy.WriteToServer(dataTable);
sqlCommand.CommandText = "SELECT * FROM tblCons";
using (SqlDataAdapter dataAdpater = new SqlDataAdapter())
{
dataAdpater.SelectCommand = sqlCommand;
SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
// Avoid optimistic concurrency, check if it is necessary.
builder.ConflictOption = ConflictOption.OverwriteChanges;
dataAdpater.UpdateCommand = builder.GetUpdateCommand();
dataAdpater.DeleteCommand = builder.GetDeleteCommand();
dataAdpater.InsertCommand = builder.GetInsertCommand();
dataAdpater.Update(dataTable);
transaction.Commit();
}
}
} }
} }

View File

@@ -1,7 +1,8 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using mRemoteNG.App; using mRemoteNG.App;
using mRemoteNG.Config.DataProviders; using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml; using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Container; using mRemoteNG.Container;
using mRemoteNG.Messages; using mRemoteNG.Messages;

View File

@@ -1,18 +0,0 @@
using mRemoteNG.Config.Serializers.MiscSerializers;
using mRemoteNG.Container;
namespace mRemoteNG.Config.Import
{
/// <summary>
/// Imports connections from Devolutions *.rdm files.
/// </summary>
public class RemoteDesktopManagerImporter : IConnectionImporter<string>
{
public void Import(string source, ContainerInfo destinationContainer)
{
var deserializer = new RemoteDesktopManagerDeserializer();
var tree = deserializer.Deserialize(source);
destinationContainer.AddChildRange(tree.RootNodes[0].Children);
}
}
}

View File

@@ -164,13 +164,6 @@ namespace mRemoteNG.Config.Serializers.Csv
connectionRecord.UseVmId = value; connectionRecord.UseVmId = value;
} }
if (headers.Contains("UseEnhancedMode"))
{
bool value;
if (bool.TryParse(connectionCsv[headers.IndexOf("UseEnhancedMode")], out value))
connectionRecord.UseEnhancedMode = value;
}
if (headers.Contains("RenderingEngine")) if (headers.Contains("RenderingEngine"))
{ {
HTTPBase.RenderingEngine value; HTTPBase.RenderingEngine value;
@@ -571,13 +564,6 @@ namespace mRemoteNG.Config.Serializers.Csv
connectionRecord.Inheritance.UseVmId = value; connectionRecord.Inheritance.UseVmId = value;
} }
if (headers.Contains("InheritUseEnhancedMode"))
{
bool value;
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritUseEnhancedMode")], out value))
connectionRecord.Inheritance.UseEnhancedMode = value;
}
if (headers.Contains("InheritRenderingEngine")) if (headers.Contains("InheritRenderingEngine"))
{ {
bool value; bool value;

View File

@@ -56,7 +56,7 @@ namespace mRemoteNG.Config.Serializers.Csv
if (_saveFilter.SaveDomain) if (_saveFilter.SaveDomain)
sb.Append("Domain;"); sb.Append("Domain;");
sb.Append("Hostname;Port;VmId;Protocol;PuttySession;ConnectToConsole;UseCredSsp;UseVmId;UseEnhancedMode;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;" + sb.Append("Hostname;VmId;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;UseVmId;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;" +
"LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;" + "LoadBalanceInfo;Colors;Resolution;AutomaticResize;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;" +
"CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" + "CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" +
"PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;" + "PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;Favorite;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;" +
@@ -68,7 +68,7 @@ namespace mRemoteNG.Config.Serializers.Csv
"InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;" + "InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;" +
"InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;" + "InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;" +
"InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;" + "InheritRedirectClipboard;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritAutomaticResize;" +
"InheritUseConsoleSession;InheritUseCredSsp;InheritUseVmId;InheritUseEnhancedMode;InheritVmId;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;" + "InheritUseConsoleSession;InheritUseCredSsp;InheritUseVmId;InheritVmId;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;" +
"InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;" + "InheritRDPAuthenticationLevel;InheritLoadBalanceInfo;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;" +
"InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;" + "InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;" +
"InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;" + "InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;" +
@@ -116,14 +116,13 @@ namespace mRemoteNG.Config.Serializers.Csv
sb.Append(FormatForCsv(con.Domain)); sb.Append(FormatForCsv(con.Domain));
sb.Append(FormatForCsv(con.Hostname)) sb.Append(FormatForCsv(con.Hostname))
.Append(FormatForCsv(con.Port))
.Append(FormatForCsv(con.VmId)) .Append(FormatForCsv(con.VmId))
.Append(FormatForCsv(con.Protocol)) .Append(FormatForCsv(con.Protocol))
.Append(FormatForCsv(con.PuttySession)) .Append(FormatForCsv(con.PuttySession))
.Append(FormatForCsv(con.Port))
.Append(FormatForCsv(con.UseConsoleSession)) .Append(FormatForCsv(con.UseConsoleSession))
.Append(FormatForCsv(con.UseCredSsp)) .Append(FormatForCsv(con.UseCredSsp))
.Append(FormatForCsv(con.UseVmId)) .Append(FormatForCsv(con.UseVmId))
.Append(FormatForCsv(con.UseEnhancedMode))
.Append(FormatForCsv(con.RenderingEngine)) .Append(FormatForCsv(con.RenderingEngine))
.Append(FormatForCsv(con.ICAEncryptionStrength)) .Append(FormatForCsv(con.ICAEncryptionStrength))
.Append(FormatForCsv(con.RDPAuthenticationLevel)) .Append(FormatForCsv(con.RDPAuthenticationLevel))
@@ -199,7 +198,6 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.Inheritance.UseConsoleSession)) .Append(FormatForCsv(con.Inheritance.UseConsoleSession))
.Append(FormatForCsv(con.Inheritance.UseCredSsp)) .Append(FormatForCsv(con.Inheritance.UseCredSsp))
.Append(FormatForCsv(con.Inheritance.UseVmId)) .Append(FormatForCsv(con.Inheritance.UseVmId))
.Append(FormatForCsv(con.Inheritance.UseEnhancedMode))
.Append(FormatForCsv(con.Inheritance.VmId)) .Append(FormatForCsv(con.Inheritance.VmId))
.Append(FormatForCsv(con.Inheritance.RenderingEngine)) .Append(FormatForCsv(con.Inheritance.RenderingEngine))
.Append(FormatForCsv(con.Inheritance.Username)) .Append(FormatForCsv(con.Inheritance.Username))

View File

@@ -14,6 +14,7 @@ using System.Data;
using System.Linq; using System.Linq;
using System.Security; using System.Security;
using mRemoteNG.Security; using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tools; using mRemoteNG.Tools;
namespace mRemoteNG.Config.Serializers.MsSql namespace mRemoteNG.Config.Serializers.MsSql
@@ -89,7 +90,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.Password = DecryptValue((string)dataRow["Password"]); connectionInfo.Password = DecryptValue((string)dataRow["Password"]);
connectionInfo.Hostname = (string)dataRow["Hostname"]; connectionInfo.Hostname = (string)dataRow["Hostname"];
connectionInfo.VmId = (string)dataRow["VmId"]; connectionInfo.VmId = (string)dataRow["VmId"];
connectionInfo.UseEnhancedMode = (bool)dataRow["UseEnhancedMode"];
connectionInfo.Protocol = (ProtocolType)Enum.Parse(typeof(ProtocolType), (string)dataRow["Protocol"]); connectionInfo.Protocol = (ProtocolType)Enum.Parse(typeof(ProtocolType), (string)dataRow["Protocol"]);
connectionInfo.PuttySession = (string)dataRow["PuttySession"]; connectionInfo.PuttySession = (string)dataRow["PuttySession"];
connectionInfo.Port = (int)dataRow["Port"]; connectionInfo.Port = (int)dataRow["Port"];
@@ -196,7 +196,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.Inheritance.UseConsoleSession = (bool)dataRow["InheritUseConsoleSession"]; connectionInfo.Inheritance.UseConsoleSession = (bool)dataRow["InheritUseConsoleSession"];
connectionInfo.Inheritance.UseCredSsp = (bool)dataRow["InheritUseCredSsp"]; connectionInfo.Inheritance.UseCredSsp = (bool)dataRow["InheritUseCredSsp"];
connectionInfo.Inheritance.UseVmId = (bool)dataRow["InheritUseVmId"]; connectionInfo.Inheritance.UseVmId = (bool)dataRow["InheritUseVmId"];
connectionInfo.Inheritance.UseEnhancedMode = (bool)dataRow["InheritUseEnhancedMode"];
connectionInfo.Inheritance.VmId = (bool)dataRow["InheritVmId"]; connectionInfo.Inheritance.VmId = (bool)dataRow["InheritVmId"];
connectionInfo.Inheritance.RenderingEngine = (bool)dataRow["InheritRenderingEngine"]; connectionInfo.Inheritance.RenderingEngine = (bool)dataRow["InheritRenderingEngine"];
connectionInfo.Inheritance.Username = (bool)dataRow["InheritUsername"]; connectionInfo.Inheritance.Username = (bool)dataRow["InheritUsername"];

View File

@@ -5,7 +5,6 @@ using mRemoteNG.Tools;
using mRemoteNG.Tree; using mRemoteNG.Tree;
using mRemoteNG.Tree.Root; using mRemoteNG.Tree.Root;
using System; using System;
using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Security; using System.Security;
@@ -14,17 +13,14 @@ namespace mRemoteNG.Config.Serializers.MsSql
{ {
public class DataTableSerializer : ISerializer<ConnectionInfo, DataTable> public class DataTableSerializer : ISerializer<ConnectionInfo, DataTable>
{ {
public readonly int DELETE = 0;
private readonly ICryptographyProvider _cryptographyProvider; private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey; private readonly SecureString _encryptionKey;
private DataTable _dataTable; private DataTable _dataTable;
private DataTable _sourceDataTable;
private Dictionary<string, int> sourcePrimaryKeyDict = new Dictionary<string, int>();
private const string TableName = "tblCons"; private const string TableName = "tblCons";
private readonly SaveFilter _saveFilter; private readonly SaveFilter _saveFilter;
private int _currentNodeIndex; private int _currentNodeIndex;
public Version Version { get; } = new Version(2, 8); public Version Version { get; } = new Version(2, 7);
public DataTableSerializer(SaveFilter saveFilter, public DataTableSerializer(SaveFilter saveFilter,
ICryptographyProvider cryptographyProvider, ICryptographyProvider cryptographyProvider,
@@ -35,11 +31,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
_encryptionKey = encryptionKey.ThrowIfNull(nameof(encryptionKey)); _encryptionKey = encryptionKey.ThrowIfNull(nameof(encryptionKey));
} }
public void SetSourceDataTable(DataTable sourceDataTable)
{
_sourceDataTable = sourceDataTable;
}
public DataTable Serialize(ConnectionTreeModel connectionTreeModel) public DataTable Serialize(ConnectionTreeModel connectionTreeModel)
{ {
@@ -60,33 +51,15 @@ namespace mRemoteNG.Config.Serializers.MsSql
{ {
_dataTable = BuildTable(); _dataTable = BuildTable();
_currentNodeIndex = 0; _currentNodeIndex = 0;
// Register add or update row
SerializeNodesRecursive(serializationTarget); SerializeNodesRecursive(serializationTarget);
var entryToDelete = sourcePrimaryKeyDict.Keys.ToList();
foreach( var entry in entryToDelete)
{
_dataTable.Rows.Find(entry).Delete();
}
return _dataTable; return _dataTable;
} }
private DataTable BuildTable() private DataTable BuildTable()
{ {
DataTable dataTable; var dataTable = new DataTable(TableName);
if (_sourceDataTable != null) CreateSchema(dataTable);
{ SetPrimaryKey(dataTable);
dataTable = _sourceDataTable;
}else
{
dataTable = new DataTable(TableName);
}
if (dataTable.Columns.Count == 0) CreateSchema(dataTable);
if (dataTable.PrimaryKey.Length == 0 ) SetPrimaryKey(dataTable);
foreach(DataRow row in dataTable.Rows)
{
sourcePrimaryKeyDict.Add((string)row["ConstantID"], DELETE);
}
return dataTable; return dataTable;
} }
@@ -218,14 +191,10 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataTable.Columns.Add("InheritSoundQuality", typeof(bool)); dataTable.Columns.Add("InheritSoundQuality", typeof(bool));
dataTable.Columns.Add("VmId", typeof(string)); dataTable.Columns.Add("VmId", typeof(string));
dataTable.Columns.Add("UseVmId", typeof(bool)); dataTable.Columns.Add("UseVmId", typeof(bool));
dataTable.Columns.Add("UseEnhancedMode", typeof(bool));
dataTable.Columns.Add("InheritVmId", typeof(bool)); dataTable.Columns.Add("InheritVmId", typeof(bool));
dataTable.Columns.Add("InheritUseVmId", typeof(bool)); dataTable.Columns.Add("InheritUseVmId", typeof(bool));
dataTable.Columns.Add("InheritUseEnhancedMode", typeof(bool));
dataTable.Columns.Add("RdpVersion", typeof(string)); dataTable.Columns.Add("RdpVersion", typeof(string));
dataTable.Columns.Add("InheritRdpVersion", typeof(bool)); dataTable.Columns.Add("InheritRdpVersion", typeof(bool));
dataTable.Columns.Add("EnhancedMode", typeof(bool));
dataTable.Columns.Add("InheritEnhancedMode", typeof(bool));
} }
private void SetPrimaryKey(DataTable dataTable) private void SetPrimaryKey(DataTable dataTable)
@@ -243,244 +212,14 @@ namespace mRemoteNG.Config.Serializers.MsSql
SerializeNodesRecursive(child); SerializeNodesRecursive(child);
} }
public bool isRowUpdated(ConnectionInfo connectionInfo, DataRow dataRow)
{
var isFieldNotChange = dataRow["Name"].Equals(connectionInfo.Name) &&
dataRow["Type"].Equals(connectionInfo.GetTreeNodeType().ToString()) &&
dataRow["ParentID"].Equals(connectionInfo.Parent?.ConstantID ?? "") &&
dataRow["PositionID"].Equals(_currentNodeIndex) &&
dataRow["Expanded"].Equals(false) &&
dataRow["Description"].Equals(connectionInfo.Description) &&
dataRow["Icon"].Equals(connectionInfo.Icon) &&
dataRow["Panel"].Equals(connectionInfo.Panel) &&
dataRow["Username"].Equals(_saveFilter.SaveUsername ? connectionInfo.Username : "") &&
dataRow["DomainName"].Equals(_saveFilter.SaveDomain ? connectionInfo.Domain : "");
isFieldNotChange = isFieldNotChange && dataRow["Hostname"].Equals(connectionInfo.Hostname);
isFieldNotChange = isFieldNotChange && dataRow["VmId"].Equals(connectionInfo.VmId);
isFieldNotChange = isFieldNotChange && dataRow["Protocol"].Equals(connectionInfo.Protocol.ToString());
isFieldNotChange = isFieldNotChange && dataRow["PuttySession"].Equals(connectionInfo.PuttySession);
isFieldNotChange = isFieldNotChange &&
dataRow["Port"].Equals(connectionInfo.Port);
isFieldNotChange = isFieldNotChange &&
dataRow["ConnectToConsole"].Equals(connectionInfo.UseConsoleSession);
isFieldNotChange = isFieldNotChange &&
dataRow["UseCredSsp"].Equals(connectionInfo.UseCredSsp);
isFieldNotChange = isFieldNotChange &&
dataRow["UseVmId"].Equals(connectionInfo.UseVmId);
isFieldNotChange = isFieldNotChange &&
dataRow["UseEnhancedMode"].Equals(connectionInfo.UseEnhancedMode);
isFieldNotChange = isFieldNotChange &&
dataRow["RenderingEngine"].Equals(connectionInfo.RenderingEngine.ToString());
isFieldNotChange = isFieldNotChange &&
dataRow["ICAEncryptionStrength"].Equals(connectionInfo.ICAEncryptionStrength.ToString());
isFieldNotChange = isFieldNotChange &&
dataRow["RDPAuthenticationLevel"].Equals(connectionInfo.RDPAuthenticationLevel.ToString());
isFieldNotChange = isFieldNotChange &&
dataRow["RDPMinutesToIdleTimeout"].Equals(connectionInfo.RDPMinutesToIdleTimeout);
isFieldNotChange = isFieldNotChange &&
dataRow["RDPAlertIdleTimeout"].Equals(connectionInfo.RDPAlertIdleTimeout);
isFieldNotChange = isFieldNotChange &&
dataRow["LoadBalanceInfo"].Equals(connectionInfo.LoadBalanceInfo);
isFieldNotChange = isFieldNotChange &&
dataRow["Colors"].Equals(connectionInfo.Colors.ToString());
isFieldNotChange = isFieldNotChange &&
dataRow["Resolution"].Equals(connectionInfo.Resolution.ToString());
isFieldNotChange = isFieldNotChange &&
dataRow["AutomaticResize"].Equals(connectionInfo.AutomaticResize);
isFieldNotChange = isFieldNotChange &&
dataRow["DisplayWallpaper"].Equals(connectionInfo.DisplayWallpaper) &&
dataRow["DisplayThemes"].Equals(connectionInfo.DisplayThemes) &&
dataRow["EnableFontSmoothing"].Equals(connectionInfo.EnableFontSmoothing) &&
dataRow["EnableDesktopComposition"].Equals(connectionInfo.EnableDesktopComposition) &&
dataRow["CacheBitmaps"].Equals(connectionInfo.CacheBitmaps) &&
dataRow["RedirectDiskDrives"].Equals(connectionInfo.RedirectDiskDrives) &&
dataRow["RedirectPorts"].Equals(connectionInfo.RedirectPorts) &&
dataRow["RedirectPrinters"].Equals(connectionInfo.RedirectPrinters) &&
dataRow["RedirectClipboard"].Equals(connectionInfo.RedirectClipboard) &&
dataRow["RedirectSmartCards"].Equals(connectionInfo.RedirectSmartCards) &&
dataRow["RedirectSound"].Equals(connectionInfo.RedirectSound.ToString()) &&
dataRow["SoundQuality"].Equals(connectionInfo.SoundQuality.ToString()) &&
dataRow["RedirectAudioCapture"].Equals(connectionInfo.RedirectAudioCapture) &&
dataRow["RedirectKeys"].Equals(connectionInfo.RedirectKeys);
isFieldNotChange = isFieldNotChange &&
dataRow["Connected"].Equals(false) && // TODO: this column can eventually be removed. we now save this property locally
dataRow["PreExtApp"].Equals(connectionInfo.PreExtApp) &&
dataRow["PostExtApp"].Equals(connectionInfo.PostExtApp) &&
dataRow["MacAddress"].Equals(connectionInfo.MacAddress) &&
dataRow["UserField"].Equals(connectionInfo.UserField) &&
dataRow["ExtApp"].Equals(connectionInfo.ExtApp) &&
dataRow["VNCCompression"].Equals(connectionInfo.VNCCompression.ToString()) &&
dataRow["VNCEncoding"].Equals(connectionInfo.VNCEncoding.ToString()) &&
dataRow["VNCAuthMode"].Equals(connectionInfo.VNCAuthMode.ToString()) &&
dataRow["VNCProxyType"].Equals(connectionInfo.VNCProxyType.ToString()) &&
dataRow["VNCProxyIP"].Equals(connectionInfo.VNCProxyIP) &&
dataRow["VNCProxyPort"].Equals(connectionInfo.VNCProxyPort) &&
dataRow["VNCProxyUsername"].Equals(connectionInfo.VNCProxyUsername) &&
dataRow["VNCColors"].Equals(connectionInfo.VNCColors.ToString()) &&
dataRow["VNCSmartSizeMode"].Equals(connectionInfo.VNCSmartSizeMode.ToString()) &&
dataRow["VNCViewOnly"].Equals(connectionInfo.VNCViewOnly) &&
dataRow["RDGatewayUsageMethod"].Equals(connectionInfo.RDGatewayUsageMethod.ToString()) &&
dataRow["RDGatewayHostname"].Equals(connectionInfo.RDGatewayHostname) &&
dataRow["RDGatewayUseConnectionCredentials"].Equals(connectionInfo.RDGatewayUseConnectionCredentials.ToString()) &&
dataRow["RDGatewayUsername"].Equals(connectionInfo.RDGatewayUsername) &&
dataRow["RDGatewayDomain"].Equals(connectionInfo.RDGatewayDomain) &&
dataRow["RdpVersion"].Equals(connectionInfo.RdpVersion.ToString());
var isInheritanceFieldNotChange = false;
if (_saveFilter.SaveInheritance)
{
isInheritanceFieldNotChange = (dataRow["InheritCacheBitmaps"].Equals(connectionInfo.Inheritance.CacheBitmaps) &&
dataRow["InheritColors"].Equals(connectionInfo.Inheritance.Colors) &&
dataRow["InheritDescription"].Equals(connectionInfo.Inheritance.Description) &&
dataRow["InheritDisplayThemes"].Equals(connectionInfo.Inheritance.DisplayThemes) &&
dataRow["InheritDisplayWallpaper"].Equals(connectionInfo.Inheritance.DisplayWallpaper) &&
dataRow["InheritEnableFontSmoothing"].Equals(connectionInfo.Inheritance.EnableFontSmoothing) &&
dataRow["InheritEnableDesktopComposition"].Equals(connectionInfo.Inheritance.EnableDesktopComposition) &&
dataRow["InheritDomain"].Equals(connectionInfo.Inheritance.Domain) &&
dataRow["InheritIcon"].Equals(connectionInfo.Inheritance.Icon) &&
dataRow["InheritPanel"].Equals(connectionInfo.Inheritance.Panel) &&
dataRow["InheritPassword"].Equals(connectionInfo.Inheritance.Password) &&
dataRow["InheritPort"].Equals(connectionInfo.Inheritance.Port) &&
dataRow["InheritProtocol"].Equals(connectionInfo.Inheritance.Protocol) &&
dataRow["InheritPuttySession"].Equals(connectionInfo.Inheritance.PuttySession) &&
dataRow["InheritRedirectDiskDrives"].Equals(connectionInfo.Inheritance.RedirectDiskDrives) &&
dataRow["InheritRedirectKeys"].Equals(connectionInfo.Inheritance.RedirectKeys) &&
dataRow["InheritRedirectPorts"].Equals(connectionInfo.Inheritance.RedirectPorts) &&
dataRow["InheritRedirectPrinters"].Equals(connectionInfo.Inheritance.RedirectPrinters) &&
dataRow["InheritRedirectClipboard"].Equals(connectionInfo.Inheritance.RedirectClipboard) &&
dataRow["InheritRedirectSmartCards"].Equals(connectionInfo.Inheritance.RedirectSmartCards) &&
dataRow["InheritRedirectSound"].Equals(connectionInfo.Inheritance.RedirectSound) &&
dataRow["InheritSoundQuality"].Equals(connectionInfo.Inheritance.SoundQuality) &&
dataRow["InheritRedirectAudioCapture"].Equals(connectionInfo.Inheritance.RedirectAudioCapture) &&
dataRow["InheritResolution"].Equals(connectionInfo.Inheritance.Resolution) &&
dataRow["InheritAutomaticResize"].Equals(connectionInfo.Inheritance.AutomaticResize) &&
dataRow["InheritUseConsoleSession"].Equals(connectionInfo.Inheritance.UseConsoleSession) &&
dataRow["InheritUseCredSsp"].Equals(connectionInfo.Inheritance.UseCredSsp) &&
dataRow["InheritRenderingEngine"].Equals(connectionInfo.Inheritance.RenderingEngine) &&
dataRow["InheritUsername"].Equals(connectionInfo.Inheritance.Username) &&
dataRow["InheritVmId"].Equals(connectionInfo.Inheritance.VmId) &&
dataRow["InheritUseVmId"].Equals(connectionInfo.Inheritance.UseVmId) &&
dataRow["InheritUseEnhancedMode"].Equals(connectionInfo.Inheritance.UseEnhancedMode) &&
dataRow["InheritICAEncryptionStrength"].Equals(connectionInfo.Inheritance.ICAEncryptionStrength) &&
dataRow["InheritRDPAuthenticationLevel"].Equals(connectionInfo.Inheritance.RDPAuthenticationLevel) &&
dataRow["InheritRDPMinutesToIdleTimeout"].Equals(connectionInfo.Inheritance.RDPMinutesToIdleTimeout) &&
dataRow["InheritRDPAlertIdleTimeout"].Equals(connectionInfo.Inheritance.RDPAlertIdleTimeout) &&
dataRow["InheritLoadBalanceInfo"].Equals(connectionInfo.Inheritance.LoadBalanceInfo) &&
dataRow["InheritPreExtApp"].Equals(connectionInfo.Inheritance.PreExtApp) &&
dataRow["InheritPostExtApp"].Equals(connectionInfo.Inheritance.PostExtApp) &&
dataRow["InheritMacAddress"].Equals(connectionInfo.Inheritance.MacAddress) &&
dataRow["InheritUserField"].Equals(connectionInfo.Inheritance.UserField) &&
dataRow["InheritExtApp"].Equals(connectionInfo.Inheritance.ExtApp) &&
dataRow["InheritVNCCompression"].Equals(connectionInfo.Inheritance.VNCCompression) &&
dataRow["InheritVNCEncoding"].Equals(connectionInfo.Inheritance.VNCEncoding) &&
dataRow["InheritVNCAuthMode"].Equals(connectionInfo.Inheritance.VNCAuthMode) &&
dataRow["InheritVNCProxyType"].Equals(connectionInfo.Inheritance.VNCProxyType) &&
dataRow["InheritVNCProxyIP"].Equals(connectionInfo.Inheritance.VNCProxyIP) &&
dataRow["InheritVNCProxyPort"].Equals(connectionInfo.Inheritance.VNCProxyPort) &&
dataRow["InheritVNCProxyUsername"].Equals(connectionInfo.Inheritance.VNCProxyUsername) &&
dataRow["InheritVNCProxyPassword"].Equals(connectionInfo.Inheritance.VNCProxyPassword) &&
dataRow["InheritVNCColors"].Equals(connectionInfo.Inheritance.VNCColors) &&
dataRow["InheritVNCSmartSizeMode"].Equals(connectionInfo.Inheritance.VNCSmartSizeMode) &&
dataRow["InheritVNCViewOnly"].Equals(connectionInfo.Inheritance.VNCViewOnly) &&
dataRow["InheritRDGatewayUsageMethod"].Equals(connectionInfo.Inheritance.RDGatewayUsageMethod) &&
dataRow["InheritRDGatewayHostname"].Equals(connectionInfo.Inheritance.RDGatewayHostname) &&
dataRow["InheritRDGatewayUseConnectionCredentials"].Equals(connectionInfo.Inheritance.RDGatewayUseConnectionCredentials) &&
dataRow["InheritRDGatewayUsername"].Equals(connectionInfo.Inheritance.RDGatewayUsername) &&
dataRow["InheritRDGatewayPassword"].Equals(connectionInfo.Inheritance.RDGatewayPassword) &&
dataRow["InheritRDGatewayDomain"].Equals(connectionInfo.Inheritance.RDGatewayDomain) &&
dataRow["InheritRdpVersion"].Equals(connectionInfo.Inheritance.RdpVersion));
}
else
{
isInheritanceFieldNotChange = (dataRow["InheritCacheBitmaps"].Equals(false) &&
dataRow["InheritColors"].Equals(false) &&
dataRow["InheritDescription"].Equals(false) &&
dataRow["InheritDisplayThemes"].Equals(false) &&
dataRow["InheritDisplayWallpaper"].Equals(false) &&
dataRow["InheritEnableFontSmoothing"].Equals(false) &&
dataRow["InheritEnableDesktopComposition"].Equals(false) &&
dataRow["InheritDomain"].Equals(false) &&
dataRow["InheritIcon"].Equals(false) &&
dataRow["InheritPanel"].Equals(false) &&
dataRow["InheritPassword"].Equals(false) &&
dataRow["InheritPort"].Equals(false) &&
dataRow["InheritProtocol"].Equals(false) &&
dataRow["InheritPuttySession"].Equals(false) &&
dataRow["InheritRedirectDiskDrives"].Equals(false) &&
dataRow["InheritRedirectKeys"].Equals(false) &&
dataRow["InheritRedirectPorts"].Equals(false) &&
dataRow["InheritRedirectPrinters"].Equals(false) &&
dataRow["InheritRedirectClipboard"].Equals(false) &&
dataRow["InheritRedirectSmartCards"].Equals(false) &&
dataRow["InheritRedirectSound"].Equals(false) &&
dataRow["InheritSoundQuality"].Equals(false) &&
dataRow["InheritRedirectAudioCapture"].Equals(false) &&
dataRow["InheritResolution"].Equals(false) &&
dataRow["InheritAutomaticResize"].Equals(false) &&
dataRow["InheritUseConsoleSession"].Equals(false) &&
dataRow["InheritUseCredSsp"].Equals(false) &&
dataRow["InheritRenderingEngine"].Equals(false) &&
dataRow["InheritUsername"].Equals(false) &&
dataRow["InheritICAEncryptionStrength"].Equals(false) &&
dataRow["InheritRDPAuthenticationLevel"].Equals(false) &&
dataRow["InheritRDPMinutesToIdleTimeout"].Equals(false) &&
dataRow["InheritRDPAlertIdleTimeout"].Equals(false) &&
dataRow["InheritLoadBalanceInfo"].Equals(false) &&
dataRow["InheritPreExtApp"].Equals(false) &&
dataRow["InheritPostExtApp"].Equals(false) &&
dataRow["InheritMacAddress"].Equals(false) &&
dataRow["InheritUserField"].Equals(false) &&
dataRow["InheritExtApp"].Equals(false) &&
dataRow["InheritVNCCompression"].Equals(false) &&
dataRow["InheritVNCEncoding"].Equals(false) &&
dataRow["InheritVNCAuthMode"].Equals(false) &&
dataRow["InheritVNCProxyType"].Equals(false) &&
dataRow["InheritVNCProxyIP"].Equals(false) &&
dataRow["InheritVNCProxyPort"].Equals(false) &&
dataRow["InheritVNCProxyUsername"].Equals(false) &&
dataRow["InheritVNCProxyPassword"].Equals(false) &&
dataRow["InheritVNCColors"].Equals(false) &&
dataRow["InheritVNCSmartSizeMode"].Equals(false) &&
dataRow["InheritVNCViewOnly"].Equals(false) &&
dataRow["InheritRDGatewayUsageMethod"].Equals(false) &&
dataRow["InheritRDGatewayHostname"].Equals(false) &&
dataRow["InheritRDGatewayUseConnectionCredentials"].Equals(false) &&
dataRow["InheritRDGatewayUsername"].Equals(false) &&
dataRow["InheritRDGatewayPassword"].Equals(false) &&
dataRow["InheritRDGatewayDomain"].Equals(false) &&
dataRow["InheritRdpVersion"].Equals(false));
}
var pwd = dataRow["Password"].Equals(_saveFilter.SavePassword ? _cryptographyProvider.Encrypt(connectionInfo.Password, _encryptionKey) : "") &&
dataRow["VNCProxyPassword"].Equals(_cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey)) &&
dataRow["RDGatewayPassword"].Equals(_cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey));
return !(pwd && isFieldNotChange && isInheritanceFieldNotChange);
}
private void SerializeConnectionInfo(ConnectionInfo connectionInfo) private void SerializeConnectionInfo(ConnectionInfo connectionInfo)
{ {
_currentNodeIndex++; _currentNodeIndex++;
var isNewRow = false; var dataRow = _dataTable.NewRow();
DataRow dataRow = _dataTable.Rows.Find(connectionInfo.ConstantID); dataRow["ID"] = DBNull.Value;
if (dataRow == null)
{
dataRow = _dataTable.NewRow();
dataRow["ConstantID"] = connectionInfo.ConstantID;
isNewRow = true;
}
else
{
sourcePrimaryKeyDict.Remove(connectionInfo.ConstantID);
}
var tmp = isRowUpdated(connectionInfo, dataRow);
if (!tmp){
return;
}
dataRow["Name"] = connectionInfo.Name; dataRow["Name"] = connectionInfo.Name;
dataRow["Type"] = connectionInfo.GetTreeNodeType().ToString(); dataRow["Type"] = connectionInfo.GetTreeNodeType().ToString();
dataRow["ConstantID"] = connectionInfo.ConstantID;
dataRow["ParentID"] = connectionInfo.Parent?.ConstantID ?? ""; dataRow["ParentID"] = connectionInfo.Parent?.ConstantID ?? "";
dataRow["PositionID"] = _currentNodeIndex; dataRow["PositionID"] = _currentNodeIndex;
dataRow["LastChange"] = MiscTools.DBTimeStampNow(); dataRow["LastChange"] = MiscTools.DBTimeStampNow();
@@ -502,7 +241,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["ConnectToConsole"] = connectionInfo.UseConsoleSession; dataRow["ConnectToConsole"] = connectionInfo.UseConsoleSession;
dataRow["UseCredSsp"] = connectionInfo.UseCredSsp; dataRow["UseCredSsp"] = connectionInfo.UseCredSsp;
dataRow["UseVmId"] = connectionInfo.UseVmId; dataRow["UseVmId"] = connectionInfo.UseVmId;
dataRow["UseEnhancedMode"] = connectionInfo.UseEnhancedMode;
dataRow["RenderingEngine"] = connectionInfo.RenderingEngine; dataRow["RenderingEngine"] = connectionInfo.RenderingEngine;
dataRow["ICAEncryptionStrength"] = connectionInfo.ICAEncryptionStrength; dataRow["ICAEncryptionStrength"] = connectionInfo.ICAEncryptionStrength;
dataRow["RDPAuthenticationLevel"] = connectionInfo.RDPAuthenticationLevel; dataRow["RDPAuthenticationLevel"] = connectionInfo.RDPAuthenticationLevel;
@@ -586,7 +324,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritUsername"] = connectionInfo.Inheritance.Username; dataRow["InheritUsername"] = connectionInfo.Inheritance.Username;
dataRow["InheritVmId"] = connectionInfo.Inheritance.VmId; dataRow["InheritVmId"] = connectionInfo.Inheritance.VmId;
dataRow["InheritUseVmId"] = connectionInfo.Inheritance.UseVmId; dataRow["InheritUseVmId"] = connectionInfo.Inheritance.UseVmId;
dataRow["InheritUseEnhancedMode"] = connectionInfo.Inheritance.UseEnhancedMode;
dataRow["InheritICAEncryptionStrength"] = connectionInfo.Inheritance.ICAEncryptionStrength; dataRow["InheritICAEncryptionStrength"] = connectionInfo.Inheritance.ICAEncryptionStrength;
dataRow["InheritRDPAuthenticationLevel"] = connectionInfo.Inheritance.RDPAuthenticationLevel; dataRow["InheritRDPAuthenticationLevel"] = connectionInfo.Inheritance.RDPAuthenticationLevel;
dataRow["InheritRDPMinutesToIdleTimeout"] = connectionInfo.Inheritance.RDPMinutesToIdleTimeout; dataRow["InheritRDPMinutesToIdleTimeout"] = connectionInfo.Inheritance.RDPMinutesToIdleTimeout;
@@ -676,7 +413,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritRDGatewayDomain"] = false; dataRow["InheritRDGatewayDomain"] = false;
dataRow["InheritRdpVersion"] = false; dataRow["InheritRdpVersion"] = false;
} }
if (isNewRow)_dataTable.Rows.Add(dataRow);
_dataTable.Rows.Add(dataRow);
} }
} }
} }

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Security;
namespace mRemoteNG.Config.Serializers.MsSql namespace mRemoteNG.Config.Serializers.MsSql
{ {

View File

@@ -47,7 +47,6 @@ namespace mRemoteNG.Config.Serializers.Xml
element.Add(new XAttribute("Name", connectionInfo.Name)); element.Add(new XAttribute("Name", connectionInfo.Name));
element.Add(new XAttribute("VmId", connectionInfo.VmId)); element.Add(new XAttribute("VmId", connectionInfo.VmId));
element.Add(new XAttribute("UseVmId", connectionInfo.UseVmId)); element.Add(new XAttribute("UseVmId", connectionInfo.UseVmId));
element.Add(new XAttribute("UseEnhancedMode", connectionInfo.UseVmId));
element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString())); element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString()));
if (nodeAsContainer != null) if (nodeAsContainer != null)
element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString().ToLowerInvariant())); element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString().ToLowerInvariant()));
@@ -297,8 +296,6 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.Inheritance.VmId.ToString().ToLowerInvariant())); connectionInfo.Inheritance.VmId.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritUseVmId", element.Add(new XAttribute("InheritUseVmId",
connectionInfo.Inheritance.UseVmId.ToString().ToLowerInvariant())); connectionInfo.Inheritance.UseVmId.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritUseEnhancedMode",
connectionInfo.Inheritance.UseEnhancedMode.ToString().ToLowerInvariant()));
} }
else else
{ {

View File

@@ -542,14 +542,12 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.Favorite = xmlnode.GetAttributeAsBool("Favorite"); connectionInfo.Favorite = xmlnode.GetAttributeAsBool("Favorite");
connectionInfo.UseVmId = xmlnode.GetAttributeAsBool("UseVmId"); connectionInfo.UseVmId = xmlnode.GetAttributeAsBool("UseVmId");
connectionInfo.VmId = xmlnode.GetAttributeAsString("VmId"); connectionInfo.VmId = xmlnode.GetAttributeAsString("VmId");
connectionInfo.UseEnhancedMode = xmlnode.GetAttributeAsBool("UseEnhancedMode");
connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard"); connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard");
connectionInfo.Inheritance.Favorite = xmlnode.GetAttributeAsBool("InheritFavorite"); connectionInfo.Inheritance.Favorite = xmlnode.GetAttributeAsBool("InheritFavorite");
connectionInfo.RdpVersion = xmlnode.GetAttributeAsEnum("RdpVersion", RdpVersion.Highest); connectionInfo.RdpVersion = xmlnode.GetAttributeAsEnum("RdpVersion", RdpVersion.Highest);
connectionInfo.Inheritance.RdpVersion = xmlnode.GetAttributeAsBool("InheritRdpVersion"); connectionInfo.Inheritance.RdpVersion = xmlnode.GetAttributeAsBool("InheritRdpVersion");
connectionInfo.Inheritance.UseVmId = xmlnode.GetAttributeAsBool("InheritUseVmId"); connectionInfo.Inheritance.UseVmId = xmlnode.GetAttributeAsBool("InheritUseVmId");
connectionInfo.Inheritance.VmId = xmlnode.GetAttributeAsBool("InheritVmId"); connectionInfo.Inheritance.VmId = xmlnode.GetAttributeAsBool("InheritVmId");
connectionInfo.Inheritance.UseEnhancedMode = xmlnode.GetAttributeAsBool("InheritUseEnhancedMode");
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Xml; using System.Xml;
using System.Xml.Linq;
namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
{ {
@@ -45,45 +44,5 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
? valueAsEnum ? valueAsEnum
: defaultValue; : defaultValue;
} }
public static string GetChildElementAsString(this XElement xmlNode, string elementName, string defaultValue = "")
{
var value = xmlNode?.Element(elementName)?.Value;
return value ?? defaultValue;
}
public static bool GetChildElementAsBool(this XElement xmlNode, string elementName, bool defaultValue = false)
{
var value = xmlNode?.GetChildElementAsString(elementName);
if (string.IsNullOrWhiteSpace(value))
return defaultValue;
return bool.TryParse(value, out var valueAsBool)
? valueAsBool
: defaultValue;
}
public static int GetChildElementAsInt(this XElement xmlNode, string elementName, int defaultValue = 0)
{
var value = xmlNode?.GetChildElementAsString(elementName);
if (string.IsNullOrWhiteSpace(value))
return defaultValue;
return int.TryParse(value, out var valueAsBool)
? valueAsBool
: defaultValue;
}
public static T GetChildElementAsEnum<T>(this XElement xmlNode, string elementName, T defaultValue = default(T))
where T : struct
{
var value = xmlNode?.GetChildElementAsString(elementName);
if (string.IsNullOrWhiteSpace(value))
return defaultValue;
return Enum.TryParse<T>(value, true, out var valueAsEnum)
? valueAsEnum
: defaultValue;
}
} }
} }

View File

@@ -80,8 +80,7 @@ namespace mRemoteNG.Config.Serializers
} }
catch (Exception ex) catch (Exception ex)
{ {
Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", ex);
ex);
} }
} }
@@ -98,8 +97,6 @@ namespace mRemoteNG.Config.Serializers
Description = description, Description = description,
Protocol = ProtocolType.RDP Protocol = ProtocolType.RDP
}; };
newConnectionInfo.Inheritance.TurnOnInheritanceCompletely();
newConnectionInfo.Inheritance.Description = false;
parentContainer.AddChild(newConnectionInfo); parentContainer.AddChild(newConnectionInfo);
} }

View File

@@ -1,366 +0,0 @@
using System;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using mRemoteNG.Config.Serializers.ConnectionSerializers.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Config.Serializers.MiscSerializers
{
public class RemoteDesktopManagerDeserializer : IDeserializer<string, ConnectionTreeModel>
{
public ConnectionTreeModel Deserialize(string serializedData)
{
var connectionTreeModel = new ConnectionTreeModel();
var root = new RootNodeInfo(RootNodeType.Connection);
connectionTreeModel.AddRootNode(root);
var xdoc = XDocument.Parse(serializedData);
var descendants = xdoc.Root.Descendants("Connection");
foreach (var descendant in descendants)
{
var connection = CreateConnectionFromXml(descendant);
root.AddChild(connection);
}
return connectionTreeModel;
}
private ConnectionInfo CreateConnectionFromXml(XElement xml)
{
var protocol = ParseProtocol(xml);
var protocolSpecificNode = GetProtocolSpecificNode(xml, protocol);
var metaInfoNode = xml.Element("MetaInformation");
var connectionId = xml.GetChildElementAsString("ID", Guid.NewGuid().ToString());
var connection = new ConnectionInfo(connectionId)
{
Name = xml.GetChildElementAsString("Name"),
Protocol = protocol,
Description = xml.GetChildElementAsString("Description"),
Username = protocolSpecificNode.GetChildElementAsString("UserName",
protocolSpecificNode.GetChildElementAsString("Username",
protocolSpecificNode.GetChildElementAsString("MsUser"))),
Domain = protocolSpecificNode.GetChildElementAsString("Domain",
protocolSpecificNode.GetChildElementAsString("MsDomain")),
Password = protocolSpecificNode.GetChildElementAsString("SafePassword"),
Resolution = ParseResolution(xml),
AutomaticResize = protocolSpecificNode.GetChildElementAsString("ScreenSizingMode") == "AutoScale",
RedirectSound = ParseSoundRedirection(xml),
Colors = ParseScreenColors(xml),
CacheBitmaps = !xml.GetChildElementAsBool("DisableBitmapCache"),
DisplayThemes = !xml.GetChildElementAsBool("DisableThemes"),
DisplayWallpaper = !xml.GetChildElementAsBool("DisableWallpaper"),
EnableDesktopComposition = xml.GetChildElementAsBool("DesktopComposition"),
EnableFontSmoothing = xml.GetChildElementAsBool("FontSmoothing"),
RedirectAudioCapture = protocolSpecificNode.GetChildElementAsBool("AudioCaptureRedirectionMode"),
RedirectClipboard = xml.GetChildElementAsBool("UsesClipboard", DefaultConnectionInfo.Instance.RedirectClipboard),
RedirectDiskDrives = xml.GetChildElementAsBool("UsesHardDrives", DefaultConnectionInfo.Instance.RedirectDiskDrives),
RedirectPrinters = xml.GetChildElementAsBool("UsesPrinters", DefaultConnectionInfo.Instance.RedirectPrinters),
RedirectPorts = xml.GetChildElementAsBool("UsesSerialPorts", DefaultConnectionInfo.Instance.RedirectPorts),
RedirectSmartCards = xml.GetChildElementAsBool("UsesSmartDevices", DefaultConnectionInfo.Instance.RedirectSmartCards),
RDPMinutesToIdleTimeout = xml.GetChildElementAsInt("AutomaticallyCloseInterval"),
MacAddress = metaInfoNode.GetChildElementAsString("MAC"),
RdpVersion = ParseRdpVersion(protocolSpecificNode),
RedirectKeys = xml.GetChildElementAsString("KeyboardHook") == "OnTheRemoteComputer",
UseConsoleSession = xml.GetChildElementAsBool("Console"),
RDPAuthenticationLevel = ParseAuthenticationLevel(xml),
UseCredSsp = protocolSpecificNode.GetChildElementAsBool("EnableCredSSPSupport"),
RDGatewayUsageMethod = ParseRdpGatewayUsageMethod(protocolSpecificNode),
RDGatewayHostname = protocolSpecificNode.GetChildElementAsString("GatewayHostname"),
UseEnhancedMode = protocolSpecificNode.GetChildElementAsBool("UseEnhancedSessionMode"),
UseVmId = protocolSpecificNode.GetChildElementAsString("RDPType") == "HyperV",
VmId = protocolSpecificNode.GetChildElementAsString("HyperVInstanceID"),
VNCEncoding = ParseVncEncoding(protocolSpecificNode),
VNCCompression = ParseVncCompressionLevel(protocolSpecificNode),
VNCAuthMode = DetermineVncAuthMode(protocolSpecificNode),
VNCViewOnly = protocolSpecificNode.GetChildElementAsBool("ViewOnly"),
RenderingEngine = ParseWebRenderingEngine(xml),
};
SetHostnameAndPort(connection, xml, protocolSpecificNode);
SetRdpGatewayCredentials(connection, protocolSpecificNode);
SetVncProxyHostAndPort(connection, protocolSpecificNode);
return connection;
}
private ProtocolType ParseProtocol(XElement xml)
{
switch (xml.GetChildElementAsString("ConnectionType"))
{
case "RDPConfigured":
return ProtocolType.RDP;
case "SSHShell":
return ProtocolType.SSH2;
case "VNC":
return ProtocolType.VNC;
case "Telnet":
return ProtocolType.Telnet;
case "WebBrowser":
return xml.GetChildElementAsString("WebBrowserUrl").StartsWith("http://")
? ProtocolType.HTTP
: ProtocolType.HTTPS;
default:
throw new Exception();
}
}
private XElement GetProtocolSpecificNode(XElement xml, ProtocolType protocol)
{
switch (protocol)
{
case ProtocolType.RDP:
return xml.Element("RDP");
case ProtocolType.SSH1:
case ProtocolType.SSH2:
case ProtocolType.Telnet:
return xml.Element("Terminal");
case ProtocolType.VNC:
return xml.Element("VNC");
case ProtocolType.HTTP:
case ProtocolType.HTTPS:
return xml.Element("Web");
default:
throw new Exception();
}
}
private void SetHostnameAndPort(ConnectionInfo connection, XElement xml, XElement protocolSpecificNode)
{
var urlElement = xml.Element("Url") ?? xml.Element("WebBrowserUrl");
if (urlElement != null)
{
var urlRegex = new Regex(@"((?<protocol>https?)://)?(?<host>[\w\.]+):?(?<port>\d*)");
var urlMatch = urlRegex.Match(urlElement.Value);
connection.Hostname = urlMatch.Groups["host"]?.Value ?? string.Empty;
if (int.TryParse(urlMatch.Groups["port"]?.Value, out var port))
{
connection.Port = port;
}
}
else
{
connection.Hostname = protocolSpecificNode.GetChildElementAsString("Host");
if (protocolSpecificNode.Element("HostPort") != null)
{
connection.Port = protocolSpecificNode.GetChildElementAsInt("HostPort");
}
if (protocolSpecificNode.Element("Port") != null)
{
connection.Port = protocolSpecificNode.GetChildElementAsInt("Port");
}
}
}
private RDPResolutions ParseResolution(XElement xml)
{
var resolution = xml.GetChildElementAsString("ScreenSize");
// attempt to convert "R800x600" style descriptors
// to our "Res800x600" style enum
if (resolution.StartsWith("R"))
{
var fixedResolution = resolution.Replace("R", "Res");
if (Enum.TryParse<RDPResolutions>(fixedResolution, out var convertedRes))
{
return convertedRes;
}
}
switch (resolution)
{
case "FullScreen":
return RDPResolutions.Fullscreen;
case "CurrentWorkAreaSize":
case "CurrentScreenSize":
return RDPResolutions.FitToWindow;
}
switch (xml.GetChildElementAsString("ScreenSizingMode"))
{
// This is confusing, but what they show as "Smart sizing" in the UI
// gets serialized to FitToWindow in the xml.
case "FitToWindow":
return RDPResolutions.SmartSize;
}
return DefaultConnectionInfo.Instance.Resolution;
}
private RDPSounds ParseSoundRedirection(XElement xml)
{
switch (xml.GetChildElementAsString("SoundHook"))
{
case "LeaveAtRemoteComputer":
return RDPSounds.LeaveAtRemoteComputer;
case "DoNotPlay":
return RDPSounds.DoNotPlay;
default: // there is no xml element when set to BringToThisComputer
return RDPSounds.BringToThisComputer;
}
}
private RDPColors ParseScreenColors(XElement xml)
{
switch (xml.GetChildElementAsString("ScreenColor"))
{
case "C15Bits":
return RDPColors.Colors15Bit;
case "C16Bits":
return RDPColors.Colors16Bit;
case "C24Bits":
return RDPColors.Colors24Bit;
case "C32Bits":
return RDPColors.Colors32Bit;
case "C256":
return RDPColors.Colors256;
default:
return DefaultConnectionInfo.Instance.Colors;
}
}
private RdpVersion ParseRdpVersion(XElement xml)
{
switch (xml.GetChildElementAsString("Version"))
{
case "RDP50":
case "RDP60":
case "RDP61":
return RdpVersion.Rdc6;
case "RDP70":
return RdpVersion.Rdc7;
case "RDP80":
case "RDP81":
return RdpVersion.Rdc8;
default: // no xml node = use latest
return RdpVersion.Highest;
}
}
private AuthenticationLevel ParseAuthenticationLevel(XElement xml)
{
switch (xml.GetChildElementAsString("AuthentificationLevel"))
{
case "WarnMe":
return AuthenticationLevel.WarnOnFailedAuth;
case "DontConnect":
return AuthenticationLevel.AuthRequired;
default: // "Connect and don't warn me"
return AuthenticationLevel.NoAuth;
}
}
private RDGatewayUsageMethod ParseRdpGatewayUsageMethod(XElement xml)
{
switch (xml.GetChildElementAsString("GatewayUsageMethod"))
{
case "ModeDirect":
return RDGatewayUsageMethod.Always;
case "NoneDetect":
return RDGatewayUsageMethod.Never;
default: // no xml node = detect
return RDGatewayUsageMethod.Detect;
}
}
private void SetRdpGatewayCredentials(ConnectionInfo connection, XElement xml)
{
if (xml.GetChildElementAsString("GatewayCredentialsSource") == "Smartcard")
{
connection.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.SmartCard;
}
else
{
connection.RDGatewayUseConnectionCredentials =
xml.GetChildElementAsBool("PromptCredentialOnce")
? RDGatewayUseConnectionCredentials.Yes
: RDGatewayUseConnectionCredentials.No;
}
connection.RDGatewayUsername = xml.GetChildElementAsString("GatewayUserName");
connection.RDGatewayDomain = xml.GetChildElementAsString("GatewayDomain");
connection.RDGatewayPassword = xml.GetChildElementAsString("GatewaySafePassword");
}
private ProtocolVNC.Encoding ParseVncEncoding(XElement xml)
{
switch (xml.GetChildElementAsString("PreferredEncoding"))
{
case "CoRRE":
return ProtocolVNC.Encoding.EncCorre;
case "Hextile":
return ProtocolVNC.Encoding.EncHextile;
case "Raw":
return ProtocolVNC.Encoding.EncRaw;
case "RRE":
return ProtocolVNC.Encoding.EncRRE;
case "Tight":
return ProtocolVNC.Encoding.EncTight;
case "Zlib":
return ProtocolVNC.Encoding.EncZlib;
case "ZlibHEX":
return ProtocolVNC.Encoding.EncZLibHex;
case "ZRLE":
return ProtocolVNC.Encoding.EncZRLE;
default:
return DefaultConnectionInfo.Instance.VNCEncoding;
}
}
private ProtocolVNC.Compression ParseVncCompressionLevel(XElement xml)
{
var compressionXml = xml.GetChildElementAsString("CustomCompressionLevel");
return Enum.TryParse<ProtocolVNC.Compression>("Comp" + compressionXml, out var compression)
? compression
: DefaultConnectionInfo.Instance.VNCCompression;
}
private ProtocolVNC.AuthMode DetermineVncAuthMode(XElement xml)
{
return xml.Element("MsUser") != null
? ProtocolVNC.AuthMode.AuthWin
: ProtocolVNC.AuthMode.AuthVNC;
}
private void SetVncProxyHostAndPort(ConnectionInfo connection, XElement xml)
{
var proxy = xml.GetChildElementAsString("ProxyHost").Split(':');
if (proxy.Length >= 1)
{
connection.VNCProxyIP = proxy[0];
}
if (proxy.Length >= 2 && int.TryParse(proxy[1], out var port))
{
connection.VNCProxyPort = port;
}
}
private HTTPBase.RenderingEngine ParseWebRenderingEngine(XElement xml)
{
if (xml.GetChildElementAsString("ConnectionType") != "WebBrowser")
return DefaultConnectionInfo.Instance.RenderingEngine;
switch (xml.GetChildElementAsString("ConnectionSubType"))
{
case "IE":
return HTTPBase.RenderingEngine.IE;
case "FireFox":
return HTTPBase.RenderingEngine.Gecko;
default:
return DefaultConnectionInfo.Instance.RenderingEngine;
}
}
}
}

View File

@@ -37,7 +37,6 @@ namespace mRemoteNG.Config.Serializers.Versioning
new SqlVersion24To25Upgrader(_databaseConnector), new SqlVersion24To25Upgrader(_databaseConnector),
new SqlVersion25To26Upgrader(_databaseConnector), new SqlVersion25To26Upgrader(_databaseConnector),
new SqlVersion26To27Upgrader(_databaseConnector), new SqlVersion26To27Upgrader(_databaseConnector),
new SqlVersion27To28Upgrader(_databaseConnector),
}; };
foreach (var upgrader in dbUpgraders) foreach (var upgrader in dbUpgraders)
@@ -49,7 +48,7 @@ namespace mRemoteNG.Config.Serializers.Versioning
} }
// DB is at the highest current supported version // DB is at the highest current supported version
if (databaseVersion.CompareTo(new Version(2, 8)) == 0) if (databaseVersion.CompareTo(new Version(2, 7)) == 0)
isVerified = true; isVerified = true;
if (isVerified == false) if (isVerified == false)

View File

@@ -29,10 +29,8 @@ ADD RedirectClipboard bit NOT NULL DEFAULT 0,
InheritRedirectClipboard bit NOT NULL DEFAULT 0, InheritRedirectClipboard bit NOT NULL DEFAULT 0,
VmId varchar NOT NULL DEFAULT 0, VmId varchar NOT NULL DEFAULT 0,
UseVmId bit NOT NULL DEFAULT 0, UseVmId bit NOT NULL DEFAULT 0,
UseEnhancedMode bit NOT NULL DEFAULT 0,
InheritVmId bit NOT NULL DEFAULT 0, InheritVmId bit NOT NULL DEFAULT 0,
InheritUseVmId bit NOT NULL DEFAULT 0, InheritUseVmId bit NOT NULL DEFAULT 0;
InheritUseEnhancedMode bit NOT NULL DEFAULT 0;
UPDATE tblRoot UPDATE tblRoot
SET ConfVersion='2.7'"; SET ConfVersion='2.7'";
var dbCommand = _databaseConnector.DbCommand(sqlText); var dbCommand = _databaseConnector.DbCommand(sqlText);

View File

@@ -1,64 +0,0 @@
using mRemoteNG.App;
using mRemoteNG.Config.DatabaseConnectors;
using mRemoteNG.Messages;
using System;
using System.Data.Common;
namespace mRemoteNG.Config.Serializers.Versioning
{
public class SqlVersion27To28Upgrader : IVersionUpgrader
{
private readonly IDatabaseConnector _databaseConnector;
public SqlVersion27To28Upgrader(IDatabaseConnector databaseConnector)
{
_databaseConnector = databaseConnector ?? throw new ArgumentNullException(nameof(databaseConnector));
}
public bool CanUpgrade(Version currentVersion)
{
return currentVersion.CompareTo(new Version(2, 7)) == 0;
}
public Version Upgrade()
{
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
"Upgrading database from version 2.7 to version 2.8.");
const string mySqlText = @"
ALTER TABLE tblCons MODIFY COLUMN ID INT;
ALTER TABLE tblCons DROP PRIMARY KEY, ADD PRIMARY KEY (ConstantID);
ALTER TABLE tblCons ADD INDEX `id` (ID), MODIFY ID int auto_increment;
ALTER TABLE tblCons MODIFY COLUMN ID INT AUTO_INCREMENT, ADD UNIQUE(ID);
UPDATE tblRoot SET ConfVersion='2.8'";
const string msSqlText1 = @"
ALTER TABLE tblCons ADD DEFAULT 0 FOR UseEnhancedMode;
ALTER TABLE tblCons ADD DEFAULT 0 FOR InheritUseEnhancedMode;
UPDATE tblCons SET UseEnhancedMode = 0 WHERE UseEnhancedMode IS NULL;
UPDATE tblCons SET InheritUseEnhancedMode = 0 WHERE InheritUseEnhancedMode IS NULL;
ALTER TABLE tblCons ALTER COLUMN ConstantID varchar(128) NOT NULL;";
const string msSqlText2 = @"
ALTER TABLE tblCons ADD CONSTRAINT PK_tblCons PRIMARY KEY (ConstantID);
UPDATE tblRoot SET ConfVersion='2.8';";
DbCommand dbCommand;
if (_databaseConnector.GetType() == typeof(MSSqlDatabaseConnector))
{
dbCommand = _databaseConnector.DbCommand(msSqlText1);
dbCommand.ExecuteNonQuery();
dbCommand = _databaseConnector.DbCommand(msSqlText2);
} else if (_databaseConnector.GetType() == typeof(MySqlDatabaseConnector))
{
dbCommand = _databaseConnector.DbCommand(mySqlText);
} else
{
throw new Exception("Unknow database backend");
}
dbCommand.ExecuteNonQuery();
return new Version(2, 8);
}
}
}

View File

@@ -4,6 +4,7 @@ using mRemoteNG.App.Info;
using mRemoteNG.UI.Forms; using mRemoteNG.UI.Forms;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Messages; using mRemoteNG.Messages;
using mRemoteNG.Tools; using mRemoteNG.Tools;
using mRemoteNG.UI.Controls; using mRemoteNG.UI.Controls;
@@ -13,12 +14,14 @@ namespace mRemoteNG.Config.Settings
public class ExternalAppsLoader public class ExternalAppsLoader
{ {
private readonly FrmMain _mainForm; private readonly FrmMain _mainForm;
private readonly IConnectionInitiator _connectionInitiator;
private readonly MessageCollector _messageCollector; private readonly MessageCollector _messageCollector;
private readonly ExternalToolsToolStrip _externalToolsToolStrip; private readonly ExternalToolsToolStrip _externalToolsToolStrip;
public ExternalAppsLoader(FrmMain mainForm, public ExternalAppsLoader(FrmMain mainForm,
MessageCollector messageCollector, MessageCollector messageCollector,
ExternalToolsToolStrip externalToolsToolStrip) ExternalToolsToolStrip externalToolsToolStrip,
IConnectionInitiator connectionInitiator)
{ {
if (mainForm == null) if (mainForm == null)
throw new ArgumentNullException(nameof(mainForm)); throw new ArgumentNullException(nameof(mainForm));
@@ -30,6 +33,7 @@ namespace mRemoteNG.Config.Settings
_mainForm = mainForm; _mainForm = mainForm;
_messageCollector = messageCollector; _messageCollector = messageCollector;
_externalToolsToolStrip = externalToolsToolStrip; _externalToolsToolStrip = externalToolsToolStrip;
_connectionInitiator = connectionInitiator;
} }
@@ -71,7 +75,7 @@ namespace mRemoteNG.Config.Settings
foreach (XmlElement xEl in xDom.DocumentElement.ChildNodes) foreach (XmlElement xEl in xDom.DocumentElement.ChildNodes)
{ {
var extA = new ExternalTool var extA = new ExternalTool(_connectionInitiator)
{ {
DisplayName = xEl.Attributes["DisplayName"].Value, DisplayName = xEl.Attributes["DisplayName"].Value,
FileName = xEl.Attributes["FileName"].Value, FileName = xEl.Attributes["FileName"].Value,

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
@@ -7,6 +7,7 @@ using System.Threading;
using System.Globalization; using System.Globalization;
using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection.Protocol;
using mRemoteNG.App.Info; using mRemoteNG.App.Info;
using mRemoteNG.Connection;
using mRemoteNG.Messages; using mRemoteNG.Messages;
using mRemoteNG.Tools; using mRemoteNG.Tools;
using mRemoteNG.UI.Controls; using mRemoteNG.UI.Controls;
@@ -23,16 +24,19 @@ namespace mRemoteNG.Config.Settings
private readonly QuickConnectToolStrip _quickConnectToolStrip; private readonly QuickConnectToolStrip _quickConnectToolStrip;
private readonly ExternalToolsToolStrip _externalToolsToolStrip; private readonly ExternalToolsToolStrip _externalToolsToolStrip;
private readonly MultiSshToolStrip _multiSshToolStrip; private readonly MultiSshToolStrip _multiSshToolStrip;
private readonly IConnectionInitiator _connectionInitiator;
private FrmMain MainForm { get; } private FrmMain MainForm { get; }
public SettingsLoader(FrmMain mainForm, public SettingsLoader(
MessageCollector messageCollector, FrmMain mainForm,
QuickConnectToolStrip quickConnectToolStrip, IConnectionInitiator connectionInitiator,
ExternalToolsToolStrip externalToolsToolStrip, MessageCollector messageCollector,
MultiSshToolStrip multiSshToolStrip, QuickConnectToolStrip quickConnectToolStrip,
MenuStrip mainMenu) ExternalToolsToolStrip externalToolsToolStrip,
MultiSshToolStrip multiSshToolStrip,
MenuStrip mainMenu)
{ {
if (mainForm == null) if (mainForm == null)
throw new ArgumentNullException(nameof(mainForm)); throw new ArgumentNullException(nameof(mainForm));
@@ -53,7 +57,8 @@ namespace mRemoteNG.Config.Settings
_externalToolsToolStrip = externalToolsToolStrip; _externalToolsToolStrip = externalToolsToolStrip;
_multiSshToolStrip = multiSshToolStrip; _multiSshToolStrip = multiSshToolStrip;
_mainMenu = mainMenu; _mainMenu = mainMenu;
_externalAppsLoader = new ExternalAppsLoader(MainForm, messageCollector, _externalToolsToolStrip); _connectionInitiator = connectionInitiator;
_externalAppsLoader = new ExternalAppsLoader(MainForm, messageCollector, _externalToolsToolStrip, _connectionInitiator);
} }
#region Public Methods #region Public Methods
@@ -156,10 +161,10 @@ namespace mRemoteNG.Config.Settings
MainForm.Fullscreen.Value = true; MainForm.Fullscreen.Value = true;
} }
private static void SetShowSystemTrayIcon() private void SetShowSystemTrayIcon()
{ {
if (mRemoteNG.Settings.Default.ShowSystemTrayIcon) if (mRemoteNG.Settings.Default.ShowSystemTrayIcon)
Runtime.NotificationAreaIcon = new NotificationAreaIcon(); Runtime.NotificationAreaIcon = new NotificationAreaIcon(_connectionInitiator);
} }
private static void SetPuttyPath() private static void SetPuttyPath()

View File

@@ -25,7 +25,6 @@ namespace mRemoteNG.Connection
private string _password = ""; private string _password = "";
private string _domain = ""; private string _domain = "";
private string _vmId = ""; private string _vmId = "";
private bool _useEnhancedMode;
private ProtocolType _protocol; private ProtocolType _protocol;
private RdpVersion _rdpProtocolVersion; private RdpVersion _rdpProtocolVersion;
@@ -92,37 +91,37 @@ namespace mRemoteNG.Connection
#region Display #region Display
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay)), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameName)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameName"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionName))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionName")]
public virtual string Name public virtual string Name
{ {
get => _name; get => _name;
set => SetField(ref _name, value, "Name"); set => SetField(ref _name, value, "Name");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay)), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameDescription)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameDescription"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionDescription))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDescription")]
public virtual string Description public virtual string Description
{ {
get => GetPropertyValue("Description", _description); get => GetPropertyValue("Description", _description);
set => SetField(ref _description, value, "Description"); set => SetField(ref _description, value, "Description");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay)), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
TypeConverter(typeof(ConnectionIcon)), TypeConverter(typeof(ConnectionIcon)),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameIcon)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameIcon"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionIcon))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionIcon")]
public virtual string Icon public virtual string Icon
{ {
get => GetPropertyValue("Icon", _icon); get => GetPropertyValue("Icon", _icon);
set => SetField(ref _icon, value, "Icon"); set => SetField(ref _icon, value, "Icon");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay)), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay"),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNamePanel)), LocalizedAttributes.LocalizedDisplayName("strPropertyNamePanel"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionPanel))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPanel")]
public virtual string Panel public virtual string Panel
{ {
get => GetPropertyValue("Panel", _panel); get => GetPropertyValue("Panel", _panel);
@@ -133,9 +132,9 @@ namespace mRemoteNG.Connection
#region Connection #region Connection
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameAddress)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameAddress"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionAddress)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAddress"),
UsedInAllProtocolsExcept()] UsedInAllProtocolsExcept()]
public virtual string Hostname public virtual string Hostname
{ {
@@ -143,9 +142,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _hostname, value?.Trim(), "Hostname"); set => SetField(ref _hostname, value?.Trim(), "Hostname");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNamePort)), LocalizedAttributes.LocalizedDisplayName("strPropertyNamePort"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionPort)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPort"),
UsedInAllProtocolsExcept(ProtocolType.ICA)] UsedInAllProtocolsExcept(ProtocolType.ICA)]
public virtual int Port public virtual int Port
{ {
@@ -153,9 +152,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _port, value, "Port"); set => SetField(ref _port, value, "Port");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUsername)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUsername"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUsername)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUsername"),
UsedInAllProtocolsExcept(ProtocolType.VNC, ProtocolType.Telnet, ProtocolType.Rlogin, ProtocolType.RAW)] UsedInAllProtocolsExcept(ProtocolType.VNC, ProtocolType.Telnet, ProtocolType.Rlogin, ProtocolType.RAW)]
public virtual string Username public virtual string Username
{ {
@@ -163,9 +162,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _username, Settings.Default.DoNotTrimUsername ? value : value?.Trim(), "Username"); set => SetField(ref _username, Settings.Default.DoNotTrimUsername ? value : value?.Trim(), "Username");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNamePassword)), LocalizedAttributes.LocalizedDisplayName("strPropertyNamePassword"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionPassword)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPassword"),
PasswordPropertyText(true), PasswordPropertyText(true),
UsedInAllProtocolsExcept(ProtocolType.Telnet, ProtocolType.Rlogin, ProtocolType.RAW)] UsedInAllProtocolsExcept(ProtocolType.Telnet, ProtocolType.Rlogin, ProtocolType.RAW)]
public virtual string Password public virtual string Password
@@ -174,19 +173,19 @@ namespace mRemoteNG.Connection
set => SetField(ref _password, value, "Password"); set => SetField(ref _password, value, "Password");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameDomain)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameDomain"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionDomain)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDomain"),
UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA, ProtocolType.IntApp, ProtocolType.PowerShell)] UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA, ProtocolType.IntApp)]
public string Domain public string Domain
{ {
get => GetPropertyValue("Domain", _domain).Trim(); get => GetPropertyValue("Domain", _domain).Trim();
set => SetField(ref _domain, value?.Trim(), "Domain"); set => SetField(ref _domain, value?.Trim(), "Domain");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVmId)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVmId"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVmId)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVmId"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string VmId public string VmId
{ {
@@ -198,9 +197,9 @@ namespace mRemoteNG.Connection
#region Protocol #region Protocol
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameProtocol)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameProtocol"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionProtocol)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionProtocol"),
TypeConverter(typeof(MiscTools.EnumTypeConverter))] TypeConverter(typeof(MiscTools.EnumTypeConverter))]
public virtual ProtocolType Protocol public virtual ProtocolType Protocol
{ {
@@ -208,20 +207,20 @@ namespace mRemoteNG.Connection
set => SetField(ref _protocol, value, "Protocol"); set => SetField(ref _protocol, value, "Protocol");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRdpVersion)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpVersion"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRdpVersion)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpVersion"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public virtual RdpVersion RdpVersion public virtual RdpVersion RdpVersion
{ {
get => GetPropertyValue("RdpVersion", _rdpProtocolVersion); get => GetPropertyValue(nameof(RdpVersion), _rdpProtocolVersion);
set => SetField(ref _rdpProtocolVersion, value, nameof(RdpVersion)); set => SetField(ref _rdpProtocolVersion, value, nameof(RdpVersion));
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameExternalTool)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalTool"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionExternalTool)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalTool"),
TypeConverter(typeof(ExternalToolsTypeConverter)), TypeConverter(typeof(ExternalToolsTypeConverter)),
UsedInProtocol(ProtocolType.IntApp)] UsedInProtocol(ProtocolType.IntApp)]
public string ExtApp public string ExtApp
@@ -230,9 +229,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _extApp, value, "ExtApp"); set => SetField(ref _extApp, value, "ExtApp");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNamePuttySession)), LocalizedAttributes.LocalizedDisplayName("strPropertyNamePuttySession"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionPuttySession)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionPuttySession"),
TypeConverter(typeof(Config.Putty.PuttySessionsManager.SessionList)), TypeConverter(typeof(Config.Putty.PuttySessionsManager.SessionList)),
UsedInProtocol(ProtocolType.SSH1, ProtocolType.SSH2, ProtocolType.Telnet, UsedInProtocol(ProtocolType.SSH1, ProtocolType.SSH2, ProtocolType.Telnet,
ProtocolType.RAW, ProtocolType.Rlogin)] ProtocolType.RAW, ProtocolType.Rlogin)]
@@ -242,9 +241,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _puttySession, value, "PuttySession"); set => SetField(ref _puttySession, value, "PuttySession");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameEncryptionStrength)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncryptionStrength"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionEncryptionStrength)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncryptionStrength"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.ICA)] UsedInProtocol(ProtocolType.ICA)]
public IcaProtocol.EncryptionStrength ICAEncryptionStrength public IcaProtocol.EncryptionStrength ICAEncryptionStrength
@@ -253,9 +252,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _icaEncryption, value, "ICAEncryptionStrength"); set => SetField(ref _icaEncryption, value, "ICAEncryptionStrength");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUseConsoleSession)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseConsoleSession"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUseConsoleSession)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseConsoleSession"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool UseConsoleSession public bool UseConsoleSession
@@ -264,9 +263,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _useConsoleSession, value, "UseConsoleSession"); set => SetField(ref _useConsoleSession, value, "UseConsoleSession");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameAuthenticationLevel)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationLevel"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionAuthenticationLevel)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationLevel"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public AuthenticationLevel RDPAuthenticationLevel public AuthenticationLevel RDPAuthenticationLevel
@@ -275,9 +274,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdpAuthenticationLevel, value, "RDPAuthenticationLevel"); set => SetField(ref _rdpAuthenticationLevel, value, "RDPAuthenticationLevel");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDPMinutesToIdleTimeout)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPMinutesToIdleTimeout"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDPMinutesToIdleTimeout)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPMinutesToIdleTimeout"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public virtual int RDPMinutesToIdleTimeout public virtual int RDPMinutesToIdleTimeout
{ {
@@ -292,9 +291,9 @@ namespace mRemoteNG.Connection
} }
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDPAlertIdleTimeout)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPAlertIdleTimeout"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDPAlertIdleTimeout)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDPAlertIdleTimeout"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RDPAlertIdleTimeout public bool RDPAlertIdleTimeout
{ {
@@ -302,9 +301,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdpAlertIdleTimeout, value, "RDPAlertIdleTimeout"); set => SetField(ref _rdpAlertIdleTimeout, value, "RDPAlertIdleTimeout");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameLoadBalanceInfo)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameLoadBalanceInfo"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionLoadBalanceInfo)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionLoadBalanceInfo"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string LoadBalanceInfo public string LoadBalanceInfo
{ {
@@ -312,9 +311,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _loadBalanceInfo, value?.Trim(), "LoadBalanceInfo"); set => SetField(ref _loadBalanceInfo, value?.Trim(), "LoadBalanceInfo");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRenderingEngine)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRenderingEngine"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRenderingEngine)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRenderingEngine"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.HTTP, ProtocolType.HTTPS)] UsedInProtocol(ProtocolType.HTTP, ProtocolType.HTTPS)]
public HTTPBase.RenderingEngine RenderingEngine public HTTPBase.RenderingEngine RenderingEngine
@@ -323,9 +322,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _renderingEngine, value, "RenderingEngine"); set => SetField(ref _renderingEngine, value, "RenderingEngine");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUseCredSsp)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseCredSsp"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUseCredSsp)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseCredSsp"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool UseCredSsp public bool UseCredSsp
@@ -334,9 +333,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _useCredSsp, value, "UseCredSsp"); set => SetField(ref _useCredSsp, value, "UseCredSsp");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUseVmId)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseVmId"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUseVmId)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseVmId"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool UseVmId public bool UseVmId
@@ -345,23 +344,13 @@ namespace mRemoteNG.Connection
set => SetField(ref _useVmId, value, "UseVmId"); set => SetField(ref _useVmId, value, "UseVmId");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 3),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUseEnhancedMode)),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUseEnhancedMode)),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)]
public bool UseEnhancedMode
{
get => GetPropertyValue("UseEnhancedMode", _useEnhancedMode);
set => SetField(ref _useEnhancedMode, value, "UseEnhancedMode");
}
#endregion #endregion
#region RD Gateway #region RD Gateway
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayUsageMethod)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsageMethod"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDGatewayUsageMethod)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsageMethod"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public RDGatewayUsageMethod RDGatewayUsageMethod public RDGatewayUsageMethod RDGatewayUsageMethod
@@ -370,9 +359,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdGatewayUsageMethod, value, "RDGatewayUsageMethod"); set => SetField(ref _rdGatewayUsageMethod, value, "RDGatewayUsageMethod");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayHostname)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayHostname"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDGatewayHostname)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayHostname"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string RDGatewayHostname public string RDGatewayHostname
{ {
@@ -380,9 +369,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdGatewayHostname, value?.Trim(), "RDGatewayHostname"); set => SetField(ref _rdGatewayHostname, value?.Trim(), "RDGatewayHostname");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayUseConnectionCredentials)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUseConnectionCredentials"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDGatewayUseConnectionCredentials)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUseConnectionCredentials"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public RDGatewayUseConnectionCredentials RDGatewayUseConnectionCredentials public RDGatewayUseConnectionCredentials RDGatewayUseConnectionCredentials
@@ -391,9 +380,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdGatewayUseConnectionCredentials, value, "RDGatewayUseConnectionCredentials"); set => SetField(ref _rdGatewayUseConnectionCredentials, value, "RDGatewayUseConnectionCredentials");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayUsername)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayUsername"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDGatewayUsername)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayUsername"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string RDGatewayUsername public string RDGatewayUsername
{ {
@@ -401,9 +390,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdGatewayUsername, value?.Trim(), "RDGatewayUsername"); set => SetField(ref _rdGatewayUsername, value?.Trim(), "RDGatewayUsername");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayPassword)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayPassword"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyNameRDGatewayPassword)), LocalizedAttributes.LocalizedDescription("strPropertyNameRDGatewayPassword"),
PasswordPropertyText(true), PasswordPropertyText(true),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string RDGatewayPassword public string RDGatewayPassword
@@ -412,9 +401,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _rdGatewayPassword, value, "RDGatewayPassword"); set => SetField(ref _rdGatewayPassword, value, "RDGatewayPassword");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 4), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 4),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRDGatewayDomain)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDGatewayDomain"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRDGatewayDomain)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRDGatewayDomain"),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public string RDGatewayDomain public string RDGatewayDomain
{ {
@@ -426,9 +415,9 @@ namespace mRemoteNG.Connection
#region Appearance #region Appearance
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameResolution)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameResolution"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionResolution)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionResolution"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)] UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)]
public RDPResolutions Resolution public RDPResolutions Resolution
@@ -437,9 +426,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _resolution, value, "Resolution"); set => SetField(ref _resolution, value, "Resolution");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameAutomaticResize)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameAutomaticResize"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionAutomaticResize)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAutomaticResize"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool AutomaticResize public bool AutomaticResize
@@ -448,9 +437,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _automaticResize, value, "AutomaticResize"); set => SetField(ref _automaticResize, value, "AutomaticResize");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameColors)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionColors)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)] UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)]
public RDPColors Colors public RDPColors Colors
@@ -459,9 +448,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _colors, value, "Colors"); set => SetField(ref _colors, value, "Colors");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameCacheBitmaps)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameCacheBitmaps"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionCacheBitmaps)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCacheBitmaps"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)] UsedInProtocol(ProtocolType.RDP, ProtocolType.ICA)]
public bool CacheBitmaps public bool CacheBitmaps
@@ -470,9 +459,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _cacheBitmaps, value, "CacheBitmaps"); set => SetField(ref _cacheBitmaps, value, "CacheBitmaps");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameDisplayWallpaper)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayWallpaper"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionDisplayWallpaper)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayWallpaper"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool DisplayWallpaper public bool DisplayWallpaper
@@ -481,9 +470,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _displayWallpaper, value, "DisplayWallpaper"); set => SetField(ref _displayWallpaper, value, "DisplayWallpaper");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameDisplayThemes)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameDisplayThemes"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionDisplayThemes)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionDisplayThemes"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool DisplayThemes public bool DisplayThemes
@@ -492,9 +481,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _displayThemes, value, "DisplayThemes"); set => SetField(ref _displayThemes, value, "DisplayThemes");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameEnableFontSmoothing)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableFontSmoothing"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionEnableFontSmoothing)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableFontSmoothing"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool EnableFontSmoothing public bool EnableFontSmoothing
@@ -503,9 +492,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _enableFontSmoothing, value, "EnableFontSmoothing"); set => SetField(ref _enableFontSmoothing, value, "EnableFontSmoothing");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameEnableDesktopComposition)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameEnableDesktopComposition"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionEnableDesktopComposition)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEnableDesktopComposition"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool EnableDesktopComposition public bool EnableDesktopComposition
@@ -518,9 +507,9 @@ namespace mRemoteNG.Connection
#region Redirect #region Redirect
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectKeys)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectKeys"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectKeys)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectKeys"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectKeys public bool RedirectKeys
@@ -529,9 +518,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectKeys, value, "RedirectKeys"); set => SetField(ref _redirectKeys, value, "RedirectKeys");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectDrives)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectDrives"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectDrives)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectDrives"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectDiskDrives public bool RedirectDiskDrives
@@ -540,9 +529,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectDiskDrives, value, "RedirectDiskDrives"); set => SetField(ref _redirectDiskDrives, value, "RedirectDiskDrives");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectPrinters)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPrinters"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectPrinters)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPrinters"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectPrinters public bool RedirectPrinters
@@ -551,9 +540,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectPrinters, value, "RedirectPrinters"); set => SetField(ref _redirectPrinters, value, "RedirectPrinters");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectClipboard)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectClipboard"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectClipboard)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectClipboard"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectClipboard public bool RedirectClipboard
@@ -563,9 +552,9 @@ namespace mRemoteNG.Connection
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectPorts)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectPorts"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectPorts)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectPorts"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectPorts public bool RedirectPorts
@@ -574,9 +563,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectPorts, value, "RedirectPorts"); set => SetField(ref _redirectPorts, value, "RedirectPorts");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectSmartCards)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSmartCards"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectSmartCards)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSmartCards"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectSmartCards public bool RedirectSmartCards
@@ -585,9 +574,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectSmartCards, value, "RedirectSmartCards"); set => SetField(ref _redirectSmartCards, value, "RedirectSmartCards");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectSounds)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectSounds"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectSounds)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectSounds"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public RDPSounds RedirectSound public RDPSounds RedirectSound
@@ -596,9 +585,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _redirectSound, value, "RedirectSound"); set => SetField(ref _redirectSound, value, "RedirectSound");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameSoundQuality)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameSoundQuality"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionSoundQuality)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSoundQuality"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public RDPSoundQuality SoundQuality public RDPSoundQuality SoundQuality
@@ -607,14 +596,14 @@ namespace mRemoteNG.Connection
set => SetField(ref _soundQuality, value, "SoundQuality"); set => SetField(ref _soundQuality, value, "SoundQuality");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 6), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 6),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameRedirectAudioCapture)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRedirectAudioCapture"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionRedirectAudioCapture)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRedirectAudioCapture"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.RDP)] UsedInProtocol(ProtocolType.RDP)]
public bool RedirectAudioCapture public bool RedirectAudioCapture
{ {
get => GetPropertyValue("RedirectAudioCapture", _redirectAudioCapture); get => GetPropertyValue(nameof(RedirectAudioCapture), _redirectAudioCapture);
set => SetField(ref _redirectAudioCapture, value, nameof(RedirectAudioCapture)); set => SetField(ref _redirectAudioCapture, value, nameof(RedirectAudioCapture));
} }
@@ -624,9 +613,9 @@ namespace mRemoteNG.Connection
[Browsable(false)] public string ConstantID { get; } [Browsable(false)] public string ConstantID { get; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 7), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameExternalToolBefore)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolBefore"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionExternalToolBefore)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolBefore"),
TypeConverter(typeof(ExternalToolsTypeConverter))] TypeConverter(typeof(ExternalToolsTypeConverter))]
public virtual string PreExtApp public virtual string PreExtApp
{ {
@@ -634,9 +623,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _preExtApp, value, "PreExtApp"); set => SetField(ref _preExtApp, value, "PreExtApp");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 7), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameExternalToolAfter)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameExternalToolAfter"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionExternalToolAfter)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionExternalToolAfter"),
TypeConverter(typeof(ExternalToolsTypeConverter))] TypeConverter(typeof(ExternalToolsTypeConverter))]
public virtual string PostExtApp public virtual string PostExtApp
{ {
@@ -644,27 +633,27 @@ namespace mRemoteNG.Connection
set => SetField(ref _postExtApp, value, "PostExtApp"); set => SetField(ref _postExtApp, value, "PostExtApp");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 7), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameMACAddress)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameMACAddress"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionMACAddress))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionMACAddress")]
public virtual string MacAddress public virtual string MacAddress
{ {
get => GetPropertyValue("MacAddress", _macAddress); get => GetPropertyValue("MacAddress", _macAddress);
set => SetField(ref _macAddress, value, "MacAddress"); set => SetField(ref _macAddress, value, "MacAddress");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 7), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameUser1)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameUser1"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionUser1))] LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUser1")]
public virtual string UserField public virtual string UserField
{ {
get => GetPropertyValue("UserField", _userField); get => GetPropertyValue("UserField", _userField);
set => SetField(ref _userField, value, "UserField"); set => SetField(ref _userField, value, "UserField");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 7), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameFavorite)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameFavorite"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionFavorite)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionFavorite"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public virtual bool Favorite public virtual bool Favorite
{ {
@@ -676,9 +665,9 @@ namespace mRemoteNG.Connection
#region VNC #region VNC
// TODO: it seems all these VNC properties were added and serialized but // TODO: it seems all these VNC properties were added and serialized but
// never hooked up to the VNC protocol or shown to the user // never hooked up to the VNC protocol or shown to the user
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameCompression)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameCompression"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionCompression)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionCompression"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -688,9 +677,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncCompression, value, "VNCCompression"); set => SetField(ref _vncCompression, value, "VNCCompression");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameEncoding)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameEncoding"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionEncoding)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionEncoding"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -700,9 +689,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncEncoding, value, "VNCEncoding"); set => SetField(ref _vncEncoding, value, "VNCEncoding");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 2), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameAuthenticationMode)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameAuthenticationMode"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionAuthenticationMode)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionAuthenticationMode"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -712,9 +701,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncAuthMode, value, "VNCAuthMode"); set => SetField(ref _vncAuthMode, value, "VNCAuthMode");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 7), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVNCProxyType)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyType"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVNCProxyType)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyType"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -724,9 +713,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncProxyType, value, "VNCProxyType"); set => SetField(ref _vncProxyType, value, "VNCProxyType");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 7), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVNCProxyAddress)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyAddress"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVNCProxyAddress)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyAddress"),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
public string VNCProxyIP public string VNCProxyIP
@@ -735,9 +724,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncProxyIp, value, "VNCProxyIP"); set => SetField(ref _vncProxyIp, value, "VNCProxyIP");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 7), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVNCProxyPort)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPort"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVNCProxyPort)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPort"),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
public int VNCProxyPort public int VNCProxyPort
@@ -746,9 +735,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncProxyPort, value, "VNCProxyPort"); set => SetField(ref _vncProxyPort, value, "VNCProxyPort");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 7), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVNCProxyUsername)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyUsername"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVNCProxyUsername)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyUsername"),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
public string VNCProxyUsername public string VNCProxyUsername
@@ -757,9 +746,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncProxyUsername, value, "VNCProxyUsername"); set => SetField(ref _vncProxyUsername, value, "VNCProxyUsername");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 7), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 7),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameVNCProxyPassword)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameVNCProxyPassword"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionVNCProxyPassword)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionVNCProxyPassword"),
PasswordPropertyText(true), PasswordPropertyText(true),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -769,9 +758,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncProxyPassword, value, "VNCProxyPassword"); set => SetField(ref _vncProxyPassword, value, "VNCProxyPassword");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameColors)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameColors"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionColors)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionColors"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC), UsedInProtocol(ProtocolType.VNC),
Browsable(false)] Browsable(false)]
@@ -781,9 +770,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncColors, value, "VNCColors"); set => SetField(ref _vncColors, value, "VNCColors");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameSmartSizeMode)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameSmartSizeMode"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionSmartSizeMode)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionSmartSizeMode"),
TypeConverter(typeof(MiscTools.EnumTypeConverter)), TypeConverter(typeof(MiscTools.EnumTypeConverter)),
UsedInProtocol(ProtocolType.VNC)] UsedInProtocol(ProtocolType.VNC)]
public ProtocolVNC.SmartSizeMode VNCSmartSizeMode public ProtocolVNC.SmartSizeMode VNCSmartSizeMode
@@ -792,9 +781,9 @@ namespace mRemoteNG.Connection
set => SetField(ref _vncSmartSizeMode, value, "VNCSmartSizeMode"); set => SetField(ref _vncSmartSizeMode, value, "VNCSmartSizeMode");
} }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 5), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 5),
LocalizedAttributes.LocalizedDisplayName(nameof(Language.strPropertyNameViewOnly)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameViewOnly"),
LocalizedAttributes.LocalizedDescription(nameof(Language.strPropertyDescriptionViewOnly)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionViewOnly"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter)), TypeConverter(typeof(MiscTools.YesNoTypeConverter)),
UsedInProtocol(ProtocolType.VNC)] UsedInProtocol(ProtocolType.VNC)]
public bool VNCViewOnly public bool VNCViewOnly

View File

@@ -7,7 +7,6 @@ using mRemoteNG.App;
using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.Http; using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.ICA; using mRemoteNG.Connection.Protocol.ICA;
using mRemoteNG.Connection.Protocol.PowerShell;
using mRemoteNG.Connection.Protocol.RAW; using mRemoteNG.Connection.Protocol.RAW;
using mRemoteNG.Connection.Protocol.RDP; using mRemoteNG.Connection.Protocol.RDP;
using mRemoteNG.Connection.Protocol.Rlogin; using mRemoteNG.Connection.Protocol.Rlogin;
@@ -266,8 +265,6 @@ namespace mRemoteNG.Connection
return (int)ProtocolHTTPS.Defaults.Port; return (int)ProtocolHTTPS.Defaults.Port;
case ProtocolType.ICA: case ProtocolType.ICA:
return (int)IcaProtocol.Defaults.Port; return (int)IcaProtocol.Defaults.Port;
case ProtocolType.PowerShell:
return (int)ProtocolPowerShell.Defaults.Port;
case ProtocolType.IntApp: case ProtocolType.IntApp:
return (int)IntegratedProgram.Defaults.Port; return (int)IntegratedProgram.Defaults.Port;
} }
@@ -312,7 +309,6 @@ namespace mRemoteNG.Connection
Settings.Default.ConDefaultRenderingEngine); Settings.Default.ConDefaultRenderingEngine);
UseCredSsp = Settings.Default.ConDefaultUseCredSsp; UseCredSsp = Settings.Default.ConDefaultUseCredSsp;
UseVmId = Settings.Default.ConDefaultUseVmId; UseVmId = Settings.Default.ConDefaultUseVmId;
UseEnhancedMode = Settings.Default.ConDefaultUseEnhancedMode;
} }
private void SetRdGatewayDefaults() private void SetRdGatewayDefaults()
@@ -348,9 +344,11 @@ namespace mRemoteNG.Connection
RedirectClipboard = Settings.Default.ConDefaultRedirectClipboard; RedirectClipboard = Settings.Default.ConDefaultRedirectClipboard;
RedirectPorts = Settings.Default.ConDefaultRedirectPorts; RedirectPorts = Settings.Default.ConDefaultRedirectPorts;
RedirectSmartCards = Settings.Default.ConDefaultRedirectSmartCards; RedirectSmartCards = Settings.Default.ConDefaultRedirectSmartCards;
RedirectSound = (RDPSounds)Enum.Parse(typeof(RDPSounds),
Settings.Default.ConDefaultRedirectSound);
SoundQuality = (RDPSoundQuality)Enum.Parse(typeof(RDPSoundQuality),
Settings.Default.ConDefaultSoundQuality);
RedirectAudioCapture = Settings.Default.ConDefaultRedirectAudioCapture; RedirectAudioCapture = Settings.Default.ConDefaultRedirectAudioCapture;
RedirectSound = (RDPSounds)Enum.Parse(typeof(RDPSounds), Settings.Default.ConDefaultRedirectSound);
SoundQuality = (RDPSoundQuality)Enum.Parse(typeof(RDPSoundQuality), Settings.Default.ConDefaultSoundQuality);
} }
private void SetMiscDefaults() private void SetMiscDefaults()

View File

@@ -14,9 +14,9 @@ namespace mRemoteNG.Connection
#region General #region General
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGeneral)), [LocalizedAttributes.LocalizedCategory("strCategoryGeneral"),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameAll)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameAll"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionAll)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionAll"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EverythingInherited public bool EverythingInherited
{ {
@@ -28,21 +28,21 @@ namespace mRemoteNG.Connection
#region Display #region Display
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay), 2), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameDescription)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameDescription"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionDescription)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionDescription"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Description { get; set; } public bool Description { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay), 2), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameIcon)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameIcon"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionIcon)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionIcon"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Icon { get; set; } public bool Icon { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryDisplay), 2), [LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNamePanel)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNamePanel"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionPanel)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionPanel"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Panel { get; set; } public bool Panel { get; set; }
@@ -50,37 +50,37 @@ namespace mRemoteNG.Connection
#region Connection #region Connection
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUsername)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUsername"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUsername)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUsername"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(true)] [Browsable(true)]
public bool Username { get; set; } public bool Username { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVmId)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVmId"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVmId)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVmId"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(true)] [Browsable(true)]
public bool VmId { get; set; } public bool VmId { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNamePassword)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNamePassword"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionPassword)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionPassword"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(true)] [Browsable(true)]
public bool Password { get; set; } public bool Password { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameDomain)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameDomain"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionDomain)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionDomain"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
[Browsable(true)] [Browsable(true)]
public bool Domain { get; set; } public bool Domain { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 3), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNamePort)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNamePort"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionPort)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionPort"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Port { get; set; } public bool Port { get; set; }
@@ -88,127 +88,122 @@ namespace mRemoteNG.Connection
#region Protocol #region Protocol
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameProtocol)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameProtocol"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionProtocol)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionProtocol"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Protocol { get; set; } public bool Protocol { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRdpVersion)), LocalizedAttributes.LocalizedDisplayName("strPropertyNameRdpVersion"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRdpVersion)), LocalizedAttributes.LocalizedDescription("strPropertyDescriptionRdpVersion"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RdpVersion { get; set; } public bool RdpVersion { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameExternalTool)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameExternalTool"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionExternalTool)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionExternalTool"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool ExtApp { get; set; } public bool ExtApp { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNamePuttySession)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNamePuttySession"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionPuttySession)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionPuttySession"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool PuttySession { get; set; } public bool PuttySession { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameEncryptionStrength)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameEncryptionStrength"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionEncryptionStrength)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionEncryptionStrength"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool ICAEncryptionStrength { get; set; } public bool ICAEncryptionStrength { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameAuthenticationLevel)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameAuthenticationLevel"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionAuthenticationLevel)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionAuthenticationLevel"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDPAuthenticationLevel { get; set; } public bool RDPAuthenticationLevel { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDPMinutesToIdleTimeout)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDPMinutesToIdleTimeout"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDPMinutesToIdleTimeout)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDPMinutesToIdleTimeout"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDPMinutesToIdleTimeout { get; set; } public bool RDPMinutesToIdleTimeout { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDPAlertIdleTimeout)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDPAlertIdleTimeout"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDPAlertIdleTimeout)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDPAlertIdleTimeout"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDPAlertIdleTimeout { get; set; } public bool RDPAlertIdleTimeout { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameLoadBalanceInfo)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameLoadBalanceInfo"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionLoadBalanceInfo)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionLoadBalanceInfo"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool LoadBalanceInfo { get; set; } public bool LoadBalanceInfo { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRenderingEngine)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRenderingEngine"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRenderingEngine)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRenderingEngine"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RenderingEngine { get; set; } public bool RenderingEngine { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUseConsoleSession)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUseConsoleSession"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUseConsoleSession)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUseConsoleSession"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseConsoleSession { get; set; } public bool UseConsoleSession { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUseCredSsp)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUseCredSsp"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUseCredSsp)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUseCredSsp"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseCredSsp { get; set; } public bool UseCredSsp { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4), [LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUseVmId)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUseVmId"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUseVmId)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUseVmId"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseVmId { get; set; } public bool UseVmId { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProtocol), 4),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUseEnhancedMode)),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUseEnhancedMode)),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UseEnhancedMode { get; set; }
#endregion #endregion
#region RD Gateway #region RD Gateway
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayUsageMethod)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayUsageMethod"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayUsageMethod)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDGatewayUsageMethod"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayUsageMethod { get; set; } public bool RDGatewayUsageMethod { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayHostname)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayHostname"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayHostname)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDGatewayHostname"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayHostname { get; set; } public bool RDGatewayHostname { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayUseConnectionCredentials)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayUseConnectionCredentials"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayUseConnectionCredentials)), LocalizedAttributes.LocalizedDescriptionInherit(
"strPropertyDescriptionRDGatewayUseConnectionCredentials"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayUseConnectionCredentials { get; set; } public bool RDGatewayUseConnectionCredentials { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayUsername)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayUsername"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayUsername)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDGatewayUsername"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayUsername { get; set; } public bool RDGatewayUsername { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayPassword)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayPassword"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayPassword)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDGatewayPassword"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayPassword { get; set; } public bool RDGatewayPassword { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryGateway), 5), [LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRDGatewayDomain)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRDGatewayDomain"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRDGatewayDomain)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRDGatewayDomain"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RDGatewayDomain { get; set; } public bool RDGatewayDomain { get; set; }
@@ -216,51 +211,52 @@ namespace mRemoteNG.Connection
#region Appearance #region Appearance
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameResolution)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameResolution"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionResolution)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionResolution"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Resolution { get; set; } public bool Resolution { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameAutomaticResize)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameAutomaticResize"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionAutomaticResize)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionAutomaticResize"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool AutomaticResize { get; set; } public bool AutomaticResize { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameColors)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameColors"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionColors)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionColors"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Colors { get; set; } public bool Colors { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameCacheBitmaps)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameCacheBitmaps"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionCacheBitmaps)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionCacheBitmaps"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool CacheBitmaps { get; set; } public bool CacheBitmaps { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameDisplayWallpaper)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameDisplayWallpaper"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionDisplayWallpaper)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionDisplayWallpaper"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool DisplayWallpaper { get; set; } public bool DisplayWallpaper { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameDisplayThemes)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameDisplayThemes"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionDisplayThemes)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionDisplayThemes"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool DisplayThemes { get; set; } public bool DisplayThemes { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameEnableFontSmoothing)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameEnableFontSmoothing"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionEnableFontSmoothing)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionEnableFontSmoothing"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EnableFontSmoothing { get; set; } public bool EnableFontSmoothing { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 6), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameEnableDesktopComposition)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameEnableDesktopComposition"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionEnableDesktopComposition)), LocalizedAttributes.LocalizedDescriptionInherit(
"strPropertyDescriptionEnableEnableDesktopComposition"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool EnableDesktopComposition { get; set; } public bool EnableDesktopComposition { get; set; }
@@ -268,57 +264,57 @@ namespace mRemoteNG.Connection
#region Redirect #region Redirect
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectKeys)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectKeys"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectKeys)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectKeys"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectKeys { get; set; } public bool RedirectKeys { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectDrives)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectDrives"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectDrives)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectDrives"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectDiskDrives { get; set; } public bool RedirectDiskDrives { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectPrinters)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectPrinters"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectPrinters)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectPrinters"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectPrinters { get; set; } public bool RedirectPrinters { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectClipboard)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectClipboard"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectClipboard)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectClipboard"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectClipboard { get; set; } public bool RedirectClipboard { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectPorts)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectPorts"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectPorts)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectPorts"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectPorts { get; set; } public bool RedirectPorts { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectSmartCards)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectSmartCards"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectSmartCards)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectSmartCards"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectSmartCards { get; set; } public bool RedirectSmartCards { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectSounds)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectSounds"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectSounds)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectSounds"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectSound { get; set; } public bool RedirectSound { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameSoundQuality)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameSoundQuality"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionSoundQuality)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionSoundQuality"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool SoundQuality { get; set; } public bool SoundQuality { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryRedirect), 7), [LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameRedirectAudioCapture)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameRedirectAudioCapture"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionRedirectAudioCapture)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionRedirectAudioCapture"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool RedirectAudioCapture { get; set; } public bool RedirectAudioCapture { get; set; }
@@ -326,91 +322,91 @@ namespace mRemoteNG.Connection
#region Misc #region Misc
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 8), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameExternalToolBefore)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameExternalToolBefore"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionExternalToolBefore)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionExternalToolBefore"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool PreExtApp { get; set; } public bool PreExtApp { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 8), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameExternalToolAfter)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameExternalToolAfter"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionExternalToolAfter)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionExternalToolAfter"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool PostExtApp { get; set; } public bool PostExtApp { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 8), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameMACAddress)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameMACAddress"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionMACAddress)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionMACAddress"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool MacAddress { get; set; } public bool MacAddress { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 8), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameUser1)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUser1"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionUser1)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUser1"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool UserField { get; set; } public bool UserField { get; set; }
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryMiscellaneous), 8), [LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameFavorite)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameFavorite"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionFavorite)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionFavorite"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))] TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
public bool Favorite { get; set; } public bool Favorite { get; set; }
#endregion #endregion
#region VNC #region VNC
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 9), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameCompression)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameCompression"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionCompression)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionCompression"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCCompression {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCCompression {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 9), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameEncoding)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameEncoding"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionEncoding)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionEncoding"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCEncoding {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCEncoding {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryConnection), 9), [LocalizedAttributes.LocalizedCategory("strCategoryConnection", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameAuthenticationMode)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameAuthenticationMode"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionAuthenticationMode)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionAuthenticationMode"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCAuthMode {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCAuthMode {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 9), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVNCProxyType)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVNCProxyType"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVNCProxyType)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVNCProxyType"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyType {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyType {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 9), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVNCProxyAddress)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVNCProxyAddress"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVNCProxyAddress)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVNCProxyAddress"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyIP {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyIP {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 9), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVNCProxyPort)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVNCProxyPort"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVNCProxyPort)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVNCProxyPort"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPort {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPort {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 9), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVNCProxyUsername)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVNCProxyUsername"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVNCProxyUsername)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVNCProxyUsername"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyUsername {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyUsername {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryProxy), 9), [LocalizedAttributes.LocalizedCategory("strCategoryProxy", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameVNCProxyPassword)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameVNCProxyPassword"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionVNCProxyPassword)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionVNCProxyPassword"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPassword {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCProxyPassword {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 9), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameColors)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameColors"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionColors)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionColors"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCColors {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCColors {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 9), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameSmartSizeMode)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameSmartSizeMode"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionSmartSizeMode)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionSmartSizeMode"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCSmartSizeMode {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCSmartSizeMode {get; set;}
[LocalizedAttributes.LocalizedCategory(nameof(Language.strCategoryAppearance), 9), [LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
LocalizedAttributes.LocalizedDisplayNameInherit(nameof(Language.strPropertyNameViewOnly)), LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameViewOnly"),
LocalizedAttributes.LocalizedDescriptionInherit(nameof(Language.strPropertyDescriptionViewOnly)), LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionViewOnly"),
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCViewOnly {get; set;} TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCViewOnly {get; set;}
#endregion #endregion

View File

@@ -16,10 +16,15 @@ namespace mRemoteNG.Connection
{ {
public class ConnectionInitiator : IConnectionInitiator public class ConnectionInitiator : IConnectionInitiator
{ {
private readonly PanelAdder _panelAdder = new PanelAdder(); private readonly ProtocolFactory _protocolFactory;
private readonly List<string> _activeConnections = new List<string>(); private readonly List<ProtocolBase> _activeConnections = new List<ProtocolBase>();
public IEnumerable<string> ActiveConnections => _activeConnections; public IEnumerable<ProtocolBase> ActiveConnections => _activeConnections;
public ConnectionInitiator(ProtocolFactory protocolFactory)
{
_protocolFactory = protocolFactory;
}
public bool SwitchToOpenConnection(ConnectionInfo connectionInfo) public bool SwitchToOpenConnection(ConnectionInfo connectionInfo)
{ {
@@ -32,6 +37,8 @@ namespace mRemoteNG.Connection
return true; return true;
} }
public void OpenConnection( public void OpenConnection(
ContainerInfo containerInfo, ContainerInfo containerInfo,
ConnectionInfo.Force force = ConnectionInfo.Force.None, ConnectionInfo.Force force = ConnectionInfo.Force.None,
@@ -74,8 +81,7 @@ namespace mRemoteNG.Connection
return; return;
} }
var protocolFactory = new ProtocolFactory(); var newProtocol = _protocolFactory.CreateProtocol(connectionInfo);
var newProtocol = protocolFactory.CreateProtocol(connectionInfo);
var connectionPanel = SetConnectionPanel(connectionInfo, force); var connectionPanel = SetConnectionPanel(connectionInfo, force);
if (string.IsNullOrEmpty(connectionPanel)) return; if (string.IsNullOrEmpty(connectionPanel)) return;
@@ -93,6 +99,7 @@ namespace mRemoteNG.Connection
return; return;
} }
OnConnectionStarting(newProtocol.InterfaceControl.Info, newProtocol);
if (newProtocol.Connect() == false) if (newProtocol.Connect() == false)
{ {
newProtocol.Close(); newProtocol.Close();
@@ -100,7 +107,7 @@ namespace mRemoteNG.Connection
} }
connectionInfo.OpenConnections.Add(newProtocol); connectionInfo.OpenConnections.Add(newProtocol);
_activeConnections.Add(connectionInfo.ConstantID); _activeConnections.Add(newProtocol);
FrmMain.Default.SelectedConnection = connectionInfo; FrmMain.Default.SelectedConnection = connectionInfo;
} }
catch (Exception ex) catch (Exception ex)
@@ -140,14 +147,14 @@ namespace mRemoteNG.Connection
return null; return null;
} }
private static string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force) private string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
{ {
if (connectionInfo.Panel != "" && if (connectionInfo.Panel != "" &&
!force.HasFlag(ConnectionInfo.Force.OverridePanel) && !force.HasFlag(ConnectionInfo.Force.OverridePanel) &&
!Settings.Default.AlwaysShowPanelSelectionDlg) !Settings.Default.AlwaysShowPanelSelectionDlg)
return connectionInfo.Panel; return connectionInfo.Panel;
var frmPnl = new FrmChoosePanel(); var frmPnl = new FrmChoosePanel(this);
return frmPnl.ShowDialog() == DialogResult.OK return frmPnl.ShowDialog() == DialogResult.OK
? frmPnl.Panel ? frmPnl.Panel
: null; : null;
@@ -158,7 +165,7 @@ namespace mRemoteNG.Connection
var connectionForm = conForm ?? Runtime.WindowList.FromString(connectionPanel) as ConnectionWindow; var connectionForm = conForm ?? Runtime.WindowList.FromString(connectionPanel) as ConnectionWindow;
if (connectionForm == null) if (connectionForm == null)
connectionForm = _panelAdder.AddPanel(connectionPanel); connectionForm = new PanelAdder(this).AddPanel(connectionPanel);
else else
connectionForm.Show(FrmMain.Default.pnlDock); connectionForm.Show(FrmMain.Default.pnlDock);
@@ -222,11 +229,11 @@ namespace mRemoteNG.Connection
} }
Runtime.MessageCollector.AddMessage(msgClass, Runtime.MessageCollector.AddMessage(msgClass,
string.Format( string.Format(
Language.strProtocolEventDisconnected, Language.strProtocolEventDisconnected,
disconnectedMessage, disconnectedMessage,
prot.InterfaceControl.Info.Hostname, prot.InterfaceControl.Info.Hostname,
prot.InterfaceControl.Info.Protocol.ToString())); prot.InterfaceControl.Info.Protocol.ToString()));
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -255,8 +262,8 @@ namespace mRemoteNG.Connection
prot.InterfaceControl.Info.Protocol, prot.InterfaceControl.Info.Protocol,
Environment.UserName)); Environment.UserName));
prot.InterfaceControl.Info.OpenConnections.Remove(prot); prot.InterfaceControl.Info.OpenConnections.Remove(prot);
if (_activeConnections.Contains(prot.InterfaceControl.Info.ConstantID)) if (_activeConnections.Contains(prot))
_activeConnections.Remove(prot.InterfaceControl.Info.ConstantID); _activeConnections.Remove(prot);
if (prot.InterfaceControl.Info.PostExtApp == "") return; if (prot.InterfaceControl.Info.PostExtApp == "") return;
var extA = Runtime.ExternalToolsService.GetExtAppByName(prot.InterfaceControl.Info.PostExtApp); var extA = Runtime.ExternalToolsService.GetExtAppByName(prot.InterfaceControl.Info.PostExtApp);
@@ -268,7 +275,7 @@ namespace mRemoteNG.Connection
} }
} }
private static void Prot_Event_Connected(object sender) private void Prot_Event_Connected(object sender)
{ {
var prot = (ProtocolBase)sender; var prot = (ProtocolBase)sender;
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnectionEventConnected, Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnectionEventConnected,
@@ -296,10 +303,16 @@ namespace mRemoteNG.Connection
} }
catch (Exception ex) catch (Exception ex)
{ {
Runtime.MessageCollector.AddExceptionStackTrace(Language.ConnectionFailed, ex); Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionEventConnectionFailed, ex);
} }
} }
#endregion #endregion
public event EventHandler<ConnectionStartingEvent> ConnectionStarting;
protected virtual void OnConnectionStarting(ConnectionInfo connectionInfo, ProtocolBase protocolBase)
{
ConnectionStarting?.Invoke(this, new ConnectionStartingEvent(connectionInfo, protocolBase));
}
} }
} }

View File

@@ -0,0 +1,18 @@
using System;
using mRemoteNG.Connection.Protocol;
namespace mRemoteNG.Connection
{
[Serializable]
public class ConnectionStartingEvent : EventArgs
{
public ConnectionInfo ConnectionInfo { get; }
public ProtocolBase Protocol { get; }
public ConnectionStartingEvent(ConnectionInfo connectionInfo, ProtocolBase protocol)
{
ConnectionInfo = connectionInfo;
Protocol = protocol;
}
}
}

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Container; using mRemoteNG.Container;
using mRemoteNG.UI.Window; using mRemoteNG.UI.Window;
@@ -6,7 +8,7 @@ namespace mRemoteNG.Connection
{ {
public interface IConnectionInitiator public interface IConnectionInitiator
{ {
IEnumerable<string> ActiveConnections { get; } IEnumerable<ProtocolBase> ActiveConnections { get; }
void OpenConnection( void OpenConnection(
ContainerInfo containerInfo, ContainerInfo containerInfo,
@@ -19,5 +21,7 @@ namespace mRemoteNG.Connection
ConnectionWindow conForm = null); ConnectionWindow conForm = null);
bool SwitchToOpenConnection(ConnectionInfo connectionInfo); bool SwitchToOpenConnection(ConnectionInfo connectionInfo);
event EventHandler<ConnectionStartingEvent> ConnectionStarting;
} }
} }

View File

@@ -1,4 +1,4 @@
using mRemoteNG.App; using mRemoteNG.App;
using mRemoteNG.Connection.Protocol; using mRemoteNG.Connection.Protocol;
using System; using System;
using System.Drawing; using System.Drawing;
@@ -25,6 +25,8 @@ namespace mRemoteNG.Connection
Location = new Point(0, 0); Location = new Point(0, 0);
Size = Parent.Size; Size = Parent.Size;
Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
GotFocus += OnGotFocus;
LostFocus += OnLostFocus;
InitializeComponent(); InitializeComponent();
} }
catch (Exception ex) catch (Exception ex)
@@ -35,6 +37,16 @@ namespace mRemoteNG.Connection
} }
} }
private void OnLostFocus(object sender, EventArgs e)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.DebugMsg, $"InterfaceControl lost focus '{Info.Name}'");
}
private void OnGotFocus(object sender, EventArgs e)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.DebugMsg, $"InterfaceControl gained focus '{Info.Name}'");
}
public static InterfaceControl FindInterfaceControl(DockPanel DockPnl) public static InterfaceControl FindInterfaceControl(DockPanel DockPnl)
{ {
if (!(DockPnl.ActiveDocument is ConnectionTab ct)) return null; if (!(DockPnl.ActiveDocument is ConnectionTab ct)) return null;

View File

@@ -0,0 +1,120 @@
using System;
using System.Diagnostics;
using mRemoteNG.App;
using mRemoteNG.Messages;
namespace mRemoteNG.Connection.Protocol
{
public abstract class ExternalProcessProtocolBase : ProtocolBase, IFocusable
{
private IntPtr _winEventHook;
private NativeMethods.WinEventDelegate _setForegroundDelegate;
private bool _hasFocus;
public override bool IsExternalProcess { get; } = true;
protected Process ProtocolProcess { get; set; }
protected IntPtr ProcessHandle { get; set; }
public bool HasFocus
{
get => _hasFocus;
private set
{
if (_hasFocus == value)
return;
_hasFocus = value;
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg,
string.Format("External protocol window set to {0}. name:'{1}', protocol:'{2}', pid:{3}, hwnd:{4}",
_hasFocus ? "foreground" : "background",
InterfaceControl.Info.Name,
InterfaceControl.Info.Protocol,
ProtocolProcess.Id,
ProcessHandle));
OnFocusChanged();
}
}
public int ThreadId => (int)NativeMethods.GetWindowThreadProcessId(ProcessHandle, IntPtr.Zero);
public override bool Connect()
{
_setForegroundDelegate = OnWinEventSetForeground;
_winEventHook = NativeMethods.SetWinEventHook(
NativeMethods.EVENT_SYSTEM_FOREGROUND,
NativeMethods.EVENT_SYSTEM_FOREGROUND,
IntPtr.Zero,
_setForegroundDelegate,
/*Convert.ToUInt32(ProtocolProcess.Id)*/0,
0,
NativeMethods.WINEVENT_OUTOFCONTEXT);
return base.Connect();
}
public override void Close()
{
if (NativeMethods.UnhookWinEvent(_winEventHook))
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Successfully unhooked WinEvent listener from '{InterfaceControl.Info.Name}'");
}
else
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Failed to unhook WinEvent listener from '{InterfaceControl.Info.Name}'");
}
base.Close();
}
public override void Focus()
{
FocusChildProcessWindow();
}
private void FocusChildProcessWindow()
{
if (NativeMethods.GetForegroundWindow() == ProcessHandle)
{
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, "Process already focused - do nothing");
return;
}
var setForegroundSuccessful = NativeMethods.SetForegroundWindow(ProcessHandle);
if (!setForegroundSuccessful)
{
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
"Failed to set external protocol window to foreground. " +
$"name:'{InterfaceControl.Info.Name}', " +
$"protocol:'{InterfaceControl.Info.Protocol}', " +
$"pid:{ProtocolProcess.Id}, " +
$"hwnd:{ProcessHandle}");
}
}
/// <summary>
/// This callback will be called when the external process window managed by
/// this protocol is brought to the foreground.
/// </summary>
/// <param name="hWinEventHook"></param>
/// <param name="eventType"></param>
/// <param name="hwnd"></param>
/// <param name="idObject"></param>
/// <param name="idChild"></param>
/// <param name="dwEventThread"></param>
/// <param name="dwmsEventTime"></param>
void OnWinEventSetForeground(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{
HasFocus = hwnd == ProcessHandle;
}
public event EventHandler FocusChanged;
protected virtual void OnFocusChanged()
{
FocusChanged?.Invoke(this, EventArgs.Empty);
}
}
}

View File

@@ -219,14 +219,14 @@ namespace mRemoteNG.Connection.Protocol.Http
} }
} }
if (!string.IsNullOrEmpty(tabTitle)) if (!string.IsNullOrEmpty(tabTitle))
{ {
tabP.TabText = tabTitle + @" - " + shortTitle; tabP.TabText = tabTitle + @" - " + shortTitle;
} }
else else
{ {
tabP.TabText = shortTitle; tabP.TabText = shortTitle;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -265,14 +265,14 @@ namespace mRemoteNG.Connection.Protocol.Http
} }
} }
if (!string.IsNullOrEmpty(tabTitle)) if (!string.IsNullOrEmpty(tabTitle))
{ {
tabP.TabText = tabTitle + @" - " + shortTitle; tabP.TabText = tabTitle + @" - " + shortTitle;
} }
else else
{ {
tabP.TabText = shortTitle; tabP.TabText = shortTitle;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -282,7 +282,7 @@ namespace mRemoteNG.Connection.Protocol.Http
private void geckoBrowser_LauncherDialog_Download(object sender, Gecko.LauncherDialogEvent e) private void geckoBrowser_LauncherDialog_Download(object sender, Gecko.LauncherDialogEvent e)
{ {
var objTarget = Xpcom.CreateInstance<nsILocalFileWin>("@mozilla.org/file/local;1"); var objTarget = Xpcom.CreateInstance<nsILocalFile>("@mozilla.org/file/local;1");
using (var tmp = new nsAString(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\mremoteng.download")) using (var tmp = new nsAString(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\mremoteng.download"))
{ {
objTarget.InitWithPath(tmp); objTarget.InitWithPath(tmp);
@@ -320,10 +320,10 @@ namespace mRemoteNG.Connection.Protocol.Http
public enum RenderingEngine public enum RenderingEngine
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttpInternetExplorer))] [LocalizedAttributes.LocalizedDescription("strHttpInternetExplorer")]
IE = 1, IE = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttpGecko))] [LocalizedAttributes.LocalizedDescription("strHttpGecko")]
Gecko = 2 Gecko = 2
} }

View File

@@ -361,19 +361,19 @@ namespace mRemoteNG.Connection.Protocol.ICA
public enum EncryptionStrength public enum EncryptionStrength
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEncBasic))] [LocalizedAttributes.LocalizedDescription("strEncBasic")]
EncrBasic = 1, EncrBasic = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc128BitLogonOnly))] [LocalizedAttributes.LocalizedDescription("strEnc128BitLogonOnly")]
Encr128BitLogonOnly = 127, Encr128BitLogonOnly = 127,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc40Bit))] [LocalizedAttributes.LocalizedDescription("strEnc40Bit")]
Encr40Bit = 40, Encr40Bit = 40,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc56Bit))] [LocalizedAttributes.LocalizedDescription("strEnc56Bit")]
Encr56Bit = 56, Encr56Bit = 56,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc128Bit))] [LocalizedAttributes.LocalizedDescription("strEnc128Bit")]
Encr128Bit = 128 Encr128Bit = 128
} }

View File

@@ -0,0 +1,11 @@
using System;
namespace mRemoteNG.Connection.Protocol
{
public interface IFocusable
{
bool HasFocus { get; }
void Focus();
event EventHandler FocusChanged;
}
}

View File

@@ -9,7 +9,7 @@ using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol namespace mRemoteNG.Connection.Protocol
{ {
public class IntegratedProgram : ProtocolBase public class IntegratedProgram : ExternalProcessProtocolBase
{ {
#region Private Fields #region Private Fields
@@ -113,7 +113,7 @@ namespace mRemoteNG.Connection.Protocol
} }
catch (Exception ex) catch (Exception ex)
{ {
Runtime.MessageCollector?.AddExceptionMessage(Language.ConnectionFailed, ex); Runtime.MessageCollector?.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
return false; return false;
} }
} }

View File

@@ -1,100 +0,0 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.Messages;
namespace mRemoteNG.Connection.Protocol.PowerShell
{
public class ProtocolPowerShell : ProtocolBase
{
#region Private Fields
private IntPtr _handle;
private readonly ConnectionInfo _connectionInfo;
private ConsoleControl.ConsoleControl _consoleControl;
public ProtocolPowerShell(ConnectionInfo connectionInfo)
{
_connectionInfo = connectionInfo;
}
#endregion
#region Public Methods
public override bool Connect()
{
try
{
Runtime.MessageCollector?.AddMessage(MessageClass.InformationMsg,
"Attempting to start remote PowerShell session.", true);
_consoleControl = new ConsoleControl.ConsoleControl
{
Dock = DockStyle.Fill,
BackColor = ColorTranslator.FromHtml("#012456"),
ForeColor = Color.White,
IsInputEnabled = true,
Padding = new Padding(0, 20, 0, 0)
};
_consoleControl.StartProcess(@"C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell.exe",
$@"-NoExit -Command ""$password = ConvertTo-SecureString '{_connectionInfo.Password}' -AsPlainText -Force; $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @('{_connectionInfo.Domain}\{_connectionInfo.Username}', $password); Enter-PSSession -ComputerName {_connectionInfo.Hostname} -Credential $cred""");
while (!_consoleControl.IsHandleCreated) break;
_handle = _consoleControl.Handle;
NativeMethods.SetParent(_handle, InterfaceControl.Handle);
Resize(this, new EventArgs());
base.Connect();
return true;
}
catch (Exception ex)
{
Runtime.MessageCollector?.AddExceptionMessage(Language.ConnectionFailed, 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);
}
}
#endregion
#region Enumerations
public enum Defaults
{
Port = 5985
}
#endregion
}
}

View File

@@ -63,6 +63,12 @@ namespace mRemoteNG.Connection.Protocol
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 ReconnectGroup ReconnectGroup;
/// <summary>
/// Whether this protocol runs as a thread within the main process or if
/// it is an external process that is running as a child process.
/// </summary>
public virtual bool IsExternalProcess { get; } = false;
protected ProtocolBase(string name) protected ProtocolBase(string name)
{ {
Name = name; Name = name;
@@ -333,7 +339,8 @@ namespace mRemoteNG.Connection.Protocol
private void Dispose(bool disposing) private void Dispose(bool disposing)
{ {
if (disposing) return; if (!disposing) return;
tmrReconnect?.Dispose(); tmrReconnect?.Dispose();
} }

View File

@@ -7,7 +7,6 @@ using mRemoteNG.Connection.Protocol.SSH;
using mRemoteNG.Connection.Protocol.Telnet; using mRemoteNG.Connection.Protocol.Telnet;
using mRemoteNG.Connection.Protocol.VNC; using mRemoteNG.Connection.Protocol.VNC;
using System; using System;
using mRemoteNG.Connection.Protocol.PowerShell;
namespace mRemoteNG.Connection.Protocol namespace mRemoteNG.Connection.Protocol
{ {
@@ -44,8 +43,6 @@ namespace mRemoteNG.Connection.Protocol
var icaProtocol = new IcaProtocol(); var icaProtocol = new IcaProtocol();
icaProtocol.tmrReconnect.Elapsed += icaProtocol.tmrReconnect_Elapsed; icaProtocol.tmrReconnect.Elapsed += icaProtocol.tmrReconnect_Elapsed;
return icaProtocol; return icaProtocol;
case ProtocolType.PowerShell:
return new ProtocolPowerShell(connectionInfo);
case ProtocolType.IntApp: case ProtocolType.IntApp:
if (connectionInfo.ExtApp == "") if (connectionInfo.ExtApp == "")
{ {
@@ -54,7 +51,7 @@ namespace mRemoteNG.Connection.Protocol
return new IntegratedProgram(); return new IntegratedProgram();
} }
return default; return default(ProtocolBase);
} }
} }
} }

View File

@@ -1,43 +1,40 @@
using mRemoteNG.Tools; using mRemoteNG.Tools;
namespace mRemoteNG.Connection.Protocol namespace mRemoteNG.Connection.Protocol
{ {
public enum ProtocolType public enum ProtocolType
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP))] [LocalizedAttributes.LocalizedDescription("strRDP")]
RDP = 0, RDP = 0,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strVnc))] [LocalizedAttributes.LocalizedDescription("strVnc")]
VNC = 1, VNC = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strSsh1))] [LocalizedAttributes.LocalizedDescription("strSsh1")]
SSH1 = 2, SSH1 = 2,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strSsh2))] [LocalizedAttributes.LocalizedDescription("strSsh2")]
SSH2 = 3, SSH2 = 3,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strTelnet))] [LocalizedAttributes.LocalizedDescription("strTelnet")]
Telnet = 4, Telnet = 4,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRlogin))] [LocalizedAttributes.LocalizedDescription("strRlogin")]
Rlogin = 5, Rlogin = 5,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRAW))] [LocalizedAttributes.LocalizedDescription("strRAW")]
RAW = 6, RAW = 6,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttp))] [LocalizedAttributes.LocalizedDescription("strHttp")]
HTTP = 7, HTTP = 7,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttps))] [LocalizedAttributes.LocalizedDescription("strHttps")]
HTTPS = 8, HTTPS = 8,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strICA))] [LocalizedAttributes.LocalizedDescription("strICA")]
ICA = 9, ICA = 9,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strPowerShell))] [LocalizedAttributes.LocalizedDescription("strExtApp")]
PowerShell = 10,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strExtApp))]
IntApp = 20 IntApp = 20
} }
} }

View File

@@ -14,27 +14,22 @@ using System.Windows.Forms;
namespace mRemoteNG.Connection.Protocol namespace mRemoteNG.Connection.Protocol
{ {
public class PuttyBase : ProtocolBase public class PuttyBase : ExternalProcessProtocolBase
{ {
private const int IDM_RECONF = 0x50; // PuTTY Settings Menu ID private const int IDM_RECONF = 0x50; // PuTTY Settings Menu ID
private bool _isPuttyNg; private bool _isPuttyNg;
private readonly DisplayProperties _display = new DisplayProperties(); private readonly DisplayProperties _display = new DisplayProperties();
#region Public Properties #region Public Properties
protected Putty_Protocol PuttyProtocol { private get; set; } protected Putty_Protocol PuttyProtocol { private get; set; }
protected Putty_SSHVersion PuttySSHVersion { private get; set; } protected Putty_SSHVersion PuttySSHVersion { private get; set; }
public IntPtr PuttyHandle { get; set; }
private Process PuttyProcess { get; set; }
public static string PuttyPath { get; set; } public static string PuttyPath { get; set; }
public bool Focused public bool Focused
{ {
get { return NativeMethods.GetForegroundWindow() == PuttyHandle; } get { return NativeMethods.GetForegroundWindow() == ProcessHandle; }
} }
#endregion #endregion
@@ -54,111 +49,40 @@ namespace mRemoteNG.Connection.Protocol
{ {
try try
{ {
_isPuttyNg = PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.PuttyNg; base.Connect();
var arguments = BuildPuttyCommandLineArguments(InterfaceControl.Info);
PuttyProcess = new Process ProtocolProcess = new Process
{ {
StartInfo = StartInfo =
{ {
UseShellExecute = false, UseShellExecute = false,
FileName = PuttyPath FileName = PuttyPath,
} Arguments = arguments.ToString()
},
EnableRaisingEvents = true
}; };
var arguments = new CommandLineArguments {EscapeForShell = false}; ProtocolProcess.Exited += ProcessExited;
arguments.Add("-load", InterfaceControl.Info.PuttySession); ProtocolProcess.Start();
ProtocolProcess.WaitForInputIdle(Settings.Default.MaxPuttyWaitTime * 1000);
if (!(InterfaceControl.Info is PuttySessionInfo))
{
arguments.Add("-" + PuttyProtocol);
if (PuttyProtocol == Putty_Protocol.ssh)
{
var username = "";
var password = "";
if (!string.IsNullOrEmpty(InterfaceControl.Info?.Username))
{
username = InterfaceControl.Info.Username;
}
else
{
// ReSharper disable once SwitchStatementMissingSomeCases
switch (Settings.Default.EmptyCredentials)
{
case "windows":
username = Environment.UserName;
break;
case "custom":
username = Settings.Default.DefaultUsername;
break;
}
}
if (!string.IsNullOrEmpty(InterfaceControl.Info?.Password))
{
password = InterfaceControl.Info.Password;
}
else
{
if (Settings.Default.EmptyCredentials == "custom")
{
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
password = cryptographyProvider.Decrypt(Settings.Default.DefaultPassword,
Runtime.EncryptionKey);
}
}
arguments.Add("-" + (int)PuttySSHVersion);
if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials))
{
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; var startTicks = Environment.TickCount;
while (PuttyHandle.ToInt32() == 0 & while (ProcessHandle.ToInt32() == 0 &
Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000) Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
{ {
if (_isPuttyNg) if (_isPuttyNg)
{ {
PuttyHandle = NativeMethods.FindWindowEx( ProcessHandle = NativeMethods.FindWindowEx(InterfaceControl.Handle, new IntPtr(0), null, null);
InterfaceControl.Handle, new IntPtr(0), null, null);
} }
else else
{ {
PuttyProcess.Refresh(); ProtocolProcess.Refresh();
PuttyHandle = PuttyProcess.MainWindowHandle; ProcessHandle = ProtocolProcess.MainWindowHandle;
} }
if (PuttyHandle.ToInt32() == 0) if (ProcessHandle.ToInt32() == 0)
{ {
Thread.Sleep(0); Thread.Sleep(0);
} }
@@ -166,44 +90,127 @@ namespace mRemoteNG.Connection.Protocol
if (!_isPuttyNg) if (!_isPuttyNg)
{ {
NativeMethods.SetParent(PuttyHandle, InterfaceControl.Handle); NativeMethods.SetParent(ProcessHandle, InterfaceControl.Handle);
} }
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strPuttyStuff, true); Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strPuttyStuff, true);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
string.Format(Language.strPuttyHandle, PuttyHandle), true); string.Format(Language.strPuttyHandle, ProcessHandle), true);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
string.Format(Language.strPuttyTitle, PuttyProcess.MainWindowTitle), string.Format(Language.strPuttyTitle, ProtocolProcess.MainWindowTitle),
true); true);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
string.Format(Language.strPuttyParentHandle, string.Format(Language.strPuttyParentHandle,
InterfaceControl.Parent.Handle), true); InterfaceControl.Parent.Handle), true);
Resize(this, new EventArgs()); Resize(this, new EventArgs());
base.Connect();
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
{ {
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
Language.ConnectionFailed + Environment.NewLine + Language.strPuttyConnectionFailed + Environment.NewLine +
ex.Message); ex.Message);
return false; return false;
} }
} }
private CommandLineArguments BuildPuttyCommandLineArguments(AbstractConnectionRecord connectionInfo)
{
var arguments = new CommandLineArguments { EscapeForShell = false };
arguments.Add("-load", connectionInfo.PuttySession);
if (!(connectionInfo is PuttySessionInfo))
{
arguments.Add("-" + PuttyProtocol);
if (PuttyProtocol == Putty_Protocol.ssh)
{
var username = "";
var password = "";
if (!string.IsNullOrEmpty(connectionInfo.Username))
{
username = connectionInfo.Username;
}
else
{
// ReSharper disable once SwitchStatementMissingSomeCases
switch (Settings.Default.EmptyCredentials)
{
case "windows":
username = Environment.UserName;
break;
case "custom":
username = Settings.Default.DefaultUsername;
break;
}
}
if (!string.IsNullOrEmpty(connectionInfo.Password))
{
password = connectionInfo.Password;
}
else
{
if (Settings.Default.EmptyCredentials == "custom")
{
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
password = cryptographyProvider.Decrypt(Settings.Default.DefaultPassword,
Runtime.EncryptionKey);
}
}
arguments.Add("-" + (int)PuttySSHVersion);
if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials))
{
if (!string.IsNullOrEmpty(username))
{
arguments.Add("-l", username);
}
if (!string.IsNullOrEmpty(password))
{
arguments.Add("-pw", password);
}
}
}
arguments.Add("-P", connectionInfo.Port.ToString());
arguments.Add(connectionInfo.Hostname);
}
_isPuttyNg = PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.PuttyNg;
if (_isPuttyNg)
{
arguments.Add("-hwndparent", InterfaceControl.Handle.ToString());
}
return arguments;
}
public override void Focus() public override void Focus()
{ {
try //try
{ //{
NativeMethods.SetForegroundWindow(PuttyHandle); // if (NativeMethods.GetForegroundWindow() == PuttyHandle)
} // {
catch (Exception ex) // Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Putty window already focused, ignoring focus request '{InterfaceControl.Info.Name}' (pid:{PuttyProcess.Id})");
{ // return;
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, // }
Language.strPuttyFocusFailed + Environment.NewLine + ex.Message,
true); // NativeMethods.SetForegroundWindow(PuttyHandle);
} // Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Putty window focused '{InterfaceControl.Info.Name}' (pid:{PuttyProcess.Id})");
//}
//catch (Exception ex)
//{
// Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
// Language.strPuttyFocusFailed + Environment.NewLine + ex.Message,
// true);
//}
base.Focus();
} }
public override void Resize(object sender, EventArgs e) public override void Resize(object sender, EventArgs e)
@@ -216,14 +223,14 @@ namespace mRemoteNG.Connection.Protocol
if (_isPuttyNg) if (_isPuttyNg)
{ {
// PuTTYNG 0.70.0.1 and later doesn't have any window borders // PuTTYNG 0.70.0.1 and later doesn't have any window borders
NativeMethods.MoveWindow(PuttyHandle, 0, 0, InterfaceControl.Width, InterfaceControl.Height, true); NativeMethods.MoveWindow(ProcessHandle, 0, 0, InterfaceControl.Width, InterfaceControl.Height, true);
} }
else else
{ {
var scaledFrameBorderHeight = _display.ScaleHeight(SystemInformation.FrameBorderSize.Height); var scaledFrameBorderHeight = _display.ScaleHeight(SystemInformation.FrameBorderSize.Height);
var scaledFrameBorderWidth = _display.ScaleWidth(SystemInformation.FrameBorderSize.Width); var scaledFrameBorderWidth = _display.ScaleWidth(SystemInformation.FrameBorderSize.Width);
NativeMethods.MoveWindow(PuttyHandle, -scaledFrameBorderWidth, NativeMethods.MoveWindow(ProcessHandle, -scaledFrameBorderWidth,
-(SystemInformation.CaptionHeight + scaledFrameBorderHeight), -(SystemInformation.CaptionHeight + scaledFrameBorderHeight),
InterfaceControl.Width + scaledFrameBorderWidth * 2, InterfaceControl.Width + scaledFrameBorderWidth * 2,
InterfaceControl.Height + SystemInformation.CaptionHeight + InterfaceControl.Height + SystemInformation.CaptionHeight +
@@ -243,9 +250,9 @@ namespace mRemoteNG.Connection.Protocol
{ {
try try
{ {
if (PuttyProcess.HasExited == false) if (ProtocolProcess.HasExited == false)
{ {
PuttyProcess.Kill(); ProtocolProcess.Kill();
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -257,7 +264,7 @@ namespace mRemoteNG.Connection.Protocol
try try
{ {
PuttyProcess.Dispose(); ProtocolProcess.Dispose();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -273,8 +280,8 @@ namespace mRemoteNG.Connection.Protocol
{ {
try try
{ {
NativeMethods.PostMessage(PuttyHandle, NativeMethods.WM_SYSCOMMAND, (IntPtr)IDM_RECONF, (IntPtr)0); NativeMethods.PostMessage(ProcessHandle, NativeMethods.WM_SYSCOMMAND, (IntPtr)IDM_RECONF, IntPtr.Zero);
NativeMethods.SetForegroundWindow(PuttyHandle); Focus();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -284,6 +291,14 @@ namespace mRemoteNG.Connection.Protocol
} }
} }
/// <summary>
/// Sends an individual key stroke to this PuTTY session.
/// </summary>
public void SendKeyStroke(int keyType, int keyData)
{
NativeMethods.PostMessage(ProcessHandle, keyType, new IntPtr(keyData), new IntPtr(0));
}
#endregion #endregion
#region Enums #region Enums

View File

@@ -4,13 +4,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum AuthenticationLevel public enum AuthenticationLevel
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strAlwaysConnectEvenIfAuthFails))] [LocalizedAttributes.LocalizedDescription("strAlwaysConnectEvenIfAuthFails")]
NoAuth = 0, NoAuth = 0,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strDontConnectWhenAuthFails))] [LocalizedAttributes.LocalizedDescription("strDontConnectWhenAuthFails")]
AuthRequired = 1, AuthRequired = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strWarnIfAuthFails))] [LocalizedAttributes.LocalizedDescription("strWarnIfAuthFails")]
WarnOnFailedAuth = 2 WarnOnFailedAuth = 2
} }
} }

View File

@@ -4,13 +4,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDGatewayUsageMethod public enum RDGatewayUsageMethod
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNever))] [LocalizedAttributes.LocalizedDescription("strNever")]
Never = 0, // TSC_PROXY_MODE_NONE_DIRECT Never = 0, // TSC_PROXY_MODE_NONE_DIRECT
[LocalizedAttributes.LocalizedDescription(nameof(Language.strAlways))] [LocalizedAttributes.LocalizedDescription("strAlways")]
Always = 1, // TSC_PROXY_MODE_DIRECT Always = 1, // TSC_PROXY_MODE_DIRECT
[LocalizedAttributes.LocalizedDescription(nameof(Language.strDetect))] [LocalizedAttributes.LocalizedDescription("strDetect")]
Detect = 2 // TSC_PROXY_MODE_DETECT Detect = 2 // TSC_PROXY_MODE_DETECT
} }
} }

View File

@@ -4,13 +4,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDGatewayUseConnectionCredentials public enum RDGatewayUseConnectionCredentials
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUseDifferentUsernameAndPassword))] [LocalizedAttributes.LocalizedDescription("strUseDifferentUsernameAndPassword")]
No = 0, No = 0,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUseSameUsernameAndPassword))] [LocalizedAttributes.LocalizedDescription("strUseSameUsernameAndPassword")]
Yes = 1, Yes = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUseSmartCard))] [LocalizedAttributes.LocalizedDescription("strUseSmartCard")]
SmartCard = 2 SmartCard = 2
} }
} }

View File

@@ -4,19 +4,19 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDPColors public enum RDPColors
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP256Colors))] [LocalizedAttributes.LocalizedDescription("strRDP256Colors")]
Colors256 = 8, Colors256 = 8,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP32768Colors))] [LocalizedAttributes.LocalizedDescription("strRDP32768Colors")]
Colors15Bit = 15, Colors15Bit = 15,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP65536Colors))] [LocalizedAttributes.LocalizedDescription("strRDP65536Colors")]
Colors16Bit = 16, Colors16Bit = 16,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP16777216Colors))] [LocalizedAttributes.LocalizedDescription("strRDP16777216Colors")]
Colors24Bit = 24, Colors24Bit = 24,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDP4294967296Colors))] [LocalizedAttributes.LocalizedDescription("strRDP4294967296Colors")]
Colors32Bit = 32 Colors32Bit = 32
} }
} }

View File

@@ -5,13 +5,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDPResolutions public enum RDPResolutions
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPFitToPanel))] [LocalizedAttributes.LocalizedDescription("strRDPFitToPanel")]
FitToWindow, FitToWindow,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strFullscreen))] [LocalizedAttributes.LocalizedDescription("strFullscreen")]
Fullscreen, Fullscreen,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSmartSize))] [LocalizedAttributes.LocalizedDescription("strRDPSmartSize")]
SmartSize, SmartSize,
[Description("800x600")] Res800x600, [Description("800x600")] Res800x600,
[Description("1024x768")] Res1024x768, [Description("1024x768")] Res1024x768,

View File

@@ -4,13 +4,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDPSoundQuality public enum RDPSoundQuality
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundQualityDynamic))] [LocalizedAttributes.LocalizedDescription("strRDPSoundQualityDynamic")]
Dynamic = 0, Dynamic = 0,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundQualityMedium))] [LocalizedAttributes.LocalizedDescription("strRDPSoundQualityMedium")]
Medium = 1, Medium = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundQualityHigh))] [LocalizedAttributes.LocalizedDescription("strRDPSoundQualityHigh")]
High = 2 High = 2
} }
} }

View File

@@ -4,13 +4,13 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
public enum RDPSounds public enum RDPSounds
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundBringToThisComputer))] [LocalizedAttributes.LocalizedDescription("strRDPSoundBringToThisComputer")]
BringToThisComputer = 0, BringToThisComputer = 0,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundLeaveAtRemoteComputer))] [LocalizedAttributes.LocalizedDescription("strRDPSoundLeaveAtRemoteComputer")]
LeaveAtRemoteComputer = 1, LeaveAtRemoteComputer = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strRDPSoundDoNotPlay))] [LocalizedAttributes.LocalizedDescription("strRDPSoundDoNotPlay")]
DoNotPlay = 2 DoNotPlay = 2
} }
} }

View File

@@ -1,6 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text;
using System.Threading; using System.Threading;
using System.Timers; using System.Timers;
using System.Windows.Forms; using System.Windows.Forms;
@@ -35,6 +38,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
private readonly FrmMain _frmMain = FrmMain.Default; private readonly FrmMain _frmMain = FrmMain.Default;
protected virtual RdpVersion RdpProtocolVersion => RdpVersion.Rdc6; protected virtual RdpVersion RdpProtocolVersion => RdpVersion.Rdc6;
private AxHost AxHost => (AxHost)Control; private AxHost AxHost => (AxHost)Control;
private readonly NativeMethods.EnumWindowsProc _enumWindowsProc;
#region Properties #region Properties
@@ -101,6 +105,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
{ {
_displayProperties = new DisplayProperties(); _displayProperties = new DisplayProperties();
tmrReconnect.Elapsed += tmrReconnect_Elapsed; tmrReconnect.Elapsed += tmrReconnect_Elapsed;
_enumWindowsProc = LpEnumFunc;
} }
#endregion #endregion
@@ -243,17 +248,54 @@ namespace mRemoteNG.Connection.Protocol.RDP
public override void Focus() public override void Focus()
{ {
var result = new List<IntPtr>();
var listHandle = GCHandle.Alloc(result);
try try
{ {
if (Control.ContainsFocus == false) if (Control.ContainsFocus == false)
{ {
Control.Focus(); //AxHost.Focus();
//AxHost.Select();
//AxHost.DoVerb(-1);
//AxHost.DoVerb(-4);
//AxHost.DoVerb(-5);
NativeMethods.EnumChildWindows(AxHost.Handle, _enumWindowsProc, GCHandle.ToIntPtr(listHandle));
if (result.Any())
{
NativeMethods.SetFocus(result[0]);
Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"RDP connection focused '{connectionInfo.Name}'");
}
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpFocusFailed, ex); Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpFocusFailed, ex);
} }
finally
{
if (listHandle.IsAllocated)
listHandle.Free();
}
}
private bool LpEnumFunc(IntPtr hwnd, IntPtr lparam)
{
var gch = GCHandle.FromIntPtr(lparam);
var list = gch.Target as List<IntPtr>;
if (list == null)
throw new InvalidCastException("GCHandle Target could not be cast as List<IntPtr>");
var sb = new StringBuilder();
NativeMethods.GetClassName(hwnd, sb, 64);
if (sb.ToString().Equals("IHWindowClass"))
{
list.Add(hwnd);
return false;
}
return true;
} }
/// <summary> /// <summary>
@@ -672,6 +714,9 @@ namespace mRemoteNG.Connection.Protocol.RDP
_rdpClient.OnDisconnected += RDPEvent_OnDisconnected; _rdpClient.OnDisconnected += RDPEvent_OnDisconnected;
_rdpClient.OnLeaveFullScreenMode += RDPEvent_OnLeaveFullscreenMode; _rdpClient.OnLeaveFullScreenMode += RDPEvent_OnLeaveFullscreenMode;
_rdpClient.OnIdleTimeoutNotification += RDPEvent_OnIdleTimeoutNotification; _rdpClient.OnIdleTimeoutNotification += RDPEvent_OnIdleTimeoutNotification;
//_rdpClient.OnFocusReleased += direction => Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"RDP control '{connectionInfo.Name}' released focus.");
//AxHost.GotFocus += (sender, args) => Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"RDP control '{connectionInfo.Name}' received focus.");
//AxHost.LostFocus += (sender, args) => Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"RDP control '{connectionInfo.Name}' lost focus.");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -748,7 +793,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
private void RdpClient_GotFocus(object sender, EventArgs e) private void RdpClient_GotFocus(object sender, EventArgs e)
{ {
((ConnectionTab)Control.Parent.Parent).Focus(); //((ConnectionTab)Control.Parent.Parent).Focus();
} }
#endregion #endregion

View File

@@ -28,9 +28,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
rdpClient7.AdvancedSettings7.AuthenticationServiceClass = "Microsoft Virtual Console Service"; rdpClient7.AdvancedSettings7.AuthenticationServiceClass = "Microsoft Virtual Console Service";
rdpClient7.AdvancedSettings8.EnableCredSspSupport = true; rdpClient7.AdvancedSettings8.EnableCredSspSupport = true;
rdpClient7.AdvancedSettings8.NegotiateSecurityLayer = false; rdpClient7.AdvancedSettings8.NegotiateSecurityLayer = false;
rdpClient7.AdvancedSettings7.PCB = $"{connectionInfo.VmId}"; rdpClient7.AdvancedSettings7.PCB = $"{connectionInfo.VmId};EnhancedMode=1";
if (connectionInfo.UseEnhancedMode)
rdpClient7.AdvancedSettings7.PCB += ";EnhancedMode=1";
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -1,362 +1,316 @@
using System; using System;
using System.Threading; using System.ComponentModel;
using System.ComponentModel; using mRemoteNG.App;
using System.Net.Sockets; using mRemoteNG.Tools;
using mRemoteNG.App; using mRemoteNG.UI.Forms;
using mRemoteNG.Tools;
using mRemoteNG.UI.Forms; // ReSharper disable ArrangeAccessorOwnerBody
// ReSharper disable ArrangeAccessorOwnerBody
namespace mRemoteNG.Connection.Protocol.VNC
{
namespace mRemoteNG.Connection.Protocol.VNC public class ProtocolVNC : ProtocolBase, ISupportsViewOnly
{ {
public class ProtocolVNC : ProtocolBase, ISupportsViewOnly #region Properties
{
#region Properties public bool SmartSize
{
public bool SmartSize get { return _VNC.Scaled; }
{ set { _VNC.Scaled = value; }
get { return _vnc.Scaled; } }
set { _vnc.Scaled = value; }
} public bool ViewOnly
{
public bool ViewOnly get { return _VNC.ViewOnly; }
{ set { _VNC.ViewOnly = value; }
get { return _vnc.ViewOnly; } }
set { _vnc.ViewOnly = value; }
} #endregion
#endregion #region Private Declarations
#region Private Declarations private VncSharp.RemoteDesktop _VNC;
private ConnectionInfo Info;
private VncSharp.RemoteDesktop _vnc;
private ConnectionInfo _info; #endregion
private static bool _isConnectionSuccessful;
private static Exception _socketexception; #region Public Methods
private static readonly ManualResetEvent TimeoutObject = new ManualResetEvent(false);
public ProtocolVNC()
#endregion {
Control = new VncSharp.RemoteDesktop();
#region Public Methods }
public ProtocolVNC() public override bool Initialize()
{ {
Control = new VncSharp.RemoteDesktop(); base.Initialize();
}
try
public override bool Initialize() {
{ _VNC = (VncSharp.RemoteDesktop)Control;
base.Initialize();
Info = InterfaceControl.Info;
try
{ _VNC.VncPort = Info.Port;
_vnc = (VncSharp.RemoteDesktop)Control;
_info = InterfaceControl.Info; return true;
_vnc.VncPort = _info.Port; }
catch (Exception ex)
return true; {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncSetPropsFailed + Environment.NewLine + ex.Message,
{ true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, return false;
Language.strVncSetPropsFailed + Environment.NewLine + ex.Message, }
true); }
return false;
} public override bool Connect()
} {
SetEventHandlers();
public override bool Connect()
{ try
SetEventHandlers(); {
try _VNC.Connect(Info.Hostname, Info.VNCViewOnly, Info.VNCSmartSizeMode != SmartSizeMode.SmartSNo);
{ }
if (TestConnect(_info.Hostname, _info.Port, 500)) catch (Exception ex)
_vnc.Connect(_info.Hostname, _info.VNCViewOnly, _info.VNCSmartSizeMode != SmartSizeMode.SmartSNo); {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strConnectionOpenFailed + Environment.NewLine +
{ ex.Message);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, return false;
Language.strConnectionOpenFailed + Environment.NewLine + }
ex.Message);
return false; return true;
} }
return true; public override void Disconnect()
} {
try
public override void Disconnect() {
{ _VNC.Disconnect();
try }
{ catch (Exception ex)
_vnc.Disconnect(); {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncConnectionDisconnectFailed + Environment.NewLine +
{ ex.Message, true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncConnectionDisconnectFailed + Environment.NewLine + }
ex.Message, true);
} public void SendSpecialKeys(SpecialKeys Keys)
} {
try
public void SendSpecialKeys(SpecialKeys Keys) {
{ // ReSharper disable once SwitchStatementMissingSomeCases
try switch (Keys)
{ {
// ReSharper disable once SwitchStatementMissingSomeCases case SpecialKeys.CtrlAltDel:
switch (Keys) _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlAltDel);
{ break;
case SpecialKeys.CtrlAltDel: case SpecialKeys.CtrlEsc:
_vnc.SendSpecialKeys(VncSharp.SpecialKeys.CtrlAltDel); _VNC.SendSpecialKeys(VncSharp.SpecialKeys.CtrlEsc);
break; break;
case SpecialKeys.CtrlEsc: }
_vnc.SendSpecialKeys(VncSharp.SpecialKeys.CtrlEsc); }
break; catch (Exception ex)
} {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncSendSpecialKeysFailed + Environment.NewLine +
{ ex.Message, true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncSendSpecialKeysFailed + Environment.NewLine + }
ex.Message, true);
} public void ToggleSmartSize()
} {
try
public void ToggleSmartSize() {
{ SmartSize = !SmartSize;
try RefreshScreen();
{ }
SmartSize = !SmartSize; catch (Exception ex)
RefreshScreen(); {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncToggleSmartSizeFailed + Environment.NewLine +
{ ex.Message, true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncToggleSmartSizeFailed + Environment.NewLine + }
ex.Message, true);
} public void ToggleViewOnly()
} {
try
public void ToggleViewOnly() {
{ ViewOnly = !ViewOnly;
try }
{ catch (Exception ex)
ViewOnly = !ViewOnly; {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncToggleViewOnlyFailed + Environment.NewLine +
{ ex.Message, true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncToggleViewOnlyFailed + Environment.NewLine + }
ex.Message, true);
}
} public void StartChat()
{
throw new NotImplementedException();
public void StartChat() }
{
throw new NotImplementedException(); public void StartFileTransfer()
} {
throw new NotImplementedException();
public void StartFileTransfer() }
{
throw new NotImplementedException(); public void RefreshScreen()
} {
try
public void RefreshScreen() {
{ _VNC.FullScreenUpdate();
try }
{ catch (Exception ex)
_vnc.FullScreenUpdate(); {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncRefreshFailed + Environment.NewLine + ex.Message,
{ true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncRefreshFailed + Environment.NewLine + ex.Message, }
true);
} #endregion
}
#region Private Methods
#endregion
private void SetEventHandlers()
#region Private Methods {
try
private void SetEventHandlers() {
{ _VNC.ConnectComplete += VNCEvent_Connected;
try _VNC.ConnectionLost += VNCEvent_Disconnected;
{ FrmMain.ClipboardChanged += VNCEvent_ClipboardChanged;
_vnc.ConnectComplete += VNCEvent_Connected; if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials) && Info?.Password?.Length > 0)
_vnc.ConnectionLost += VNCEvent_Disconnected; {
FrmMain.ClipboardChanged += VNCEvent_ClipboardChanged; _VNC.GetPassword = VNCEvent_Authenticate;
if (!Force.HasFlag(ConnectionInfo.Force.NoCredentials) && _info?.Password?.Length > 0) }
{ }
_vnc.GetPassword = VNCEvent_Authenticate; catch (Exception ex)
} {
} Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
catch (Exception ex) Language.strVncSetEventHandlersFailed + Environment.NewLine +
{ ex.Message, true);
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, }
Language.strVncSetEventHandlersFailed + Environment.NewLine + }
ex.Message, true);
} #endregion
}
#region Private Events & Handlers
private static bool TestConnect(string hostName, int port, int timeoutMSec)
{ private void VNCEvent_Connected(object sender, EventArgs e)
var tcpclient = new TcpClient(); {
Event_Connected(this);
TimeoutObject.Reset(); _VNC.AutoScroll = Info.VNCSmartSizeMode == SmartSizeMode.SmartSNo;
tcpclient.BeginConnect(hostName, port, CallBackMethod, tcpclient); }
if (TimeoutObject.WaitOne(timeoutMSec, false)) private void VNCEvent_Disconnected(object sender, EventArgs e)
{ {
if (_isConnectionSuccessful) return true; FrmMain.ClipboardChanged -= VNCEvent_ClipboardChanged;
} Event_Disconnected(sender, @"VncSharp Disconnected.", null);
else Close();
{ }
tcpclient.Close();
throw new TimeoutException($"Connection timed out to host " + hostName + " on port " + port); private void VNCEvent_ClipboardChanged()
} {
_VNC.FillServerClipboard();
return false; }
}
private string VNCEvent_Authenticate()
private static void CallBackMethod(IAsyncResult asyncresult) {
{ return Info.Password;
try }
{
_isConnectionSuccessful = false; #endregion
var tcpclient = asyncresult.AsyncState as TcpClient;
#region Enums
if (tcpclient?.Client == null) return;
public enum Defaults
tcpclient.EndConnect(asyncresult); {
_isConnectionSuccessful = true; Port = 5900
} }
catch (Exception ex)
{ public enum SpecialKeys
_isConnectionSuccessful = false; {
_socketexception = ex; CtrlAltDel,
} CtrlEsc
finally }
{
TimeoutObject.Set(); public enum Compression
} {
} [LocalizedAttributes.LocalizedDescription("strNoCompression")]
CompNone = 99,
#endregion [Description("0")] Comp0 = 0,
[Description("1")] Comp1 = 1,
#region Private Events & Handlers [Description("2")] Comp2 = 2,
[Description("3")] Comp3 = 3,
private void VNCEvent_Connected(object sender, EventArgs e) [Description("4")] Comp4 = 4,
{ [Description("5")] Comp5 = 5,
Event_Connected(this); [Description("6")] Comp6 = 6,
_vnc.AutoScroll = _info.VNCSmartSizeMode == SmartSizeMode.SmartSNo; [Description("7")] Comp7 = 7,
} [Description("8")] Comp8 = 8,
[Description("9")] Comp9 = 9
private void VNCEvent_Disconnected(object sender, EventArgs e) }
{
FrmMain.ClipboardChanged -= VNCEvent_ClipboardChanged; public enum Encoding
Event_Disconnected(sender, @"VncSharp Disconnected.", null); {
Close(); [Description("Raw")] EncRaw,
} [Description("RRE")] EncRRE,
[Description("CoRRE")] EncCorre,
private void VNCEvent_ClipboardChanged() [Description("Hextile")] EncHextile,
{ [Description("Zlib")] EncZlib,
_vnc.FillServerClipboard(); [Description("Tight")] EncTight,
} [Description("ZlibHex")] EncZLibHex,
[Description("ZRLE")] EncZRLE
private string VNCEvent_Authenticate() }
{
return _info.Password; public enum AuthMode
} {
[LocalizedAttributes.LocalizedDescription("VNC")]
#endregion AuthVNC,
#region Enums [LocalizedAttributes.LocalizedDescription("Windows")]
AuthWin
public enum Defaults }
{
Port = 5900 public enum ProxyType
} {
[LocalizedAttributes.LocalizedDescription("strNone")]
public enum SpecialKeys ProxyNone,
{
CtrlAltDel, [LocalizedAttributes.LocalizedDescription("strHttp")]
CtrlEsc ProxyHTTP,
}
[LocalizedAttributes.LocalizedDescription("strSocks5")]
public enum Compression ProxySocks5,
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoCompression))] [LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
CompNone = 99, ProxyUltra
[Description("0")] Comp0 = 0, }
[Description("1")] Comp1 = 1,
[Description("2")] Comp2 = 2, public enum Colors
[Description("3")] Comp3 = 3, {
[Description("4")] Comp4 = 4, [LocalizedAttributes.LocalizedDescription("strNormal")]
[Description("5")] Comp5 = 5, ColNormal,
[Description("6")] Comp6 = 6, [Description("8-bit")] Col8Bit
[Description("7")] Comp7 = 7, }
[Description("8")] Comp8 = 8,
[Description("9")] Comp9 = 9 public enum SmartSizeMode
} {
[LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
public enum Encoding SmartSNo,
{
[Description("Raw")] EncRaw, [LocalizedAttributes.LocalizedDescription("strFree")]
[Description("RRE")] EncRRE, SmartSFree,
[Description("CoRRE")] EncCorre,
[Description("Hextile")] EncHextile, [LocalizedAttributes.LocalizedDescription("strAspect")]
[Description("Zlib")] EncZlib, SmartSAspect
[Description("Tight")] EncTight, }
[Description("ZlibHex")] EncZLibHex,
[Description("ZRLE")] EncZRLE #endregion
} }
}
public enum AuthMode
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strVnc))]
AuthVNC,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strWindows))]
AuthWin
}
public enum ProxyType
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNone))]
ProxyNone,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttp))]
ProxyHTTP,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strSocks5))]
ProxySocks5,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUltraVncRepeater))]
ProxyUltra
}
public enum Colors
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNormal))]
ColNormal,
[Description("8-bit")] Col8Bit
}
public enum SmartSizeMode
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoSmartSize))]
SmartSNo,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strFree))]
SmartSFree,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strAspect))]
SmartSAspect
}
#endregion
}
}

View File

@@ -16,7 +16,7 @@ namespace mRemoteNG.Connection.Protocol.VNC
public enum Compression public enum Compression
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoCompression))] [LocalizedAttributes.LocalizedDescription("strNoCompression")]
CompNone = 99, CompNone = 99,
[Description("0")] Comp0 = 0, [Description("0")] Comp0 = 0,
[Description("1")] Comp1 = 1, [Description("1")] Comp1 = 1,
@@ -44,44 +44,44 @@ namespace mRemoteNG.Connection.Protocol.VNC
public enum AuthMode public enum AuthMode
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strVnc))] [LocalizedAttributes.LocalizedDescription("VNC")]
AuthVNC, AuthVNC,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strWindows))] [LocalizedAttributes.LocalizedDescription("Windows")]
AuthWin AuthWin
} }
public enum ProxyType public enum ProxyType
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNone))] [LocalizedAttributes.LocalizedDescription("strNone")]
ProxyNone, ProxyNone,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttp))] [LocalizedAttributes.LocalizedDescription("strHttp")]
ProxyHTTP, ProxyHTTP,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strSocks5))] [LocalizedAttributes.LocalizedDescription("strSocks5")]
ProxySocks5, ProxySocks5,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUltraVncRepeater))] [LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
ProxyUltra ProxyUltra
} }
public enum Colors public enum Colors
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNormal))] [LocalizedAttributes.LocalizedDescription("strNormal")]
ColNormal, ColNormal,
[Description("8-bit")] Col8Bit [Description("8-bit")] Col8Bit
} }
public enum SmartSizeMode public enum SmartSizeMode
{ {
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoSmartSize))] [LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
SmartSNo, SmartSNo,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strFree))] [LocalizedAttributes.LocalizedDescription("strFree")]
SmartSFree, SmartSFree,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strAspect))] [LocalizedAttributes.LocalizedDescription("strAspect")]
SmartSAspect SmartSAspect
} }
} }

View File

@@ -1,23 +0,0 @@
using mRemoteNG.Connection.Protocol;
namespace mRemoteNG.Connection
{
public class WebHelper
{
public static void GoToUrl(string url)
{
var connectionInfo = new ConnectionInfo();
connectionInfo.CopyFrom(DefaultConnectionInfo.Instance);
connectionInfo.Name = "";
connectionInfo.Hostname = url;
connectionInfo.Protocol = url.StartsWith("https:") ? ProtocolType.HTTPS : ProtocolType.HTTP;
connectionInfo.SetDefaultPort();
if (string.IsNullOrEmpty(connectionInfo.Panel))
connectionInfo.Panel = Language.strGeneral;
connectionInfo.IsQuickConnect = true;
var connectionInitiator = new ConnectionInitiator();
connectionInitiator.OpenConnection(connectionInfo, ConnectionInfo.Force.DoNotJump);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -12,7 +12,7 @@ The application is released under the GPLv2_ and is being managed on GitHub_.
As of now mRemoteNG supports the following protocols: As of now mRemoteNG supports the following protocols:
RDP - SSH - VNC - ICA - Telnet - RAW - RLogin - HTTP/S - PowerShell RDP - SSH - VNC - ICA - Telnet - RAW - RLogin - HTTP/S
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2

View File

@@ -110,7 +110,7 @@ This will allow you to connect to a specific COM serial port using PuTTY.
Create a new connection entry with the following information: Create a new connection entry with the following information:
- Name: Serial COM**X** - Name: Serial COM***X***
- Protocol: Ext. App - Protocol: Ext. App
- External Tool: COM Serial Port - External Tool: COM Serial Port
- Port: your desired COM port # here - Port: your desired COM port # here
@@ -122,3 +122,11 @@ Windows PowerShell is a task-based command-line shell and scripting language des
- Filename: %WINDIR%\\system32\\WindowsPowerShell\\v1.0\\PowerShell_ISE.exe - Filename: %WINDIR%\\system32\\WindowsPowerShell\\v1.0\\PowerShell_ISE.exe
- Arguments: args here - Arguments: args here
- Can integrate: Yes - Can integrate: Yes
PowerShell, Enter-PSSession
===========================
This will allow you to right-click a Windows connection entry and use the hostname and user/password entry to begin a remote PowerShell session.
- Filename: %WINDIR%\\system32\\WindowsPowerShell\\v1.0\\PowerShell.exe
- Arguments: -NoExit -Command "$password = ConvertTo-SecureString '%PASSWORD%' -AsPlainText -Force; $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @('%Domain%\\%Username%', $password); Enter-PSSession -ComputerName %Hostname% -Credential $cred"
- Can integrate: No

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -15,7 +15,7 @@ GO
CREATE TABLE [dbo].[tblCons] ( CREATE TABLE [dbo].[tblCons] (
ID int NOT NULL IDENTITY(1,1), ID int NOT NULL IDENTITY(1,1),
ConstantID varchar(128) NOT NULL PRIMARY KEY, ConstantID varchar(128),
PositionID int NOT NULL, PositionID int NOT NULL,
ParentID varchar(128), ParentID varchar(128),
LastChange datetime NOT NULL, LastChange datetime NOT NULL,
@@ -140,12 +140,9 @@ CREATE TABLE [dbo].[tblCons] (
InheritRdpVersion bit DEFAULT ((0)) NOT NULL, InheritRdpVersion bit DEFAULT ((0)) NOT NULL,
VmId varchar(100), VmId varchar(100),
UseVmId bit, UseVmId bit,
UseEnhancedMode bit DEFAULT ((0)), InheritVmId bit,
InheritVmId bit , InheritUseVmId bit
InheritUseVmId bit, ) GO
InheritUseEnhancedMode bit DEFAULT ((0))
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tblRoot] ( CREATE TABLE [dbo].[tblRoot] (
[Name] [varchar] (2048) NOT NULL , [Name] [varchar] (2048) NOT NULL ,

View File

@@ -18,7 +18,7 @@ DROP TABLE IF EXISTS `tblCons`;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tblCons` ( CREATE TABLE `tblCons` (
`ID` int(11) NOT NULL AUTO_INCREMENT, `ID` int(11) NOT NULL AUTO_INCREMENT,
`ConstantID` varchar(128) NOT NULL, `ConstantID` varchar(128) DEFAULT NULL,
`PositionID` int(11) NOT NULL, `PositionID` int(11) NOT NULL,
`ParentID` varchar(128) DEFAULT NULL, `ParentID` varchar(128) DEFAULT NULL,
`LastChange` datetime NOT NULL, `LastChange` datetime NOT NULL,
@@ -143,12 +143,9 @@ CREATE TABLE `tblCons` (
`InheritRdpVersion` tinyint(1) NOT NULL DEFAULT 0, `InheritRdpVersion` tinyint(1) NOT NULL DEFAULT 0,
`VmId` varchar(512) DEFAULT NULL, `VmId` varchar(512) DEFAULT NULL,
`UseVmId` tinyint(1) DEFAULT NULL, `UseVmId` tinyint(1) DEFAULT NULL,
`UseEnhancedMode` tinyint(1) DEFAULT NULL,
`InheritVmId` tinyint(1) DEFAULT NULL, `InheritVmId` tinyint(1) DEFAULT NULL,
`InheritUseVmId` tinyint(1) DEFAULT NULL, `InheritUseVmId` tinyint(1) DEFAULT NULL,
`InheritUseEnhancedMode` tinyint(1) DEFAULT NULL, PRIMARY KEY (`ID`)
PRIMARY KEY (`ConstantID`),
UNIQUE (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3324 DEFAULT CHARSET=latin1; ) ENGINE=InnoDB AUTO_INCREMENT=3324 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;

View File

@@ -11,7 +11,6 @@ User Interface
user_interface/panels.rst user_interface/panels.rst
user_interface/menus.rst user_interface/menus.rst
user_interface/connections.rst user_interface/connections.rst
user_interface/default_connection_properties.rst
user_interface/quick_connect.rst user_interface/quick_connect.rst
user_interface/port_scan.rst user_interface/port_scan.rst
user_interface/screenshot_manager.rst user_interface/screenshot_manager.rst

View File

@@ -1,34 +0,0 @@
*****************************
Default Connection Properties
*****************************
Default connection properties are a template that is applied when creating new connections. You can set both property values and inheritance settings that will be set in new connections.
.. note::
Currently, default connection properties are saved within the user settings of mRemoteNG and not with the connection file. Sharing a connection file between multiple machines will not share default connection properties.
How it is used
==============
New Folders/Connections
-----------------------
When a new folder or connection is created, all default properties and default inheritance are applied to it.
.. note::
Changing default properties does not affect existing connections. The default values are only applied when the connection is first created.
Quick Connections
-----------------
Default connection properties are also used when establishing quick connections. See :doc:`quick_connect` for more details.
How to set them
===============
You can set default properties and inheritance by going to the Connection Tree and clicking the appropriate button for the default settings you would like to change.
.. figure:: /images/default_properties.png
- **Red** - Default connection properties
- **Green** - Default connection inheritance

View File

@@ -162,3 +162,37 @@ To disable both argument splitting and shell metacharacter escaping for a variab
For example, %!USERFIELD%. This is not recommended and may cause unexpected results. For example, %!USERFIELD%. This is not recommended and may cause unexpected results.
Only variables that have been expanded will be escaped. It is up to you to escape the rest of the arguments. Only variables that have been expanded will be escaped. It is up to you to escape the rest of the arguments.
Variable Examples
=================
+-------------------+----------------+------------------------+
| Arguments | User Field | Result |
+===================+================+========================+
| %USERFIELD% | "Example" Text | |
+-------------------+----------------+------------------------+
| %-USERFIELD% | "Example" Text | |
+-------------------+----------------+------------------------+
| %!USERFIELD% | "Example" Text | |
+-------------------+----------------+------------------------+
| ^%USERFIELD^% | "Example" Text | |
+-------------------+----------------+------------------------+
| ^^%USERFIELD^^% | "Example" Text | |
+-------------------+----------------+------------------------+
| -d "%USERFIELD%" | c:\\Example\\ | |
+-------------------+----------------+------------------------+
| -d "%-USERFIELD%" | c:\\Example\\ | |
+-------------------+----------------+------------------------+
| -d "%USERFIELD%" | Left & Right | |
+-------------------+----------------+------------------------+
| -d "%!USERFIELD%" | Left & Right | |
+-------------------+----------------+------------------------+
| %WINDIR% | N/A | |
+-------------------+----------------+------------------------+
| \\%WINDIR\\% | N/A | |
+-------------------+----------------+------------------------+
| \\^%WINDIR\\^% | N/A | |
+-------------------+----------------+------------------------+
| \\%WINDIR\\% | N/A | |
+-------------------+----------------+------------------------+

View File

@@ -23,14 +23,4 @@ Select the appropriate network protocol by clicking the arrow next to the Connec
.. figure:: /images/quick_connect_03.png .. figure:: /images/quick_connect_03.png
If you wish to use an existing connection, select the globe icon next to the protocol button and select the appropriate connection. If you wish to use an existing connection, select the globe icon next to the protocol button and select the appropriate connection.
Configuration
=============
Quick connections take most of their configuration from the :doc:`default_connection_properties`.
All default properties are used `except` for:
- Hostname
- Protocol
- Port (the default port for the selected protocol is used)

Some files were not shown because too many files have changed in this diff Show More