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):
## Types of changes
<!--- What types of changes does your code introduce? -->
<!--- Uncomment the line(s) that apply(s) to you pull request -->
<!--- - Bug fix (non-breaking change which fixes an issue) -->
<!--- - New feature (non-breaking change which adds functionality) -->
<!--- - Breaking change (fix or feature that would cause existing functionality to change) -->
<!--- - Updated translation -->
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Updated translation
## 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! -->
- [ ] I have read the **CONTRIBUTING** document.
- [ ] My code follows the code style of this project.
- [ ] All Tests within VisualStudio are passing
- [ ] This pull request does not target the master branch.
- [ ] I have updated the changelog file accordingly, if necessary.
- [ ] I have updated the documentation accordingly, if necessary.
- [ ] I have updated the changelog file accordingly.
- [ ] 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]
### 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
- #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
- #1385: Added option to start mRemoteNG minimized
- #826: Allow selecting RDP version to use when connecting
### Changed
- #1544: Improved Polish translations
- #1518: Inheritance is no longer automatically enabled when importing nodes from Active Directory
- #1468: Improved mRemoteNG startup time
- #1443: Chinese (simplified) 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
- #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.
- Removed the "Automatically get session info" from the advanced options screen since it is no longer used.
### 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
- #1439: Searching in hosts tree loses first keystroke
- #1428: Fixed a rare error when checking for FIPS

View File

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

View File

@@ -109,6 +109,18 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Portable|x86' ">
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
</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>
<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.
@@ -123,16 +135,4 @@ set /p buildenv=&lt;buildenv.tmp
:: 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>
</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>

View File

@@ -2,7 +2,7 @@ node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
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 testResultFilePrefix = "TestResult"
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) |
| 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.

View File

@@ -17,7 +17,7 @@
</dependentAssembly>
<dependentAssembly>
<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>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -25,16 +25,12 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.2.0" newVersion="3.9.2.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" />
<bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
</configuration>

View File

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

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<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\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.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\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')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mRemoteNG.Specs</RootNamespace>
<AssemblyName>mRemoteNG.Specs</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
@@ -51,11 +51,11 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
<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.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<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>
@@ -67,10 +67,10 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<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 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 Include="Utf8Json, Version=1.3.7.0, Culture=neutral, PublicKeyToken=8a73d3ba7e392e27, processorArchitecture=MSIL">
<HintPath>..\packages\Utf8Json.1.3.7\lib\net45\Utf8Json.dll</HintPath>
@@ -120,12 +120,12 @@
<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>
</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\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.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.225\build\SpecFlow.NUnit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.225\build\SpecFlow.NUnit.targets'))" />
<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.224\build\SpecFlow.NUnit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.NUnit.3.0.224\build\SpecFlow.NUnit.targets'))" />
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -9,17 +9,17 @@
<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.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.Runners" version="3.10.0" targetFramework="net46" />
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net472" />
<package id="SpecFlow" version="3.0.225" targetFramework="net472" />
<package id="SpecFlow.NUnit" version="3.0.225" targetFramework="net472" />
<package id="SpecFlow.NUnit.Runners" version="3.0.225" targetFramework="net472" />
<package id="System.Reflection.Emit" version="4.6.0" targetFramework="net472" />
<package id="System.Reflection.Emit.Lightweight" version="4.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net46" requireReinstallation="true" />
<package id="Utf8Json" version="1.3.7" targetFramework="net46" requireReinstallation="true" />
<package id="NUnit3TestAdapter" version="3.13.0" targetFramework="net46" />
<package id="SpecFlow" version="3.0.224" targetFramework="net46" />
<package id="SpecFlow.NUnit" version="3.0.224" targetFramework="net46" />
<package id="SpecFlow.NUnit.Runners" version="3.0.224" targetFramework="net46" />
<package id="System.Reflection.Emit" version="4.3.0" targetFramework="net46" />
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net46" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net46" />
<package id="Utf8Json" version="1.3.7" targetFramework="net46" />
</packages>

View File

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

View File

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

View File

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

View File

@@ -1,11 +1,15 @@
using System.Linq;
using System.Security;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.MsSql;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Security;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using mRemoteNGTests.TestHelpers;
using NSubstitute;
using NUnit.Framework;
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.Protocol;
using mRemoteNG.Tools;
@@ -11,7 +12,7 @@ namespace mRemoteNGTests.Connection.Protocol
{
public class IntegratedProgramTests
{
private readonly ExternalTool _extTool = new ExternalTool
private readonly ExternalTool _extTool = new ExternalTool(new ConnectionInitiator(new ProtocolFactory()))
{
DisplayName = "notepad",
FileName = @"%windir%\system32\notepad.exe",
@@ -49,7 +50,7 @@ namespace mRemoteNGTests.Connection.Protocol
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};
return new InterfaceControl(connectionWindow, sut, connectionInfo);
}

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 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.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class 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>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
///&lt;!-- ****************************************************************--&gt;
@@ -481,48 +416,5 @@ namespace mRemoteNGTests.Properties {
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">
<value>..\Resources\update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</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>

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 VNCSmartSizeMode { get; set; }
public TType VNCViewOnly { get; set; }
public TType RdpVersion { get; set; }
public TType UseEnhancedMode { get; set; }
}
public TType RdpVersion { get; set; }
}
}

