mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Merge branch 'develop' of https://github.com/mRemoteNG/mRemoteNG into develop
This commit is contained in:
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
- #1476: Configurable backups. Can now edit/set backup frequency, backup path, and max number of backup files.
|
||||
- #1427: Fix RDP local desktop scale not taking effect on remote
|
||||
- #1332: Added option to hide menu strip container
|
||||
- #870: Added option to push inheritance settings to child nodes recursively
|
||||
- #545: Option to minimize to system tray on closing
|
||||
- #503: SSH Execute a single command after login
|
||||
- #420: SSH tunneling implemented
|
||||
|
||||
@@ -17,6 +17,7 @@ using mRemoteNG.Container;
|
||||
using mRemoteNG.Properties;
|
||||
using mRemoteNG.Tree;
|
||||
using mRemoteNG.Resources.Language;
|
||||
using mRemoteNG.Tree.Root;
|
||||
|
||||
|
||||
namespace mRemoteNG.Connection
|
||||
@@ -46,10 +47,10 @@ namespace mRemoteNG.Connection
|
||||
[Browsable(false)] public ContainerInfo Parent { get; internal set; }
|
||||
|
||||
[Browsable(false)]
|
||||
// ReSharper disable once UnusedAutoPropertyAccessor.Global
|
||||
public bool IsQuickConnect { get; set; }
|
||||
|
||||
[Browsable(false)] public bool PleaseConnect { get; set; }
|
||||
[Browsable(false)]
|
||||
public bool PleaseConnect { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -65,7 +66,7 @@ namespace mRemoteNG.Connection
|
||||
{
|
||||
SetTreeDisplayDefaults();
|
||||
SetConnectionDefaults();
|
||||
SetProtocolDefaults();
|
||||
SetProtocolDefaults();
|
||||
SetRemoteDesktopServicesDefaults();
|
||||
SetRdGatewayDefaults();
|
||||
SetAppearanceDefaults();
|
||||
@@ -200,7 +201,10 @@ namespace mRemoteNG.Connection
|
||||
|
||||
private bool ShouldThisPropertyBeInherited(string propertyName)
|
||||
{
|
||||
return ParentIsValidInheritanceTarget() && IsInheritanceTurnedOnForThisProperty(propertyName);
|
||||
return
|
||||
Inheritance.InheritanceActive &&
|
||||
ParentIsValidInheritanceTarget() &&
|
||||
IsInheritanceTurnedOnForThisProperty(propertyName);
|
||||
}
|
||||
|
||||
private bool ParentIsValidInheritanceTarget()
|
||||
@@ -309,10 +313,10 @@ namespace mRemoteNG.Connection
|
||||
UseCredSsp = Settings.Default.ConDefaultUseCredSsp;
|
||||
UseVmId = Settings.Default.ConDefaultUseVmId;
|
||||
UseEnhancedMode = Settings.Default.ConDefaultUseEnhancedMode;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRemoteDesktopServicesDefaults()
|
||||
{
|
||||
{
|
||||
StartProgram = string.Empty;
|
||||
StartProgramWorkDir = string.Empty;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using mRemoteNG.Resources.Language;
|
||||
|
||||
namespace mRemoteNG.Connection
|
||||
@@ -455,7 +456,16 @@ namespace mRemoteNG.Connection
|
||||
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]public bool VNCViewOnly {get; set;}
|
||||
#endregion
|
||||
|
||||
[Browsable(false)] public ConnectionInfo Parent { get; private set; }
|
||||
[Browsable(false)]
|
||||
public ConnectionInfo Parent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this inheritance object is enabled.
|
||||
/// When false, users of this object should not respect inheritance
|
||||
/// settings for individual properties.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public bool InheritanceActive => !(Parent is RootNodeInfo || Parent?.Parent is RootNodeInfo);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -472,7 +482,6 @@ namespace mRemoteNG.Connection
|
||||
{
|
||||
var newInheritance = (ConnectionInfoInheritance)MemberwiseClone();
|
||||
newInheritance.Parent = parent;
|
||||
newInheritance._tempInheritanceStorage = null;
|
||||
return newInheritance;
|
||||
}
|
||||
|
||||
@@ -530,15 +539,22 @@ namespace mRemoteNG.Connection
|
||||
/// <returns></returns>
|
||||
public IEnumerable<string> GetEnabledInheritanceProperties()
|
||||
{
|
||||
return GetProperties()
|
||||
.Where(property => (bool)property.GetValue(this))
|
||||
.Select(property => property.Name)
|
||||
.ToList();
|
||||
return InheritanceActive
|
||||
? GetProperties()
|
||||
.Where(property => (bool)property.GetValue(this))
|
||||
.Select(property => property.Name)
|
||||
.ToList()
|
||||
: Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
private bool FilterProperty(PropertyInfo propertyInfo)
|
||||
{
|
||||
var exclusions = new[] {"EverythingInherited", "Parent"};
|
||||
var exclusions = new[]
|
||||
{
|
||||
nameof(EverythingInherited),
|
||||
nameof(Parent),
|
||||
nameof(InheritanceActive)
|
||||
};
|
||||
var valueShouldNotBeFiltered = !exclusions.Contains(propertyInfo.Name);
|
||||
return valueShouldNotBeFiltered;
|
||||
}
|
||||
|
||||
@@ -263,6 +263,34 @@ namespace mRemoteNG.Container
|
||||
return childList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the connection properties of this container to all
|
||||
/// children recursively.
|
||||
/// </summary>
|
||||
public void ApplyConnectionPropertiesToChildren()
|
||||
{
|
||||
var children = GetRecursiveChildList();
|
||||
|
||||
foreach (var child in children)
|
||||
{
|
||||
child.CopyFrom(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the inheritance settings of this container to all
|
||||
/// children recursively.
|
||||
/// </summary>
|
||||
public void ApplyInheritancePropertiesToChildren()
|
||||
{
|
||||
var children = GetRecursiveChildList();
|
||||
|
||||
foreach (var child in children)
|
||||
{
|
||||
child.Inheritance = Inheritance.Clone(child);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<ConnectionInfo> GetRecursiveFavoritChildList(ContainerInfo container)
|
||||
{
|
||||
var childList = new List<ConnectionInfo>();
|
||||
|
||||
12656
mRemoteNG/Language/Language.Designer.cs
generated
12656
mRemoteNG/Language/Language.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -2025,4 +2025,10 @@ Nightly umfasst Alphas, Betas und Release Candidates.</value>
|
||||
<data name="WebView2InitializationFailed" xml:space="preserve">
|
||||
<value>WebView2-Erstellung fehlgeschlagen</value>
|
||||
</data>
|
||||
<data name="ApplyDefaultInheritance" xml:space="preserve">
|
||||
<value>Standardvererbung anwenden</value>
|
||||
</data>
|
||||
<data name="ApplyInheritanceToChildren" xml:space="preserve">
|
||||
<value>Vererbung auf Kinder anwenden</value>
|
||||
</data>
|
||||
</root>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -69,17 +69,5 @@ namespace mRemoteNG.Tree.Root
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override void AddChildAt(ConnectionInfo newChildItem, int index)
|
||||
{
|
||||
newChildItem.Inheritance.DisableInheritance();
|
||||
base.AddChildAt(newChildItem, index);
|
||||
}
|
||||
|
||||
public override void RemoveChild(ConnectionInfo removalTarget)
|
||||
{
|
||||
removalTarget.Inheritance.EnableInheritance();
|
||||
base.RemoveChild(removalTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@ namespace mRemoteNG.UI.Controls
|
||||
private ToolStripMenuItem _cMenTreeMoveDown;
|
||||
private ToolStripMenuItem _cMenTreeToolsExternalApps;
|
||||
private ToolStripMenuItem _cMenTreeDuplicate;
|
||||
private ToolStripMenuItem _cMenInheritanceSubMenu;
|
||||
private ToolStripMenuItem _cMenTreeConnectWithOptionsChoosePanelBeforeConnecting;
|
||||
private ToolStripMenuItem _cMenTreeConnectWithOptionsDontConnectToConsoleSession;
|
||||
private ToolStripMenuItem _cMenTreeImport;
|
||||
@@ -51,6 +52,8 @@ namespace mRemoteNG.UI.Controls
|
||||
private ToolStripMenuItem _cMenTreeImportFile;
|
||||
private ToolStripMenuItem _cMenTreeImportActiveDirectory;
|
||||
private ToolStripMenuItem _cMenTreeImportPortScan;
|
||||
private ToolStripMenuItem _cMenTreeApplyInheritanceToChildren;
|
||||
private ToolStripMenuItem _cMenTreeApplyDefaultInheritance;
|
||||
private readonly ConnectionTree.ConnectionTree _connectionTree;
|
||||
private readonly IConnectionInitiator _connectionInitiator;
|
||||
|
||||
@@ -99,6 +102,9 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeImportFile = new ToolStripMenuItem();
|
||||
_cMenTreeImportActiveDirectory = new ToolStripMenuItem();
|
||||
_cMenTreeImportPortScan = new ToolStripMenuItem();
|
||||
_cMenInheritanceSubMenu = new ToolStripMenuItem();
|
||||
_cMenTreeApplyInheritanceToChildren = new ToolStripMenuItem();
|
||||
_cMenTreeApplyDefaultInheritance = new ToolStripMenuItem();
|
||||
_cMenTreeExportFile = new ToolStripMenuItem();
|
||||
_cMenTreeSep4 = new ToolStripSeparator();
|
||||
_cMenTreeAddConnection = new ToolStripMenuItem();
|
||||
@@ -129,6 +135,7 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeRename,
|
||||
_cMenTreeDelete,
|
||||
_cMenTreeCopyHostname,
|
||||
_cMenInheritanceSubMenu,
|
||||
_cMenTreeSep3,
|
||||
_cMenTreeImport,
|
||||
_cMenTreeExportFile,
|
||||
@@ -395,8 +402,34 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeMoveDown.Size = new System.Drawing.Size(199, 22);
|
||||
_cMenTreeMoveDown.Text = "Move down";
|
||||
_cMenTreeMoveDown.Click += OnMoveDownClicked;
|
||||
//
|
||||
// cMenEditSubMenu
|
||||
//
|
||||
_cMenInheritanceSubMenu.DropDownItems.AddRange(new ToolStripItem[]
|
||||
{
|
||||
_cMenTreeApplyInheritanceToChildren,
|
||||
_cMenTreeApplyDefaultInheritance
|
||||
});
|
||||
_cMenInheritanceSubMenu.Name = "_cMenInheritanceSubMenu";
|
||||
_cMenInheritanceSubMenu.Size = new System.Drawing.Size(199, 22);
|
||||
_cMenInheritanceSubMenu.Text = "Inheritance";
|
||||
//
|
||||
// _cMenTreeApplyInheritanceToChildren
|
||||
//
|
||||
_cMenTreeApplyInheritanceToChildren.Name = "_cMenTreeApplyInheritanceToChildren";
|
||||
_cMenTreeApplyInheritanceToChildren.Size = new System.Drawing.Size(199, 22);
|
||||
_cMenTreeApplyInheritanceToChildren.Text = "Apply inheritance to children";
|
||||
_cMenTreeApplyInheritanceToChildren.Click += OnApplyInheritanceToChildrenClicked;
|
||||
//
|
||||
// _cMenTreeApplyDefaultInheritance
|
||||
//
|
||||
_cMenTreeApplyDefaultInheritance.Name = "_cMenTreeApplyDefaultInheritance";
|
||||
_cMenTreeApplyDefaultInheritance.Size = new System.Drawing.Size(199, 22);
|
||||
_cMenTreeApplyDefaultInheritance.Text = "Apply default inheritance";
|
||||
_cMenTreeApplyDefaultInheritance.Click += OnApplyDefaultInheritanceClicked;
|
||||
}
|
||||
|
||||
|
||||
private void ApplyLanguage()
|
||||
{
|
||||
_cMenTreeConnect.Text = Language.Connect;
|
||||
@@ -431,6 +464,10 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeToolsSortDescending.Text = Language.SortDesc;
|
||||
_cMenTreeMoveUp.Text = Language.MoveUp;
|
||||
_cMenTreeMoveDown.Text = Language.MoveDown;
|
||||
|
||||
_cMenInheritanceSubMenu.Text = Language.Inheritance;
|
||||
_cMenTreeApplyInheritanceToChildren.Text = Language.ApplyInheritanceToChildren;
|
||||
_cMenTreeApplyDefaultInheritance.Text = Language.ApplyDefaultInheritance;
|
||||
}
|
||||
|
||||
internal void ShowHideMenuItems()
|
||||
@@ -459,6 +496,9 @@ namespace mRemoteNG.UI.Controls
|
||||
{
|
||||
ShowHideMenuItemsForConnectionNode(_connectionTree.SelectedNode);
|
||||
}
|
||||
|
||||
_cMenInheritanceSubMenu.Enabled = _cMenInheritanceSubMenu.DropDownItems
|
||||
.OfType<ToolStripMenuItem>().Any(i => i.Enabled);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -487,6 +527,9 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeMoveUp.Enabled = false;
|
||||
_cMenTreeMoveDown.Enabled = false;
|
||||
_cMenTreeConnectWithOptionsViewOnly.Enabled = false;
|
||||
_cMenTreeApplyInheritanceToChildren.Enabled = false;
|
||||
_cMenTreeApplyDefaultInheritance.Enabled = false;
|
||||
_cMenTreeCopyHostname.Enabled = false;
|
||||
}
|
||||
|
||||
internal void ShowHideMenuItemsForRootConnectionNode()
|
||||
@@ -504,6 +547,8 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeMoveUp.Enabled = false;
|
||||
_cMenTreeMoveDown.Enabled = false;
|
||||
_cMenTreeConnectWithOptionsViewOnly.Enabled = false;
|
||||
_cMenTreeApplyInheritanceToChildren.Enabled = false;
|
||||
_cMenTreeApplyDefaultInheritance.Enabled = false;
|
||||
}
|
||||
|
||||
internal void ShowHideMenuItemsForContainer(ContainerInfo containerInfo)
|
||||
@@ -540,6 +585,8 @@ namespace mRemoteNG.UI.Controls
|
||||
_cMenTreeImport.Enabled = false;
|
||||
_cMenTreeExportFile.Enabled = false;
|
||||
_cMenTreeConnectWithOptionsViewOnly.Enabled = false;
|
||||
_cMenTreeApplyInheritanceToChildren.Enabled = false;
|
||||
_cMenTreeApplyDefaultInheritance.Enabled = false;
|
||||
}
|
||||
|
||||
internal void ShowHideMenuItemsForConnectionNode(ConnectionInfo connectionInfo)
|
||||
@@ -561,6 +608,8 @@ namespace mRemoteNG.UI.Controls
|
||||
|
||||
if (connectionInfo.Protocol != ProtocolType.RDP && connectionInfo.Protocol != ProtocolType.VNC)
|
||||
_cMenTreeConnectWithOptionsViewOnly.Enabled = false;
|
||||
|
||||
_cMenTreeApplyInheritanceToChildren.Enabled = false;
|
||||
}
|
||||
|
||||
internal void DisableShortcutKeys()
|
||||
@@ -872,6 +921,22 @@ namespace mRemoteNG.UI.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private void OnApplyInheritanceToChildrenClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (!(_connectionTree.SelectedNode is ContainerInfo container))
|
||||
return;
|
||||
|
||||
container.ApplyInheritancePropertiesToChildren();
|
||||
}
|
||||
|
||||
private void OnApplyDefaultInheritanceClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (_connectionTree.SelectedNode == null)
|
||||
return;
|
||||
|
||||
DefaultConnectionInheritance.Instance.SaveTo(_connectionTree.SelectedNode.Inheritance);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -208,10 +208,8 @@ namespace mRemoteNG.UI.Window
|
||||
public bool CanShowProperties => SelectedTreeNode != null;
|
||||
|
||||
public bool InheritanceVisible => _btnShowInheritance.Checked;
|
||||
public bool CanShowInheritance => !_pGrid.RootNodeSelected &&
|
||||
SelectedTreeNode != null &&
|
||||
_pGrid.SelectedConnectionInfo?.Parent != null &&
|
||||
!(_pGrid.SelectedConnectionInfo.Parent is RootNodeInfo);
|
||||
public bool CanShowInheritance => SelectedTreeNode != null &&
|
||||
_pGrid.SelectedConnectionInfo?.Parent != null;
|
||||
|
||||
public bool DefaultPropertiesVisible => _btnShowDefaultProperties.Checked;
|
||||
public bool CanShowDefaultProperties => true;
|
||||
|
||||
@@ -1,288 +1,288 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>Icons\mRemoteNG.ico</ApplicationIcon>
|
||||
<Version>1.77.2</Version>
|
||||
<Description>Multi-protocol remote connections manager</Description>
|
||||
<Copyright>2020 mRemoteNG Dev Team, 2010-2013 Riley McArdle, 2007-2009 Felix Deimel</Copyright>
|
||||
<PackageLicenseFile>COPYING.TXT</PackageLicenseFile>
|
||||
<PackageProjectUrl>https://mremoteng.org/</PackageProjectUrl>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Debug Portable;Release Portable;Release Installer</Configurations>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DefineConstants />
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Portable|x64'">
|
||||
<DefineConstants>DEBUG;PORTABLE</DefineConstants>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Debug Portable\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Portable|x64'">
|
||||
<DefineConstants>PORTABLE</DefineConstants>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Release Portable\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="buildenv.tmp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<COMReference Include="MSTSCLib">
|
||||
<WrapperTool>aximp</WrapperTool>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<Guid>8c11efa1-92c3-11d1-bc1e-00c04fa31489</Guid>
|
||||
<Lcid>0</Lcid>
|
||||
<Isolated>false</Isolated>
|
||||
<EmbedInteropTypes>false</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Castle.Core" Version="4.4.1" />
|
||||
<PackageReference Include="ConsoleControl" Version="1.3.0" />
|
||||
<PackageReference Include="Cucumber.Messages" Version="16.0.1" />
|
||||
<PackageReference Include="DockPanelSuite" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2003" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2005" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2012" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2013" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.1.0" />
|
||||
<PackageReference Include="log4net" Version="2.0.13" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1054.31" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.27" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="ObjectListView" Version="2.7.1.5" />
|
||||
<PackageReference Include="ObjectListView.Official" Version="2.9.1" />
|
||||
<PackageReference Include="OpenCover" Version="4.7.1221" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
||||
<PackageReference Include="Renci.SshNet.Async" Version="1.4.0" />
|
||||
<PackageReference Include="ReportGenerator" Version="5.0.0" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
||||
<PackageReference Include="System.DirectoryServices" Version="6.0.0" />
|
||||
<PackageReference Include="System.Management" Version="6.0.0" />
|
||||
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
|
||||
<PackageReference Include="VncSharpCore" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Icons\Admin.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Anti Virus.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Apple.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Backup.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Build Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Console.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Database.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Domain Controller.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\ESX.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Fax.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\File Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Finance.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Firewall.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Infrastructure.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Linux.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Log.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Mail Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\mRemote.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\mRemoteNG.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\PowerShell.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Production.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\PuTTY.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\RaspberryPi.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Remote Desktop.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Router.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\SharePoint.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\SSH.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Staging.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Switch.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Tel.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Telnet.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Terminal Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Test Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Virtual Machine.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Web Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\WiFi.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Windows.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Workstation.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="mRemoteNG.VisualElementsManifest.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="PuTTYNG.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\PuTTYNG.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_5.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_6.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_7.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_credrepo_list_v1_0.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_creds_v1_0.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\darcula.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015blue.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015dark.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015light.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VisualElements_150.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VisualElements_70.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\COPYING.TXT">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="echo $(ConfigurationName) > buildenv.tmp" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command=":: 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.

powershell -noprofile -command "sleep 2"

set /p buildenv=<buildenv.tmp

:: Manual builds, set the cert password and uncomment below.
:: IF "%25APPVEYOR_BUILD_FOLDER"=="" ( set cert_pwd= )

:: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_mremoteng.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "$(TargetDir)\" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ExternalConnectors\ExternalConnectors.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="chromiumembeddedframework.runtime.win-x64" Version="92.0.25" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="chromiumembeddedframework.runtime.win-x86" Version="92.0.25" />
|
||||
</ItemGroup>
|
||||
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>Icons\mRemoteNG.ico</ApplicationIcon>
|
||||
<Version>1.77.2</Version>
|
||||
<Description>Multi-protocol remote connections manager</Description>
|
||||
<Copyright>2020 mRemoteNG Dev Team, 2010-2013 Riley McArdle, 2007-2009 Felix Deimel</Copyright>
|
||||
<PackageLicenseFile>COPYING.TXT</PackageLicenseFile>
|
||||
<PackageProjectUrl>https://mremoteng.org/</PackageProjectUrl>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Debug Portable;Release Portable;Release Installer</Configurations>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DefineConstants />
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Portable|x64'">
|
||||
<DefineConstants>DEBUG;PORTABLE</DefineConstants>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Debug Portable\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Portable|x64'">
|
||||
<DefineConstants>PORTABLE</DefineConstants>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x64\Release Portable\</OutputPath>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="buildenv.tmp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<COMReference Include="MSTSCLib">
|
||||
<WrapperTool>aximp</WrapperTool>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<Guid>8c11efa1-92c3-11d1-bc1e-00c04fa31489</Guid>
|
||||
<Lcid>0</Lcid>
|
||||
<Isolated>false</Isolated>
|
||||
<EmbedInteropTypes>false</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Castle.Core" Version="4.4.1" />
|
||||
<PackageReference Include="ConsoleControl" Version="1.3.0" />
|
||||
<PackageReference Include="Cucumber.Messages" Version="16.0.1" />
|
||||
<PackageReference Include="DockPanelSuite" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2003" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2005" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2012" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2013" Version="3.1.0" />
|
||||
<PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.1.0" />
|
||||
<PackageReference Include="log4net" Version="2.0.13" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1054.31" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.27" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="ObjectListView" Version="2.7.1.5" />
|
||||
<PackageReference Include="ObjectListView.Official" Version="2.9.1" />
|
||||
<PackageReference Include="OpenCover" Version="4.7.1221" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
|
||||
<PackageReference Include="Renci.SshNet.Async" Version="1.4.0" />
|
||||
<PackageReference Include="ReportGenerator" Version="5.0.0" />
|
||||
<PackageReference Include="System.Data.Common" Version="4.3.0" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
|
||||
<PackageReference Include="System.DirectoryServices" Version="6.0.0" />
|
||||
<PackageReference Include="System.Management" Version="6.0.0" />
|
||||
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
|
||||
<PackageReference Include="VncSharpCore" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Icons\Admin.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Anti Virus.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Apple.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Backup.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Build Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Console.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Database.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Domain Controller.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\ESX.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Fax.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\File Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Finance.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Firewall.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Infrastructure.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Linux.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Log.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Mail Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\mRemote.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\mRemoteNG.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\PowerShell.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Production.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\PuTTY.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\RaspberryPi.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Remote Desktop.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Router.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\SharePoint.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\SSH.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Staging.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Switch.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Tel.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Telnet.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Terminal Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Test Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Virtual Machine.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Web Server.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\WiFi.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Windows.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Icons\Workstation.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="mRemoteNG.VisualElementsManifest.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="PuTTYNG.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Resources\PuTTYNG.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_5.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_6.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_confcons_v2_7.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_credrepo_list_v1_0.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Schemas\mremoteng_creds_v1_0.xsd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\darcula.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015blue.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015dark.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Themes\vs2015light.vstheme">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VisualElements_150.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VisualElements_70.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\COPYING.TXT">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="echo $(ConfigurationName) > buildenv.tmp" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command=":: 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.

powershell -noprofile -command "sleep 2"

set /p buildenv=<buildenv.tmp

:: Manual builds, set the cert password and uncomment below.
:: IF "%25APPVEYOR_BUILD_FOLDER"=="" ( set cert_pwd= )

:: Call the post build powershell script
powershell.exe -ExecutionPolicy Bypass -File "$(SolutionDir)Tools\postbuild_mremoteng.ps1" -SolutionDir "$(SolutionDir)\" -TargetDir "$(TargetDir)\" -TargetFileName "mRemoteNG.exe" -ConfigurationName "%25buildenv%25" -CertificatePath "$(CertPath)" -CertificatePassword "$(CertPassword)" -ExcludeFromSigning "PuTTYNG.exe"" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ExternalConnectors\ExternalConnectors.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="chromiumembeddedframework.runtime.win-x64" Version="92.0.25" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="chromiumembeddedframework.runtime.win-x86" Version="92.0.25" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,53 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WeifenLuo.WinFormsUI.Docking" publicKeyToken="5cded1a1a0a7b481" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.6.0" newVersion="3.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.8.6.0" newVersion="1.8.6.0" />
|
||||
</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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.12.1.0" newVersion="3.12.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="2638cd05610744eb" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.13.1.0" newVersion="3.13.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Cucumber.Messages" publicKeyToken="b10c5988214f940c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WeifenLuo.WinFormsUI.Docking" publicKeyToken="5cded1a1a0a7b481" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.6.0" newVersion="3.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.8.6.0" newVersion="1.8.6.0" />
|
||||
</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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.12.1.0" newVersion="3.12.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="2638cd05610744eb" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.13.1.0" newVersion="3.13.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Cucumber.Messages" publicKeyToken="b10c5988214f940c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
|
||||
</configuration>
|
||||
@@ -15,7 +15,7 @@ using NUnit.Framework;
|
||||
|
||||
namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
|
||||
{
|
||||
public class CsvConnectionsDeserializerMremotengFormatTests
|
||||
public class CsvConnectionsDeserializerMremotengFormatTests
|
||||
{
|
||||
private CsvConnectionsDeserializerMremotengFormat _deserializer;
|
||||
private CsvConnectionsSerializerMremotengFormat _serializer;
|
||||
@@ -168,8 +168,17 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Csv
|
||||
|
||||
public static IEnumerable InheritanceTestCases()
|
||||
{
|
||||
var testInheritance = GetTestConnectionWithAllInherited().Inheritance;
|
||||
var properties = testInheritance.GetProperties();
|
||||
var ignoreProperties = new[]
|
||||
{
|
||||
nameof(ConnectionInfoInheritance.EverythingInherited),
|
||||
nameof(ConnectionInfoInheritance.Parent),
|
||||
nameof(ConnectionInfoInheritance.EverythingInherited)
|
||||
};
|
||||
var properties = typeof(ConnectionInfoInheritance)
|
||||
.GetProperties()
|
||||
.Where(property => !ignoreProperties.Contains(property.Name));
|
||||
var testCases = new List<TestCaseData>();
|
||||
var testInheritance = GetTestConnectionWithAllInherited().Inheritance;
|
||||
|
||||
return properties
|
||||
.Select(property =>
|
||||
|
||||
@@ -1,77 +1,91 @@
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using NUnit.Framework;
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Tree.Root;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace mRemoteNGTests.Connection
|
||||
{
|
||||
[TestFixture]
|
||||
[TestFixture]
|
||||
public class ConnectionInfoInheritanceTests
|
||||
{
|
||||
private ConnectionInfo _connectionInfo;
|
||||
private ConnectionInfoInheritance _inheritance;
|
||||
private PropertyInfo[] _inheritanceProperties = typeof(ConnectionInfoInheritance).GetProperties();
|
||||
private readonly PropertyInfo[] _inheritanceProperties = typeof(ConnectionInfoInheritance).GetProperties();
|
||||
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_connectionInfo = new ConnectionInfo();
|
||||
_inheritance = new ConnectionInfoInheritance(_connectionInfo);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Teardown()
|
||||
{
|
||||
_connectionInfo = null;
|
||||
_inheritance = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Test]
|
||||
public void TurnOffInheritanceCompletely()
|
||||
{
|
||||
_inheritance.Username = true;
|
||||
_inheritance.TurnOffInheritanceCompletely();
|
||||
Assert.That(AllInheritancePropertiesAreFalse(), Is.True);
|
||||
var inheritance = new ConnectionInfoInheritance(new ConnectionInfo()) {Username = true};
|
||||
inheritance.TurnOffInheritanceCompletely();
|
||||
Assert.That(AllInheritancePropertiesAreFalse(inheritance), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TurnOnInheritanceCompletely()
|
||||
{
|
||||
_inheritance.TurnOnInheritanceCompletely();
|
||||
Assert.That(AllInheritancePropertiesAreTrue(), Is.True);
|
||||
var inheritance = new ConnectionInfoInheritance(new ConnectionInfo());
|
||||
inheritance.TurnOnInheritanceCompletely();
|
||||
Assert.That(AllInheritancePropertiesAreTrue(inheritance), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DisableInheritanceTurnsOffAllInheritance()
|
||||
public void InheritanceIsDisabledWhenAttachedToARootNode()
|
||||
{
|
||||
_inheritance.Username = true;
|
||||
_inheritance.DisableInheritance();
|
||||
Assert.That(AllInheritancePropertiesAreFalse(), Is.True);
|
||||
var inheritance = new ConnectionInfoInheritance(new RootNodeInfo(RootNodeType.Connection));
|
||||
Assert.That(inheritance.InheritanceActive, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EnableInheritanceRestoresPreviousInheritanceValues()
|
||||
public void InheritanceIsDisabledWhenAttachedToAPuttyRootNode()
|
||||
{
|
||||
_inheritance.Username = true;
|
||||
_inheritance.DisableInheritance();
|
||||
_inheritance.EnableInheritance();
|
||||
Assert.That(_inheritance.Username, Is.True);
|
||||
var inheritance = new ConnectionInfoInheritance(new RootNodeInfo(RootNodeType.PuttySessions));
|
||||
Assert.That(inheritance.InheritanceActive, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InheritanceIsDisabledWhenAttachedToAPuttyNode()
|
||||
{
|
||||
var inheritance = new ConnectionInfoInheritance(new RootPuttySessionsNodeInfo());
|
||||
Assert.That(inheritance.InheritanceActive, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InheritanceIsDisabledWhenAttachedToANodeDirectlyUnderTheRootNode()
|
||||
{
|
||||
var con = new ConnectionInfo();
|
||||
new RootNodeInfo(RootNodeType.Connection).AddChild(con);
|
||||
Assert.That(con.Inheritance.InheritanceActive, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InheritanceIsEnabledWhenAttachedToNormalConnectionInfo()
|
||||
{
|
||||
var inheritance = new ConnectionInfoInheritance(new ConnectionInfo());
|
||||
Assert.That(inheritance.InheritanceActive, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InheritanceIsEnabledWhenAttachedToNormalContainerInfo()
|
||||
{
|
||||
var inheritance = new ConnectionInfoInheritance(new ContainerInfo());
|
||||
Assert.That(inheritance.InheritanceActive, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetPropertiesReturnsListOfSettableProperties()
|
||||
{
|
||||
var hasIconProperty = _inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("Icon"));
|
||||
var inheritance = new ConnectionInfoInheritance(new ConnectionInfo());
|
||||
var hasIconProperty = inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("Icon"));
|
||||
Assert.That(hasIconProperty, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetPropertiesExludesPropertiesThatShouldNotBeSet()
|
||||
{
|
||||
var hasEverythingInheritedProperty = _inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("EverythingInherited"));
|
||||
var inheritance = new ConnectionInfoInheritance(new ConnectionInfo());
|
||||
var hasEverythingInheritedProperty = inheritance.GetProperties().Contains(typeof(ConnectionInfoInheritance).GetProperty("EverythingInherited"));
|
||||
Assert.That(hasEverythingInheritedProperty, Is.False);
|
||||
}
|
||||
|
||||
@@ -91,23 +105,25 @@ namespace mRemoteNGTests.Connection
|
||||
Assert.That(con1.AutomaticResize, Is.EqualTo(expectedSetting));
|
||||
}
|
||||
|
||||
private bool AllInheritancePropertiesAreTrue()
|
||||
private bool AllInheritancePropertiesAreTrue(ConnectionInfoInheritance inheritance)
|
||||
{
|
||||
var allPropertiesTrue = true;
|
||||
foreach (var property in _inheritanceProperties)
|
||||
{
|
||||
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) && BooleanPropertyIsSetToFalse(property))
|
||||
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) &&
|
||||
BooleanPropertyIsSetToFalse(property, inheritance))
|
||||
allPropertiesTrue = false;
|
||||
}
|
||||
return allPropertiesTrue;
|
||||
}
|
||||
|
||||
private bool AllInheritancePropertiesAreFalse()
|
||||
private bool AllInheritancePropertiesAreFalse(ConnectionInfoInheritance inheritance)
|
||||
{
|
||||
var allPropertiesFalse = true;
|
||||
foreach (var property in _inheritanceProperties)
|
||||
{
|
||||
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) && BooleanPropertyIsSetToTrue(property))
|
||||
if (PropertyIsBoolean(property) && PropertyIsChangedWhenSettingInheritAll(property) &&
|
||||
BooleanPropertyIsSetToTrue(property, inheritance))
|
||||
allPropertiesFalse = false;
|
||||
}
|
||||
return allPropertiesFalse;
|
||||
@@ -124,14 +140,14 @@ namespace mRemoteNGTests.Connection
|
||||
return (property.PropertyType.Name == typeof(bool).Name);
|
||||
}
|
||||
|
||||
private bool BooleanPropertyIsSetToFalse(PropertyInfo property)
|
||||
private bool BooleanPropertyIsSetToFalse(PropertyInfo property, ConnectionInfoInheritance inheritance)
|
||||
{
|
||||
return (bool)property.GetValue(_inheritance) == false;
|
||||
return (bool)property.GetValue(inheritance) == false;
|
||||
}
|
||||
|
||||
private bool BooleanPropertyIsSetToTrue(PropertyInfo property)
|
||||
private bool BooleanPropertyIsSetToTrue(PropertyInfo property, ConnectionInfoInheritance inheritance)
|
||||
{
|
||||
return (bool)property.GetValue(_inheritance);
|
||||
return (bool)property.GetValue(inheritance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,16 +93,6 @@ namespace mRemoteNGTests.Connection
|
||||
Assert.That(nameOfModifiedProperty, Is.EqualTo("OpenConnections"));
|
||||
}
|
||||
|
||||
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
|
||||
public void MovingAConnectionUnderRootNodeDisablesInheritance(PropertyInfo property)
|
||||
{
|
||||
var rootNode = new RootNodeInfo(RootNodeType.Connection);
|
||||
_connectionInfo.Inheritance.EverythingInherited = true;
|
||||
_connectionInfo.SetParent(rootNode);
|
||||
var propertyValue = property.GetValue(_connectionInfo.Inheritance);
|
||||
Assert.That(propertyValue, Is.False);
|
||||
}
|
||||
|
||||
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
|
||||
public void MovingAConnectionFromUnderRootNodeToUnderADifferentNodeEnablesInheritance(PropertyInfo property)
|
||||
{
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
using System.Linq;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNGTests.TestHelpers;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
||||
namespace mRemoteNGTests.Container
|
||||
{
|
||||
public class ContainerInfoTests
|
||||
public class ContainerInfoTests
|
||||
{
|
||||
private ContainerInfo _containerInfo;
|
||||
private ConnectionInfo _con1;
|
||||
@@ -434,5 +435,69 @@ namespace mRemoteNGTests.Container
|
||||
var grandchildOrderAfterSort = _containerInfo.Children.ToArray();
|
||||
Assert.That(grandchildOrderAfterSort, Is.Ordered.Descending.By(nameof(ConnectionInfo.ConstantID)));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanApplyConnectionSettingsToChildren()
|
||||
{
|
||||
var comparer = new ConnectionInfoAllConnectionPropertiesEqualityComparer();
|
||||
var container = new ContainerInfo();
|
||||
var con1 = ConnectionInfoHelpers.GetRandomizedConnectionInfo();
|
||||
var con2 = ConnectionInfoHelpers.GetRandomizedConnectionInfo();
|
||||
container.AddChild(con1);
|
||||
container.AddChild(con2);
|
||||
|
||||
container.ApplyConnectionPropertiesToChildren();
|
||||
|
||||
Assert.That(con1, Is.EqualTo(container).Using(comparer));
|
||||
Assert.That(con2, Is.EqualTo(container).Using(comparer));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ApplyConnectionPropertiesToChildrenWorksRecursively()
|
||||
{
|
||||
var comparer = new ConnectionInfoAllConnectionPropertiesEqualityComparer();
|
||||
var container = new ContainerInfo();
|
||||
var subContainer = ConnectionInfoHelpers.GetRandomizedContainerInfo();
|
||||
var con1 = ConnectionInfoHelpers.GetRandomizedConnectionInfo();
|
||||
container.AddChild(subContainer);
|
||||
subContainer.AddChild(con1);
|
||||
|
||||
container.ApplyConnectionPropertiesToChildren();
|
||||
|
||||
Assert.That(subContainer, Is.EqualTo(container).Using(comparer));
|
||||
Assert.That(con1, Is.EqualTo(container).Using(comparer));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanApplyInheritanceSettingsToChildren()
|
||||
{
|
||||
var comparer = new ConnectionInheritanceAllPropertiesEqualityComparer();
|
||||
var container = new ContainerInfo();
|
||||
var con1 = ConnectionInfoHelpers.GetRandomizedConnectionInfo(randomizeInheritance:true);
|
||||
var con2 = ConnectionInfoHelpers.GetRandomizedConnectionInfo(randomizeInheritance: true);
|
||||
container.AddChild(con1);
|
||||
container.AddChild(con2);
|
||||
|
||||
container.ApplyInheritancePropertiesToChildren();
|
||||
|
||||
Assert.That(con1.Inheritance, Is.EqualTo(container.Inheritance).Using(comparer));
|
||||
Assert.That(con2.Inheritance, Is.EqualTo(container.Inheritance).Using(comparer));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ApplyInheritancePropertiesToChildrenWorksRecursively()
|
||||
{
|
||||
var comparer = new ConnectionInheritanceAllPropertiesEqualityComparer();
|
||||
var container = new ContainerInfo();
|
||||
var subContainer = ConnectionInfoHelpers.GetRandomizedContainerInfo(randomizeInheritance: true);
|
||||
var con1 = ConnectionInfoHelpers.GetRandomizedConnectionInfo(randomizeInheritance: true);
|
||||
container.AddChild(subContainer);
|
||||
subContainer.AddChild(con1);
|
||||
|
||||
container.ApplyInheritancePropertiesToChildren();
|
||||
|
||||
Assert.That(subContainer.Inheritance, Is.EqualTo(container.Inheritance).Using(comparer));
|
||||
Assert.That(con1.Inheritance, Is.EqualTo(container.Inheritance).Using(comparer));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,23 @@ using NUnit.Framework;
|
||||
|
||||
namespace mRemoteNGTests.Container
|
||||
{
|
||||
public class RootNodeInfoTests
|
||||
public class RootNodeInfoTests
|
||||
{
|
||||
[Test]
|
||||
public void InheritanceIsDisabledForNodesDirectlyUnderRootNode()
|
||||
{
|
||||
var rootNode = new RootNodeInfo(RootNodeType.Connection);
|
||||
var con1 = new ConnectionInfo { Inheritance = { Password = true } };
|
||||
var expected = "UnInheritedValue";
|
||||
var rootNode = new RootNodeInfo(RootNodeType.Connection)
|
||||
{
|
||||
Description = "thisCameFromTheRootNode"
|
||||
};
|
||||
var con1 = new ConnectionInfo
|
||||
{
|
||||
Description = expected,
|
||||
Inheritance = { Description = true }
|
||||
};
|
||||
rootNode.AddChild(con1);
|
||||
Assert.That(con1.Inheritance.Password, Is.False);
|
||||
Assert.That(con1.Description, Is.EqualTo(expected));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
namespace mRemoteNGTests.TestHelpers
|
||||
{
|
||||
public class ConnectionInfoAllConnectionPropertiesEqualityComparer : IEqualityComparer<ConnectionInfo>
|
||||
{
|
||||
public bool Equals(ConnectionInfo x, ConnectionInfo y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
return true;
|
||||
if ((x == null) != (y == null))
|
||||
return false;
|
||||
return GetHashCode(x) == GetHashCode(y);
|
||||
}
|
||||
|
||||
public int GetHashCode(ConnectionInfo connectionInfo)
|
||||
{
|
||||
var allProperties = connectionInfo.GetSerializableProperties();
|
||||
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
return allProperties
|
||||
.Aggregate(17,
|
||||
(current, prop) => current * 23 + prop.GetValue(connectionInfo).GetHashCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
namespace mRemoteNGTests.TestHelpers
|
||||
{
|
||||
public class ConnectionInheritanceAllPropertiesEqualityComparer : IEqualityComparer<ConnectionInfoInheritance>
|
||||
{
|
||||
public bool Equals(ConnectionInfoInheritance x, ConnectionInfoInheritance y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
return true;
|
||||
if ((x == null) != (y == null))
|
||||
return false;
|
||||
return GetHashCode(x) == GetHashCode(y);
|
||||
}
|
||||
|
||||
public int GetHashCode(ConnectionInfoInheritance inheritance)
|
||||
{
|
||||
var allProperties = inheritance.GetProperties();
|
||||
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
return allProperties
|
||||
.Aggregate(17,
|
||||
(current, prop) => current * 23 + prop.GetValue(inheritance).GetHashCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,26 +86,7 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
|
||||
() => "The property mode should switch from inheritance to connection properties when clicking on the root node.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SwitchFromInheritanceToConnectionPropertiesWhenClickingChildOfRootNode()
|
||||
{
|
||||
// connection with a normal parent container
|
||||
var root = new RootNodeInfo(RootNodeType.Connection);
|
||||
var containerWhoseParentIsRoot = new ContainerInfo();
|
||||
var connection = new ConnectionInfo();
|
||||
root.AddChild(containerWhoseParentIsRoot);
|
||||
containerWhoseParentIsRoot.AddChild(connection);
|
||||
|
||||
_configWindow.SelectedTreeNode = connection;
|
||||
_configWindow.ShowInheritanceProperties();
|
||||
|
||||
_configWindow.SelectedTreeNode = containerWhoseParentIsRoot;
|
||||
Assert.That(_configWindow.PropertiesVisible, Is.True,
|
||||
() => "The property mode should switch from inheritance to connection properties " +
|
||||
"when clicking on a container whose parent is the root node.");
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(EveryNodeType))]
|
||||
[TestCaseSource(nameof(EveryNodeType))]
|
||||
public void DefaultConnectionPropertiesCanBeShownRegardlessOfWhichNodeIsSelected(ConnectionInfo selectedObject)
|
||||
{
|
||||
_configWindow.SelectedTreeNode = selectedObject;
|
||||
@@ -167,47 +148,28 @@ namespace mRemoteNGTests.UI.Window.ConfigWindowTests
|
||||
private static IEnumerable<TestCaseData> EveryNodeType()
|
||||
{
|
||||
var protocolTypes = typeof(ProtocolType).GetEnumValues().OfType<ProtocolType>().ToList();
|
||||
var root = new RootNodeInfo(RootNodeType.Connection);
|
||||
var container = new ContainerInfo();
|
||||
var connectionsWithNormalParent = protocolTypes
|
||||
var connections = protocolTypes
|
||||
.Select(protocolType =>
|
||||
{
|
||||
var c = new ConnectionInfo {Protocol = protocolType};
|
||||
c.SetParent(container);
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection, NormalParent");
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection");
|
||||
});
|
||||
|
||||
var connectionsWithRootParent = protocolTypes
|
||||
.Select(protocolType =>
|
||||
{
|
||||
var c = new ConnectionInfo { Protocol = protocolType };
|
||||
c.SetParent(root);
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection, RootParent");
|
||||
});
|
||||
|
||||
var contianersWithNormalParent = protocolTypes
|
||||
var containers = protocolTypes
|
||||
.Select(protocolType =>
|
||||
{
|
||||
var c = new ContainerInfo { Protocol = protocolType };
|
||||
c.SetParent(container);
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection, NormalParent");
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection");
|
||||
});
|
||||
|
||||
var containersWithRootParent = protocolTypes
|
||||
.Select(protocolType =>
|
||||
{
|
||||
var c = new ContainerInfo { Protocol = protocolType };
|
||||
c.SetParent(root);
|
||||
return new TestCaseData(c).SetName(protocolType + ", Connection, RootParent");
|
||||
});
|
||||
|
||||
return connectionsWithNormalParent
|
||||
.Concat(connectionsWithRootParent)
|
||||
.Concat(contianersWithNormalParent)
|
||||
.Concat(containersWithRootParent)
|
||||
return connections
|
||||
.Concat(containers)
|
||||
.Concat(new[]
|
||||
{
|
||||
new TestCaseData(root).SetName("RootNode"),
|
||||
new TestCaseData(new RootNodeInfo(RootNodeType.Connection)).SetName("RootNode"),
|
||||
new TestCaseData(new RootPuttySessionsNodeInfo()).SetName("RootPuttyNode"),
|
||||
new TestCaseData(new PuttySessionInfo()).SetName("PuttyNode"),
|
||||
new TestCaseData(null).SetName("Null"),
|
||||
|
||||
Reference in New Issue
Block a user