View File

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

View File

@@ -1,4 +1,11 @@
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;
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;
namespace mRemoteNGTests.UI.Forms
@@ -15,7 +17,7 @@ namespace mRemoteNGTests.UI.Forms
[SetUp]
public void Setup()
{
_optionsForm = new FrmOptions();
_optionsForm = new FrmOptions(new ConnectionInitiator(new ProtocolFactory()));
_optionsForm.Show();
}

View File

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

View File

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

View File

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

View File

@@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<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>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
@@ -16,12 +16,8 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.9.2.0" newVersion="3.9.2.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" />
<bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
</dependentAssembly>
</assemblyBinding>
</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"?>
<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\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.13.0\build\net35\NUnit3TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>mRemoteNGTests</RootNamespace>
<AssemblyName>mRemoteNGTests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -71,7 +70,7 @@
</Reference>
<Reference Include="Microsoft.CSharp" />
<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 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>
@@ -87,11 +86,11 @@
<Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
<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.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
@@ -123,7 +122,6 @@
<Compile Include="Config\DataProviders\FileBackupCreatorTests.cs" />
<Compile Include="Config\DataProviders\FileDataProviderTests.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\DataTableDeserializerTests.cs" />
<Compile Include="Config\CredentialHarvesterTests.cs" />
@@ -255,10 +253,6 @@
</ItemGroup>
<ItemGroup>
<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>
<EmbeddedResource Include="Properties\Resources.resx">
@@ -278,7 +272,6 @@
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\confCons_v2_5.xml" />
<None Include="Resources\telnet.rdm" />
<None Include="Resources\test_puttyConnectionManager_database.dat" />
<None Include="Resources\test_rdcman_badVersionNumber.rdg" />
<None Include="Resources\test_rdcman_noversion.rdg" />
@@ -349,9 +342,8 @@
<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>
</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\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>
<!-- 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.

View File

@@ -4,19 +4,19 @@
<package id="Castle.Core" version="4.4.0" targetFramework="net46" />
<package id="DockPanelSuite" version="3.0.6" 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.Console" 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.NUnitV2Driver" version="3.7.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="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="OpenCover" version="4.7.922" targetFramework="net46" />
<package id="ReportGenerator" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
<package id="ReportGenerator" version="3.0.2" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net46" />
</packages>

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
@@ -23,12 +23,11 @@ namespace mRemoteNG.App
openFileDialog.Multiselect = true;
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.strFiltermRemoteCSV, "*.csv"});
fileTypes.AddRange(new[] {Language.strFilterRDP, "*.rdp"});
fileTypes.AddRange(new[] {Language.strFilterRdgFiles, "*.rdg"});
fileTypes.AddRange(new[] {Language.RemoteDesktopManagerFiles, "*.rdm"});
fileTypes.AddRange(new[] {Language.strFilterPuttyConnectionManager, "*.dat"});
fileTypes.AddRange(new[] {Language.strFilterAll, "*.*"});
@@ -126,8 +125,6 @@ namespace mRemoteNG.App
return new RemoteDesktopConnectionManagerImporter();
case ".dat":
return new PuttyConnectionManagerImporter();
case ".rdm":
return new RemoteDesktopManagerImporter();
default:
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.Connection;
using mRemoteNG.Credential;

View File

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

View File

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

View File

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

View File

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

View File

@@ -44,31 +44,12 @@ namespace mRemoteNG.Config.DataProviders
OpenConnection();
if (DatabaseConnector.GetType() == typeof(MSSqlDatabaseConnector))
{
SqlConnection sqlConnection = (SqlConnection)DatabaseConnector.DbConnection();
using (SqlTransaction transaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.Serializable))
using (var sqlBulkCopy = new SqlBulkCopy((SqlConnection)DatabaseConnector.DbConnection()))
{
using (SqlCommand sqlCommand = new SqlCommand())
{
sqlCommand.Connection = sqlConnection;
sqlCommand.Transaction = transaction;
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();
}
}
foreach (DataColumn col in dataTable.Columns)
sqlBulkCopy.ColumnMappings.Add(col.ColumnName, col.ColumnName);
sqlBulkCopy.DestinationTableName = "dbo.tblCons";
sqlBulkCopy.WriteToServer(dataTable);
}
}

View File

@@ -1,7 +1,8 @@
using System.IO;
using System.IO;
using System.Linq;
using mRemoteNG.App;
using mRemoteNG.Config.DataProviders;
using mRemoteNG.Config.Serializers;
using mRemoteNG.Config.Serializers.Xml;
using mRemoteNG.Container;
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;
}
if (headers.Contains("UseEnhancedMode"))
{
bool value;
if (bool.TryParse(connectionCsv[headers.IndexOf("UseEnhancedMode")], out value))
connectionRecord.UseEnhancedMode = value;
}
if (headers.Contains("RenderingEngine"))
{
HTTPBase.RenderingEngine value;
@@ -571,13 +564,6 @@ namespace mRemoteNG.Config.Serializers.Csv
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"))
{
bool value;

View File

@@ -56,7 +56,7 @@ namespace mRemoteNG.Config.Serializers.Csv
if (_saveFilter.SaveDomain)
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;" +
"CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectClipboard;RedirectSmartCards;RedirectSound;RedirectKeys;" +
"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;" +
"InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;" +
"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;" +
"InheritFavorite;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;" +
"InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;" +
@@ -116,14 +116,13 @@ namespace mRemoteNG.Config.Serializers.Csv
sb.Append(FormatForCsv(con.Domain));
sb.Append(FormatForCsv(con.Hostname))
.Append(FormatForCsv(con.Port))
.Append(FormatForCsv(con.VmId))
.Append(FormatForCsv(con.Protocol))
.Append(FormatForCsv(con.PuttySession))
.Append(FormatForCsv(con.Port))
.Append(FormatForCsv(con.UseConsoleSession))
.Append(FormatForCsv(con.UseCredSsp))
.Append(FormatForCsv(con.UseVmId))
.Append(FormatForCsv(con.UseEnhancedMode))
.Append(FormatForCsv(con.RenderingEngine))
.Append(FormatForCsv(con.ICAEncryptionStrength))
.Append(FormatForCsv(con.RDPAuthenticationLevel))
@@ -199,7 +198,6 @@ namespace mRemoteNG.Config.Serializers.Csv
.Append(FormatForCsv(con.Inheritance.UseConsoleSession))
.Append(FormatForCsv(con.Inheritance.UseCredSsp))
.Append(FormatForCsv(con.Inheritance.UseVmId))
.Append(FormatForCsv(con.Inheritance.UseEnhancedMode))
.Append(FormatForCsv(con.Inheritance.VmId))
.Append(FormatForCsv(con.Inheritance.RenderingEngine))
.Append(FormatForCsv(con.Inheritance.Username))

View File

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

View File

@@ -5,7 +5,6 @@ using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security;
@@ -14,17 +13,14 @@ namespace mRemoteNG.Config.Serializers.MsSql
{
public class DataTableSerializer : ISerializer<ConnectionInfo, DataTable>
{
public readonly int DELETE = 0;
private readonly ICryptographyProvider _cryptographyProvider;
private readonly SecureString _encryptionKey;
private DataTable _dataTable;
private DataTable _sourceDataTable;
private Dictionary<string, int> sourcePrimaryKeyDict = new Dictionary<string, int>();
private const string TableName = "tblCons";
private readonly SaveFilter _saveFilter;
private int _currentNodeIndex;
public Version Version { get; } = new Version(2, 8);
public Version Version { get; } = new Version(2, 7);
public DataTableSerializer(SaveFilter saveFilter,
ICryptographyProvider cryptographyProvider,
@@ -35,11 +31,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
_encryptionKey = encryptionKey.ThrowIfNull(nameof(encryptionKey));
}
public void SetSourceDataTable(DataTable sourceDataTable)
{
_sourceDataTable = sourceDataTable;
}
public DataTable Serialize(ConnectionTreeModel connectionTreeModel)
{
@@ -60,33 +51,15 @@ namespace mRemoteNG.Config.Serializers.MsSql
{
_dataTable = BuildTable();
_currentNodeIndex = 0;
// Register add or update row
SerializeNodesRecursive(serializationTarget);
var entryToDelete = sourcePrimaryKeyDict.Keys.ToList();
foreach( var entry in entryToDelete)
{
_dataTable.Rows.Find(entry).Delete();
}
return _dataTable;
}
private DataTable BuildTable()
{
DataTable dataTable;
if (_sourceDataTable != null)
{
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);
}
var dataTable = new DataTable(TableName);
CreateSchema(dataTable);
SetPrimaryKey(dataTable);
return dataTable;
}
@@ -218,14 +191,10 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataTable.Columns.Add("InheritSoundQuality", typeof(bool));
dataTable.Columns.Add("VmId", typeof(string));
dataTable.Columns.Add("UseVmId", typeof(bool));
dataTable.Columns.Add("UseEnhancedMode", typeof(bool));
dataTable.Columns.Add("InheritVmId", typeof(bool));
dataTable.Columns.Add("InheritUseVmId", typeof(bool));
dataTable.Columns.Add("InheritUseEnhancedMode", typeof(bool));
dataTable.Columns.Add("RdpVersion", typeof(string));
dataTable.Columns.Add("InheritRdpVersion", typeof(bool));
dataTable.Columns.Add("EnhancedMode", typeof(bool));
dataTable.Columns.Add("InheritEnhancedMode", typeof(bool));
}
private void SetPrimaryKey(DataTable dataTable)
@@ -243,244 +212,14 @@ namespace mRemoteNG.Config.Serializers.MsSql
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)
{
_currentNodeIndex++;
var isNewRow = false;
DataRow dataRow = _dataTable.Rows.Find(connectionInfo.ConstantID);
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;
}
var dataRow = _dataTable.NewRow();
dataRow["ID"] = DBNull.Value;
dataRow["Name"] = connectionInfo.Name;
dataRow["Type"] = connectionInfo.GetTreeNodeType().ToString();
dataRow["ConstantID"] = connectionInfo.ConstantID;
dataRow["ParentID"] = connectionInfo.Parent?.ConstantID ?? "";
dataRow["PositionID"] = _currentNodeIndex;
dataRow["LastChange"] = MiscTools.DBTimeStampNow();
@@ -502,7 +241,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["ConnectToConsole"] = connectionInfo.UseConsoleSession;
dataRow["UseCredSsp"] = connectionInfo.UseCredSsp;
dataRow["UseVmId"] = connectionInfo.UseVmId;
dataRow["UseEnhancedMode"] = connectionInfo.UseEnhancedMode;
dataRow["RenderingEngine"] = connectionInfo.RenderingEngine;
dataRow["ICAEncryptionStrength"] = connectionInfo.ICAEncryptionStrength;
dataRow["RDPAuthenticationLevel"] = connectionInfo.RDPAuthenticationLevel;
@@ -586,7 +324,6 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritUsername"] = connectionInfo.Inheritance.Username;
dataRow["InheritVmId"] = connectionInfo.Inheritance.VmId;
dataRow["InheritUseVmId"] = connectionInfo.Inheritance.UseVmId;
dataRow["InheritUseEnhancedMode"] = connectionInfo.Inheritance.UseEnhancedMode;
dataRow["InheritICAEncryptionStrength"] = connectionInfo.Inheritance.ICAEncryptionStrength;
dataRow["InheritRDPAuthenticationLevel"] = connectionInfo.Inheritance.RDPAuthenticationLevel;
dataRow["InheritRDPMinutesToIdleTimeout"] = connectionInfo.Inheritance.RDPMinutesToIdleTimeout;
@@ -676,7 +413,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
dataRow["InheritRDGatewayDomain"] = false;
dataRow["InheritRdpVersion"] = false;
}
if (isNewRow)_dataTable.Rows.Add(dataRow);
_dataTable.Rows.Add(dataRow);
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Security;
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("VmId", connectionInfo.VmId));
element.Add(new XAttribute("UseVmId", connectionInfo.UseVmId));
element.Add(new XAttribute("UseEnhancedMode", connectionInfo.UseVmId));
element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString()));
if (nodeAsContainer != null)
element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString().ToLowerInvariant()));
@@ -297,8 +296,6 @@ namespace mRemoteNG.Config.Serializers.Xml
connectionInfo.Inheritance.VmId.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritUseVmId",
connectionInfo.Inheritance.UseVmId.ToString().ToLowerInvariant()));
element.Add(new XAttribute("InheritUseEnhancedMode",
connectionInfo.Inheritance.UseEnhancedMode.ToString().ToLowerInvariant()));
}
else
{

View File

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

View File

@@ -1,6 +1,5 @@
using System;
using System.Xml;
using System.Xml.Linq;
namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
{
@@ -45,45 +44,5 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml
? valueAsEnum
: 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)
{
Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.",
ex);
Runtime.MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", ex);
}
}
@@ -98,8 +97,6 @@ namespace mRemoteNG.Config.Serializers
Description = description,
Protocol = ProtocolType.RDP
};
newConnectionInfo.Inheritance.TurnOnInheritanceCompletely();
newConnectionInfo.Inheritance.Description = false;
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 SqlVersion25To26Upgrader(_databaseConnector),
new SqlVersion26To27Upgrader(_databaseConnector),
new SqlVersion27To28Upgrader(_databaseConnector),
};
foreach (var upgrader in dbUpgraders)
@@ -49,7 +48,7 @@ namespace mRemoteNG.Config.Serializers.Versioning
}
// 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;
if (isVerified == false)

View File

@@ -29,10 +29,8 @@ ADD RedirectClipboard bit NOT NULL DEFAULT 0,
InheritRedirectClipboard bit NOT NULL DEFAULT 0,
VmId varchar NOT NULL DEFAULT 0,
UseVmId bit NOT NULL DEFAULT 0,
UseEnhancedMode bit NOT NULL DEFAULT 0,
InheritVmId bit NOT NULL DEFAULT 0,
InheritUseVmId bit NOT NULL DEFAULT 0,
InheritUseEnhancedMode bit NOT NULL DEFAULT 0;
InheritUseVmId bit NOT NULL DEFAULT 0;
UPDATE tblRoot
SET ConfVersion='2.7'";
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 System.IO;
using System.Xml;
using mRemoteNG.Connection;
using mRemoteNG.Messages;
using mRemoteNG.Tools;
using mRemoteNG.UI.Controls;
@@ -13,12 +14,14 @@ namespace mRemoteNG.Config.Settings
public class ExternalAppsLoader
{
private readonly FrmMain _mainForm;
private readonly IConnectionInitiator _connectionInitiator;
private readonly MessageCollector _messageCollector;
private readonly ExternalToolsToolStrip _externalToolsToolStrip;
public ExternalAppsLoader(FrmMain mainForm,
MessageCollector messageCollector,
ExternalToolsToolStrip externalToolsToolStrip)
ExternalToolsToolStrip externalToolsToolStrip,
IConnectionInitiator connectionInitiator)
{
if (mainForm == null)
throw new ArgumentNullException(nameof(mainForm));
@@ -30,6 +33,7 @@ namespace mRemoteNG.Config.Settings
_mainForm = mainForm;
_messageCollector = messageCollector;
_externalToolsToolStrip = externalToolsToolStrip;
_connectionInitiator = connectionInitiator;
}
@@ -71,7 +75,7 @@ namespace mRemoteNG.Config.Settings
foreach (XmlElement xEl in xDom.DocumentElement.ChildNodes)
{
var extA = new ExternalTool
var extA = new ExternalTool(_connectionInitiator)
{
DisplayName = xEl.Attributes["DisplayName"].Value,
FileName = xEl.Attributes["FileName"].Value,

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,10 +16,15 @@ namespace mRemoteNG.Connection
{
public class ConnectionInitiator : IConnectionInitiator
{
private readonly PanelAdder _panelAdder = new PanelAdder();
private readonly List<string> _activeConnections = new List<string>();
private readonly ProtocolFactory _protocolFactory;
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)
{
@@ -32,6 +37,8 @@ namespace mRemoteNG.Connection
return true;
}
public void OpenConnection(
ContainerInfo containerInfo,
ConnectionInfo.Force force = ConnectionInfo.Force.None,
@@ -74,8 +81,7 @@ namespace mRemoteNG.Connection
return;
}
var protocolFactory = new ProtocolFactory();
var newProtocol = protocolFactory.CreateProtocol(connectionInfo);
var newProtocol = _protocolFactory.CreateProtocol(connectionInfo);
var connectionPanel = SetConnectionPanel(connectionInfo, force);
if (string.IsNullOrEmpty(connectionPanel)) return;
@@ -93,6 +99,7 @@ namespace mRemoteNG.Connection
return;
}
OnConnectionStarting(newProtocol.InterfaceControl.Info, newProtocol);
if (newProtocol.Connect() == false)
{
newProtocol.Close();
@@ -100,7 +107,7 @@ namespace mRemoteNG.Connection
}
connectionInfo.OpenConnections.Add(newProtocol);
_activeConnections.Add(connectionInfo.ConstantID);
_activeConnections.Add(newProtocol);
FrmMain.Default.SelectedConnection = connectionInfo;
}
catch (Exception ex)
@@ -140,14 +147,14 @@ namespace mRemoteNG.Connection
return null;
}
private static string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
private string SetConnectionPanel(ConnectionInfo connectionInfo, ConnectionInfo.Force force)
{
if (connectionInfo.Panel != "" &&
!force.HasFlag(ConnectionInfo.Force.OverridePanel) &&
!Settings.Default.AlwaysShowPanelSelectionDlg)
return connectionInfo.Panel;
var frmPnl = new FrmChoosePanel();
var frmPnl = new FrmChoosePanel(this);
return frmPnl.ShowDialog() == DialogResult.OK
? frmPnl.Panel
: null;
@@ -158,7 +165,7 @@ namespace mRemoteNG.Connection
var connectionForm = conForm ?? Runtime.WindowList.FromString(connectionPanel) as ConnectionWindow;
if (connectionForm == null)
connectionForm = _panelAdder.AddPanel(connectionPanel);
connectionForm = new PanelAdder(this).AddPanel(connectionPanel);
else
connectionForm.Show(FrmMain.Default.pnlDock);
@@ -222,11 +229,11 @@ namespace mRemoteNG.Connection
}
Runtime.MessageCollector.AddMessage(msgClass,
string.Format(
Language.strProtocolEventDisconnected,
disconnectedMessage,
prot.InterfaceControl.Info.Hostname,
prot.InterfaceControl.Info.Protocol.ToString()));
string.Format(
Language.strProtocolEventDisconnected,
disconnectedMessage,
prot.InterfaceControl.Info.Hostname,
prot.InterfaceControl.Info.Protocol.ToString()));
}
catch (Exception ex)
{
@@ -255,8 +262,8 @@ namespace mRemoteNG.Connection
prot.InterfaceControl.Info.Protocol,
Environment.UserName));
prot.InterfaceControl.Info.OpenConnections.Remove(prot);
if (_activeConnections.Contains(prot.InterfaceControl.Info.ConstantID))
_activeConnections.Remove(prot.InterfaceControl.Info.ConstantID);
if (_activeConnections.Contains(prot))
_activeConnections.Remove(prot);
if (prot.InterfaceControl.Info.PostExtApp == "") return;
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;
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, Language.strConnectionEventConnected,
@@ -296,10 +303,16 @@ namespace mRemoteNG.Connection
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace(Language.ConnectionFailed, ex);
Runtime.MessageCollector.AddExceptionStackTrace(Language.strConnectionEventConnectionFailed, ex);
}
}
#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.UI.Window;
@@ -6,7 +8,7 @@ namespace mRemoteNG.Connection
{
public interface IConnectionInitiator
{
IEnumerable<string> ActiveConnections { get; }
IEnumerable<ProtocolBase> ActiveConnections { get; }
void OpenConnection(
ContainerInfo containerInfo,
@@ -19,5 +21,7 @@ namespace mRemoteNG.Connection
ConnectionWindow conForm = null);
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 System;
using System.Drawing;
@@ -25,6 +25,8 @@ namespace mRemoteNG.Connection
Location = new Point(0, 0);
Size = Parent.Size;
Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
GotFocus += OnGotFocus;
LostFocus += OnLostFocus;
InitializeComponent();
}
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)
{
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))
{
tabP.TabText = tabTitle + @" - " + shortTitle;
}
else
{
tabP.TabText = shortTitle;
}
if (!string.IsNullOrEmpty(tabTitle))
{
tabP.TabText = tabTitle + @" - " + shortTitle;
}
else
{
tabP.TabText = shortTitle;
}
}
catch (Exception ex)
{
@@ -265,14 +265,14 @@ namespace mRemoteNG.Connection.Protocol.Http
}
}
if (!string.IsNullOrEmpty(tabTitle))
{
tabP.TabText = tabTitle + @" - " + shortTitle;
}
else
{
tabP.TabText = shortTitle;
}
if (!string.IsNullOrEmpty(tabTitle))
{
tabP.TabText = tabTitle + @" - " + shortTitle;
}
else
{
tabP.TabText = shortTitle;
}
}
catch (Exception ex)
{
@@ -282,7 +282,7 @@ namespace mRemoteNG.Connection.Protocol.Http
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"))
{
objTarget.InitWithPath(tmp);
@@ -320,10 +320,10 @@ namespace mRemoteNG.Connection.Protocol.Http
public enum RenderingEngine
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttpInternetExplorer))]
[LocalizedAttributes.LocalizedDescription("strHttpInternetExplorer")]
IE = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttpGecko))]
[LocalizedAttributes.LocalizedDescription("strHttpGecko")]
Gecko = 2
}

View File

@@ -361,19 +361,19 @@ namespace mRemoteNG.Connection.Protocol.ICA
public enum EncryptionStrength
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEncBasic))]
[LocalizedAttributes.LocalizedDescription("strEncBasic")]
EncrBasic = 1,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc128BitLogonOnly))]
[LocalizedAttributes.LocalizedDescription("strEnc128BitLogonOnly")]
Encr128BitLogonOnly = 127,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc40Bit))]
[LocalizedAttributes.LocalizedDescription("strEnc40Bit")]
Encr40Bit = 40,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc56Bit))]
[LocalizedAttributes.LocalizedDescription("strEnc56Bit")]
Encr56Bit = 56,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strEnc128Bit))]
[LocalizedAttributes.LocalizedDescription("strEnc128Bit")]
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
{
public class IntegratedProgram : ProtocolBase
public class IntegratedProgram : ExternalProcessProtocolBase
{
#region Private Fields
@@ -113,7 +113,7 @@ namespace mRemoteNG.Connection.Protocol
}
catch (Exception ex)
{
Runtime.MessageCollector?.AddExceptionMessage(Language.ConnectionFailed, ex);
Runtime.MessageCollector?.AddExceptionMessage(Language.strIntAppConnectionFailed, ex);
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);
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)
{
Name = name;
@@ -333,7 +339,8 @@ namespace mRemoteNG.Connection.Protocol
private void Dispose(bool disposing)
{
if (disposing) return;
if (!disposing) return;
tmrReconnect?.Dispose();
}

View File

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

View File

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

View File

@@ -14,27 +14,22 @@ using System.Windows.Forms;
namespace mRemoteNG.Connection.Protocol
{
public class PuttyBase : ProtocolBase
public class PuttyBase : ExternalProcessProtocolBase
{
private const int IDM_RECONF = 0x50; // PuTTY Settings Menu ID
private bool _isPuttyNg;
private readonly DisplayProperties _display = new DisplayProperties();
#region Public Properties
protected Putty_Protocol PuttyProtocol { 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 bool Focused
{
get { return NativeMethods.GetForegroundWindow() == PuttyHandle; }
get { return NativeMethods.GetForegroundWindow() == ProcessHandle; }
}
#endregion
@@ -54,111 +49,40 @@ namespace mRemoteNG.Connection.Protocol
{
try
{
_isPuttyNg = PuttyTypeDetector.GetPuttyType() == PuttyTypeDetector.PuttyType.PuttyNg;
base.Connect();
var arguments = BuildPuttyCommandLineArguments(InterfaceControl.Info);
PuttyProcess = new Process
ProtocolProcess = new Process
{
StartInfo =
{
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);
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);
ProtocolProcess.Start();
ProtocolProcess.WaitForInputIdle(Settings.Default.MaxPuttyWaitTime * 1000);
var startTicks = Environment.TickCount;
while (PuttyHandle.ToInt32() == 0 &
while (ProcessHandle.ToInt32() == 0 &
Environment.TickCount < startTicks + Settings.Default.MaxPuttyWaitTime * 1000)
{
if (_isPuttyNg)
{
PuttyHandle = NativeMethods.FindWindowEx(
InterfaceControl.Handle, new IntPtr(0), null, null);
ProcessHandle = NativeMethods.FindWindowEx(InterfaceControl.Handle, new IntPtr(0), null, null);
}
else
{
PuttyProcess.Refresh();
PuttyHandle = PuttyProcess.MainWindowHandle;
ProtocolProcess.Refresh();
ProcessHandle = ProtocolProcess.MainWindowHandle;
}
if (PuttyHandle.ToInt32() == 0)
if (ProcessHandle.ToInt32() == 0)
{
Thread.Sleep(0);
}
@@ -166,44 +90,127 @@ namespace mRemoteNG.Connection.Protocol
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,
string.Format(Language.strPuttyHandle, PuttyHandle), true);
string.Format(Language.strPuttyHandle, ProcessHandle), true);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
string.Format(Language.strPuttyTitle, PuttyProcess.MainWindowTitle),
string.Format(Language.strPuttyTitle, ProtocolProcess.MainWindowTitle),
true);
Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg,
string.Format(Language.strPuttyParentHandle,
InterfaceControl.Parent.Handle), true);
Resize(this, new EventArgs());
base.Connect();
return true;
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
Language.ConnectionFailed + Environment.NewLine +
Language.strPuttyConnectionFailed + Environment.NewLine +
ex.Message);
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()
{
try
{
NativeMethods.SetForegroundWindow(PuttyHandle);
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg,
Language.strPuttyFocusFailed + Environment.NewLine + ex.Message,
true);
}
//try
//{
// if (NativeMethods.GetForegroundWindow() == PuttyHandle)
// {
// Runtime.MessageCollector.AddMessage(MessageClass.DebugMsg, $"Putty window already focused, ignoring focus request '{InterfaceControl.Info.Name}' (pid:{PuttyProcess.Id})");
// return;
// }
// 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)
@@ -216,14 +223,14 @@ namespace mRemoteNG.Connection.Protocol
if (_isPuttyNg)
{
// PuTTYNG 0.70.0.1 and later doesn't have any window borders
NativeMethods.MoveWindow(PuttyHandle, 0, 0, InterfaceControl.Width, InterfaceControl.Height, true);
NativeMethods.MoveWindow(ProcessHandle, 0, 0, InterfaceControl.Width, InterfaceControl.Height, true);
}
else
{
var scaledFrameBorderHeight = _display.ScaleHeight(SystemInformation.FrameBorderSize.Height);
var scaledFrameBorderWidth = _display.ScaleWidth(SystemInformation.FrameBorderSize.Width);
NativeMethods.MoveWindow(PuttyHandle, -scaledFrameBorderWidth,
NativeMethods.MoveWindow(ProcessHandle, -scaledFrameBorderWidth,
-(SystemInformation.CaptionHeight + scaledFrameBorderHeight),
InterfaceControl.Width + scaledFrameBorderWidth * 2,
InterfaceControl.Height + SystemInformation.CaptionHeight +
@@ -243,9 +250,9 @@ namespace mRemoteNG.Connection.Protocol
{
try
{
if (PuttyProcess.HasExited == false)
if (ProtocolProcess.HasExited == false)
{
PuttyProcess.Kill();
ProtocolProcess.Kill();
}
}
catch (Exception ex)
@@ -257,7 +264,7 @@ namespace mRemoteNG.Connection.Protocol
try
{
PuttyProcess.Dispose();
ProtocolProcess.Dispose();
}
catch (Exception ex)
{
@@ -273,8 +280,8 @@ namespace mRemoteNG.Connection.Protocol
{
try
{
NativeMethods.PostMessage(PuttyHandle, NativeMethods.WM_SYSCOMMAND, (IntPtr)IDM_RECONF, (IntPtr)0);
NativeMethods.SetForegroundWindow(PuttyHandle);
NativeMethods.PostMessage(ProcessHandle, NativeMethods.WM_SYSCOMMAND, (IntPtr)IDM_RECONF, IntPtr.Zero);
Focus();
}
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
#region Enums

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Timers;
using System.Windows.Forms;
@@ -35,6 +38,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
private readonly FrmMain _frmMain = FrmMain.Default;
protected virtual RdpVersion RdpProtocolVersion => RdpVersion.Rdc6;
private AxHost AxHost => (AxHost)Control;
private readonly NativeMethods.EnumWindowsProc _enumWindowsProc;
#region Properties
@@ -101,6 +105,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
{
_displayProperties = new DisplayProperties();
tmrReconnect.Elapsed += tmrReconnect_Elapsed;
_enumWindowsProc = LpEnumFunc;
}
#endregion
@@ -243,17 +248,54 @@ namespace mRemoteNG.Connection.Protocol.RDP
public override void Focus()
{
var result = new List<IntPtr>();
var listHandle = GCHandle.Alloc(result);
try
{
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)
{
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>
@@ -672,6 +714,9 @@ namespace mRemoteNG.Connection.Protocol.RDP
_rdpClient.OnDisconnected += RDPEvent_OnDisconnected;
_rdpClient.OnLeaveFullScreenMode += RDPEvent_OnLeaveFullscreenMode;
_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)
{
@@ -748,7 +793,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
private void RdpClient_GotFocus(object sender, EventArgs e)
{
((ConnectionTab)Control.Parent.Parent).Focus();
//((ConnectionTab)Control.Parent.Parent).Focus();
}
#endregion

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ namespace mRemoteNG.Connection.Protocol.VNC
public enum Compression
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoCompression))]
[LocalizedAttributes.LocalizedDescription("strNoCompression")]
CompNone = 99,
[Description("0")] Comp0 = 0,
[Description("1")] Comp1 = 1,
@@ -44,44 +44,44 @@ namespace mRemoteNG.Connection.Protocol.VNC
public enum AuthMode
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strVnc))]
[LocalizedAttributes.LocalizedDescription("VNC")]
AuthVNC,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strWindows))]
[LocalizedAttributes.LocalizedDescription("Windows")]
AuthWin
}
public enum ProxyType
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNone))]
[LocalizedAttributes.LocalizedDescription("strNone")]
ProxyNone,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strHttp))]
[LocalizedAttributes.LocalizedDescription("strHttp")]
ProxyHTTP,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strSocks5))]
[LocalizedAttributes.LocalizedDescription("strSocks5")]
ProxySocks5,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strUltraVncRepeater))]
[LocalizedAttributes.LocalizedDescription("strUltraVncRepeater")]
ProxyUltra
}
public enum Colors
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNormal))]
[LocalizedAttributes.LocalizedDescription("strNormal")]
ColNormal,
[Description("8-bit")] Col8Bit
}
public enum SmartSizeMode
{
[LocalizedAttributes.LocalizedDescription(nameof(Language.strNoSmartSize))]
[LocalizedAttributes.LocalizedDescription("strNoSmartSize")]
SmartSNo,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strFree))]
[LocalizedAttributes.LocalizedDescription("strFree")]
SmartSFree,
[LocalizedAttributes.LocalizedDescription(nameof(Language.strAspect))]
[LocalizedAttributes.LocalizedDescription("strAspect")]
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:
RDP - SSH - VNC - ICA - Telnet - RAW - RLogin - HTTP/S - PowerShell
RDP - SSH - VNC - ICA - Telnet - RAW - RLogin - HTTP/S
.. toctree::
: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:
- Name: Serial COM**X**
- Name: Serial COM***X***
- Protocol: Ext. App
- External Tool: COM Serial Port
- 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
- Arguments: args here
- 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] (
ID int NOT NULL IDENTITY(1,1),
ConstantID varchar(128) NOT NULL PRIMARY KEY,
ConstantID varchar(128),
PositionID int NOT NULL,
ParentID varchar(128),
LastChange datetime NOT NULL,
@@ -140,12 +140,9 @@ CREATE TABLE [dbo].[tblCons] (
InheritRdpVersion bit DEFAULT ((0)) NOT NULL,
VmId varchar(100),
UseVmId bit,
UseEnhancedMode bit DEFAULT ((0)),
InheritVmId bit ,
InheritUseVmId bit,
InheritUseEnhancedMode bit DEFAULT ((0))
) ON [PRIMARY]
GO
InheritVmId bit,
InheritUseVmId bit
) GO
CREATE TABLE [dbo].[tblRoot] (
[Name] [varchar] (2048) NOT NULL ,

View File

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

View File

@@ -11,7 +11,6 @@ User Interface
user_interface/panels.rst
user_interface/menus.rst
user_interface/connections.rst
user_interface/default_connection_properties.rst
user_interface/quick_connect.rst
user_interface/port_scan.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.
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
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)
If you wish to use an existing connection, select the globe icon next to the protocol button and select the appropriate connection.

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