mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-18 06:21:41 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ebd255a22 | ||
|
|
6ec4bdd926 | ||
|
|
fe023b798d | ||
|
|
141c916b7b | ||
|
|
49c6219a84 | ||
|
|
0db444e78c | ||
|
|
57c2dc0a88 | ||
|
|
15ba2d3156 | ||
|
|
48e2ba11bf | ||
|
|
aa3e8344fb | ||
|
|
df5e619349 | ||
|
|
0c06983411 | ||
|
|
dda9c1f1af | ||
|
|
6779a02cf9 |
@@ -1,4 +1,4 @@
|
||||
1.74 (2016-06-20):
|
||||
1.74 (2016-06-28):
|
||||
|
||||
Supported Platforms/Components:
|
||||
-------------------------------
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
Fixes:
|
||||
------
|
||||
MR-874: Added work-around to installer to ignore installation prerequisites
|
||||
MR-884: Slow startup in some scnearios checking authenticode certificate
|
||||
MR-872: Crash in External Tools when arguments aren't quoted
|
||||
MR-854: crashes when right clicking on connection tab
|
||||
MR-852: Option "Allow only a single instance of the application" non-functional
|
||||
MR-836: Trying to delete a folder of connections only deletes 2 connections at a time
|
||||
|
||||
@@ -14,6 +14,7 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'manifest')]" use="@Id" />
|
||||
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.application')]" use="@Id" />
|
||||
<xsl:key name="service-search" match="wix:Component[wix:File/@Source = '$(var.HarvestPath)\mRemoteNG.exe']" use="@Id" />
|
||||
<xsl:key name="service-search" match="wix:Component[wix:File/@Source = '$(var.HarvestPath)\PuTTYNG.exe']" use="@Id" />
|
||||
<xsl:template match="wix:Component[key('service-search', @Id)]" />
|
||||
<xsl:template match="wix:ComponentRef[key('service-search', @Id)]" />
|
||||
</xsl:stylesheet>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
|
||||
<Component Id="C.PuttyNGFile" Guid="*">
|
||||
<File Id="PuttyNGFile" Name="PuTTYNG.exe" Source="Dependencies\PuTTYNG.exe" KeyPath="yes" />
|
||||
<File Id="PuttyNGFile" Name="PuTTYNG.exe" Source="$(var.HarvestPath)\PuTTYNG.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<?define RequiredDotNetFrameworkVersion = "$(var.RequiredDotNetFrameworkMajorVersion).$(var.RequiredDotNetFrameworkMinorVersion)" ?>
|
||||
<?define RDP80KB = "KB2592687" ?>
|
||||
<?define RDP81KB = "KB2923545" ?>
|
||||
<?define IGNOREPREREQUISITES = 0 ?>
|
||||
|
||||
<?if $(var.Platform) = x64 ?>
|
||||
<?define ProductNameWithPlatform = "$(var.ProductName) (64 bit)" ?>
|
||||
|
||||
@@ -112,18 +112,6 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Portable|x86' ">
|
||||
<DefineConstants>HarvestPath=$(SolutionDir)mRemoteV1\bin\Release Portable;HelpFilesHarvestPath=$(SolutionDir)mRemoteV1\Resources\Help</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>set /p buildenv=<buildenv.tmp
|
||||
|
||||
REM Sign MSI
|
||||
IF EXIST C:\mRemoteNG_code_signing_cert.pfx (powershell "&""$(SolutionDir)Tools\signfiles.ps1""" %27%25cd%25%27)
|
||||
|
||||
REM Rename MSI to include version number
|
||||
powershell "&""$(SolutionDir)Tools\rename_installer_with_version.ps1""" %27$(SolutionDir)%27 %27!(TargetPath)%27
|
||||
|
||||
REM Copy MSI to Release folder
|
||||
IF %25buildenv: Portable=%25==Release (powershell "&""$(SolutionDir)Tools\copy_release_installer.ps1""" %27$(TargetDir)%27 %27$(SolutionDir)Release%27)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>REM Clean the TargetDir
|
||||
rmdir /S /Q "$(TargetDir)"
|
||||
@@ -136,4 +124,20 @@ call "$(WIX)bin\heat.exe" dir "$(SolutionDir)mRemoteV1\bin\$(Configuration)" -ag
|
||||
REM Convert the license file "COPYING.TXT" to "License.rtf" to be shown in the installer GUI
|
||||
call "$(ProjectDir)Resources\Pandoc\pandoc.exe" -s -t rtf -o "$(ProjectDir)\Resources\License.rtf" "$(SolutionDir)COPYING.TXT"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>set /p buildenv=<buildenv.tmp
|
||||
|
||||
REM Sign MSI
|
||||
IF EXIST C:\mRemoteNG_code_signing_cert.pfx (
|
||||
IF %25buildenv: Portable=%25==Release (
|
||||
powershell "&""$(SolutionDir)Tools\signfiles.ps1""" %27%25cd%25%27
|
||||
)
|
||||
)
|
||||
|
||||
REM Rename MSI to include version number
|
||||
powershell "&""$(SolutionDir)Tools\rename_installer_with_version.ps1""" %27$(SolutionDir)%27 %27!(TargetPath)%27
|
||||
|
||||
REM Copy MSI to Release folder
|
||||
IF %25buildenv: Portable=%25==Release (powershell "&""$(SolutionDir)Tools\copy_release_installer.ps1""" %27$(TargetDir)%27 %27$(SolutionDir)Release%27)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -38,19 +38,19 @@
|
||||
</Condition>
|
||||
<!-- Windows 7 or higher required -->
|
||||
<Condition Message="!(loc.Install_OSVersionRequirement)">
|
||||
<![CDATA[Installed OR (VersionNT >= 601) OR (VersionNT64 >= 601)]]>
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 601) OR (VersionNT64 >= 601)]]>
|
||||
</Condition>
|
||||
<!-- If Windows 7, SP 1 is required -->
|
||||
<Condition Message="!(loc.Install_Win7RequiresSP1)">
|
||||
<![CDATA[Installed OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND ServicePackLevel >= 1)]]>
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) AND ServicePackLevel >= 1)]]>
|
||||
</Condition>
|
||||
<!-- .Net Framework Version Condition -->
|
||||
<Condition Message="!(loc.Install_NeedDotNetFrameworkVersion)">
|
||||
<![CDATA[Installed OR WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED = 1]]>
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR WIX_IS_NETFRAMEWORK_40_OR_LATER_INSTALLED = 1]]>
|
||||
</Condition>
|
||||
<!-- If Win7, require RDP 8.0 update (KB2592687) -->
|
||||
<Condition Message="!(loc.Install_RDP80Requirement)">
|
||||
<![CDATA[Installed OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) ]]>AND ($(var.RDP80KB) = 1 OR $(var.RDP81KB) = 1))
|
||||
<![CDATA[Installed OR (IGNOREPREREQUISITES = 1) OR (VersionNT >= 602 OR VersionNT64 >= 602) OR ((VersionNT = 601 OR VersionNT64 = 601) ]]>AND ($(var.RDP80KB) = 1 OR $(var.RDP81KB) = 1))
|
||||
</Condition>
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
|
||||
<Feature Id="F.ApplicationStartMenuShortcut" Title="!(loc.Feature_StartMenuShortcut)" Absent="allow" AllowAdvertise="no" Level="1">
|
||||
<ComponentRef Id="C.ApplicationStartMenuShortcut" Primary="yes" />
|
||||
|
||||
</Feature>
|
||||
</Feature>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ echo Building...
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" "%SOLUTIONDIR%\mRemoteV1.sln" /Rebuild "Release Portable"
|
||||
|
||||
:skipbuild
|
||||
IF NOT EXIST "%SOLUTIONDIR%\mRemoteV1\bin\Release Portable\mRemoteNG.exe" echo Did you forget to build? && goto end
|
||||
set SIGCHECK=!SIGCHECK:"=^"!
|
||||
set SIGCHECK=!SIGCHECK: =^^ !
|
||||
set SIGCHECK=!SIGCHECK:(=^^(!
|
||||
@@ -38,5 +39,7 @@ xcopy /S /Y "%SOLUTIONDIR%\mRemoteV1\bin\Release Portable" "%SOLUTIONDIR%\mRemot
|
||||
echo Creating portable ZIP file...
|
||||
echo %PORTABLEZIP%
|
||||
del /f /q %PORTABLEZIP% > nul 2>&1
|
||||
%SEVENZIP% a -bt -mx=9 -mm=LZMA -tzip -y -r %PORTABLEZIP% "%SOLUTIONDIR%\mRemoteV1\bin\package\*.*"
|
||||
%SEVENZIP% a -bt -mx=9 -mm=LZMA -tzip -y %PORTABLEZIP% "%SOLUTIONDIR%\*.TXT"
|
||||
%SEVENZIP% a -bt -mx=9 -tzip -y -r %PORTABLEZIP% "%SOLUTIONDIR%\mRemoteV1\bin\package\*.*"
|
||||
%SEVENZIP% a -bt -mx=9 -tzip -y %PORTABLEZIP% "%SOLUTIONDIR%\*.TXT"
|
||||
|
||||
:end
|
||||
@@ -102,7 +102,7 @@ namespace mRemoteNG.App
|
||||
{
|
||||
string osData = GetOperatingSystemData();
|
||||
string architecture = GetArchitectureData();
|
||||
Logger.Instance.InfoFormat(string.Join(" ", Array.FindAll(new string[] { osData, architecture }, s => !string.IsNullOrEmpty(Convert.ToString(s)))));
|
||||
Logger.Instance.InfoFormat(string.Join(" ", Array.FindAll(new[] { osData, architecture }, s => !string.IsNullOrEmpty(Convert.ToString(s)))));
|
||||
}
|
||||
|
||||
private string GetOperatingSystemData()
|
||||
@@ -112,32 +112,27 @@ namespace mRemoteNG.App
|
||||
|
||||
try
|
||||
{
|
||||
foreach (ManagementObject managementObject in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True").Get())
|
||||
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary=True").Get())
|
||||
{
|
||||
osVersion = GetOSVersion(osVersion, managementObject);
|
||||
var managementObject = (ManagementObject) o;
|
||||
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
|
||||
servicePack = GetOSServicePack(servicePack, managementObject);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Instance.WarnFormat("Error retrieving operating system information from WMI. {0}", ex.Message);
|
||||
Logger.Instance.WarnFormat($"Error retrieving operating system information from WMI. {ex.Message}");
|
||||
}
|
||||
string osData = string.Join(" ", new string[] { osVersion, servicePack });
|
||||
return osData;
|
||||
}
|
||||
|
||||
private string GetOSVersion(string osVersion, ManagementObject managementObject)
|
||||
{
|
||||
osVersion = Convert.ToString(managementObject.GetPropertyValue("Caption")).Trim();
|
||||
return osVersion;
|
||||
}
|
||||
|
||||
private string GetOSServicePack(string servicePack, ManagementObject managementObject)
|
||||
{
|
||||
int servicePackNumber = Convert.ToInt32(managementObject.GetPropertyValue("ServicePackMajorVersion"));
|
||||
if (!(servicePackNumber == 0))
|
||||
if (servicePackNumber != 0)
|
||||
{
|
||||
servicePack = string.Format("Service Pack {0}", servicePackNumber);
|
||||
servicePack = $"Service Pack {servicePackNumber}";
|
||||
}
|
||||
return servicePack;
|
||||
}
|
||||
@@ -147,15 +142,16 @@ namespace mRemoteNG.App
|
||||
string architecture = string.Empty;
|
||||
try
|
||||
{
|
||||
foreach (ManagementObject managementObject in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'").Get())
|
||||
foreach (var o in new ManagementObjectSearcher("SELECT * FROM Win32_Processor WHERE DeviceID=\'CPU0\'").Get())
|
||||
{
|
||||
var managementObject = (ManagementObject) o;
|
||||
int addressWidth = Convert.ToInt32(managementObject.GetPropertyValue("AddressWidth"));
|
||||
architecture = string.Format("{0}-bit", addressWidth);
|
||||
architecture = $"{addressWidth}-bit";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Instance.WarnFormat("Error retrieving operating system address width from WMI. {0}", ex.Message);
|
||||
Logger.Instance.WarnFormat($"Error retrieving operating system address width from WMI. {ex.Message}");
|
||||
}
|
||||
return architecture;
|
||||
}
|
||||
@@ -163,25 +159,27 @@ namespace mRemoteNG.App
|
||||
private void LogApplicationData()
|
||||
{
|
||||
#if !PORTABLE
|
||||
Logger.Instance.InfoFormat("{0} {1} starting.", Application.ProductName, Application.ProductVersion);
|
||||
Logger.Instance.InfoFormat($"{Application.ProductName} {Application.ProductVersion} starting.");
|
||||
#else
|
||||
Logger.Instance.InfoFormat("{0} {1} {2} starting.", Application.ProductName, Application.ProductVersion, Language.strLabelPortableEdition);
|
||||
Logger.Instance.InfoFormat(
|
||||
$"{Application.ProductName} {Application.ProductVersion} {Language.strLabelPortableEdition} starting.");
|
||||
#endif
|
||||
}
|
||||
|
||||
private void LogCmdLineArgs()
|
||||
{
|
||||
Logger.Instance.InfoFormat("Command Line: {0}", Environment.GetCommandLineArgs());
|
||||
Logger.Instance.InfoFormat($"Command Line: {Environment.GetCommandLineArgs()}");
|
||||
}
|
||||
|
||||
private void LogCLRData()
|
||||
{
|
||||
Logger.Instance.InfoFormat("Microsoft .NET CLR {0}", Environment.Version);
|
||||
Logger.Instance.InfoFormat($"Microsoft .NET CLR {Environment.Version}");
|
||||
}
|
||||
|
||||
private void LogCultureData()
|
||||
{
|
||||
Logger.Instance.InfoFormat("System Culture: {0}/{1}", Thread.CurrentThread.CurrentUICulture.Name, Thread.CurrentThread.CurrentUICulture.NativeName);
|
||||
Logger.Instance.InfoFormat(
|
||||
$"System Culture: {Thread.CurrentThread.CurrentUICulture.Name}/{Thread.CurrentThread.CurrentUICulture.NativeName}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace mRemoteNG.Connection.Protocol
|
||||
[LocalizedAttributes.LocalizedDescription("strICA")]
|
||||
ICA = 9,
|
||||
[LocalizedAttributes.LocalizedDescription("strExtApp")]
|
||||
IntApp = 20,
|
||||
SSH = 10
|
||||
IntApp = 20
|
||||
}
|
||||
}
|
||||
@@ -1556,7 +1556,7 @@ namespace mRemoteNG {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to AddFolder (UI.Window.Tree) failed. {0}.
|
||||
/// Looks up a localized string similar to AddFolder (UI.Window.ConnectionTreeWindow) failed. {0}.
|
||||
/// </summary>
|
||||
internal static string strErrorAddFolderFailed {
|
||||
get {
|
||||
|
||||
@@ -630,7 +630,7 @@ Starting with new connections file.</value>
|
||||
<value>AddExternalToolsToToolBar (frmMain) failed. {0}</value>
|
||||
</data>
|
||||
<data name="strErrorAddFolderFailed" xml:space="preserve">
|
||||
<value>AddFolder (UI.Window.Tree) failed. {0}</value>
|
||||
<value>AddFolder (UI.Window.ConnectionTreeWindow) failed. {0}</value>
|
||||
</data>
|
||||
<data name="strErrorBadDatabaseVersion" xml:space="preserve">
|
||||
<value>The database version {0} is not compatible with this version of {1}.</value>
|
||||
|
||||
@@ -124,11 +124,7 @@ namespace mRemoteNG.Tools
|
||||
|
||||
if (haveReplacement)
|
||||
{
|
||||
char trailing = '\0';
|
||||
if (tokenEnd + 2 <= input.Length)
|
||||
trailing = input.Substring(tokenEnd + 1, 1).ToCharArray()[0];
|
||||
else
|
||||
trailing = string.Empty.ToCharArray()[0];
|
||||
var trailing = tokenEnd + 2 <= input.Length ? input.Substring(tokenEnd + 1, 1).ToCharArray()[0] : '\0';
|
||||
|
||||
if (escape == EscapeType.All)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
using mRemoteNG.App;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.ComponentModel;
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.My;
|
||||
|
||||
using mRemoteNG.Messages;
|
||||
|
||||
namespace mRemoteNG.Tools
|
||||
{
|
||||
@@ -22,34 +19,17 @@ namespace mRemoteNG.Tools
|
||||
public bool TryIntegrate { get; set; }
|
||||
public ConnectionInfo ConnectionInfo { get; set; }
|
||||
|
||||
public Icon Icon
|
||||
{
|
||||
get
|
||||
{
|
||||
if (File.Exists(FileName))
|
||||
return MiscTools.GetIconFromFile(FileName);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Image Image
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Icon != null)
|
||||
return Icon.ToBitmap();
|
||||
else
|
||||
return Resources.mRemote_Icon.ToBitmap();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public Icon Icon => File.Exists(FileName) ? MiscTools.GetIconFromFile(FileName) : Resources.mRemote_Icon;
|
||||
|
||||
public Image Image => Icon?.ToBitmap() ?? Resources.mRemote_Icon.ToBitmap();
|
||||
|
||||
#endregion
|
||||
|
||||
public ExternalTool(string displayName = "", string fileName = "", string arguments = "")
|
||||
{
|
||||
this.DisplayName = displayName;
|
||||
this.FileName = fileName;
|
||||
this.Arguments = arguments;
|
||||
DisplayName = displayName;
|
||||
FileName = fileName;
|
||||
Arguments = arguments;
|
||||
}
|
||||
|
||||
public void Start(ConnectionInfo startConnectionInfo = null)
|
||||
@@ -58,7 +38,7 @@ namespace mRemoteNG.Tools
|
||||
{
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ExternalApp.Start() failed: FileName cannot be blank.", false);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "ExternalApp.Start() failed: FileName cannot be blank.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,8 +74,8 @@ namespace mRemoteNG.Tools
|
||||
process.StartInfo.FileName = argParser.ParseArguments(FileName);
|
||||
process.StartInfo.Arguments = argParser.ParseArguments(Arguments);
|
||||
}
|
||||
|
||||
public void StartIntegrated()
|
||||
|
||||
private void StartIntegrated()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -117,15 +97,11 @@ namespace mRemoteNG.Tools
|
||||
|
||||
private ConnectionInfo GetAppropriateInstanceOfConnectionInfo()
|
||||
{
|
||||
ConnectionInfo newConnectionInfo = default(ConnectionInfo);
|
||||
if (this.ConnectionInfo == null)
|
||||
newConnectionInfo = new ConnectionInfo();
|
||||
else
|
||||
newConnectionInfo = this.ConnectionInfo.Copy();
|
||||
var newConnectionInfo = ConnectionInfo == null ? new ConnectionInfo() : ConnectionInfo.Copy();
|
||||
return newConnectionInfo;
|
||||
}
|
||||
|
||||
private void SetConnectionInfoFields(ConnectionInfo newConnectionInfo)
|
||||
private void SetConnectionInfoFields(ConnectionInfo newConnectionInfo)
|
||||
{
|
||||
newConnectionInfo.Protocol = ProtocolType.IntApp;
|
||||
newConnectionInfo.ExtApp = DisplayName;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Forms;
|
||||
using mRemoteNG.UI.Window;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
@@ -9,7 +6,11 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Forms;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.UI.Window;
|
||||
using static System.String;
|
||||
|
||||
namespace mRemoteNG.Tools
|
||||
{
|
||||
@@ -18,8 +19,8 @@ namespace mRemoteNG.Tools
|
||||
private struct SHFILEINFO
|
||||
{
|
||||
public IntPtr hIcon; // : icon
|
||||
public int iIcon; // : icondex
|
||||
public int dwAttributes; // : SFGAO_ flags
|
||||
//public int iIcon; // : icondex
|
||||
//public int dwAttributes; // : SFGAO_ flags
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
|
||||
public string szDisplayName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
|
||||
@@ -37,42 +38,18 @@ namespace mRemoteNG.Tools
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(FileName) == false)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
IntPtr hImgSmall; //The handle to the system image list.
|
||||
//Dim hImgLarge As IntPtr 'The handle to the system image list.
|
||||
SHFILEINFO shinfo = new SHFILEINFO();
|
||||
shinfo = new SHFILEINFO();
|
||||
|
||||
shinfo.szDisplayName = new string('\0', 260);
|
||||
shinfo.szTypeName = new string('\0', 80);
|
||||
|
||||
//Use this to get the small icon.
|
||||
hImgSmall = SHGetFileInfo(FileName, 0, ref shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_SMALLICON);
|
||||
|
||||
//Use this to get the large icon.
|
||||
//hImgLarge = SHGetFileInfo(fName, 0, ref shinfo, (uint)Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_LARGEICON);
|
||||
|
||||
//The icon is returned in the hIcon member of the
|
||||
//shinfo struct.
|
||||
Icon myIcon = default(Icon);
|
||||
myIcon = Icon.FromHandle(shinfo.hIcon);
|
||||
|
||||
return myIcon;
|
||||
return File.Exists(FileName) == false ? null : Icon.ExtractAssociatedIcon(FileName);
|
||||
}
|
||||
catch (ArgumentException AEx)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg,
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg,
|
||||
"GetIconFromFile failed (Tools.Misc) - using default icon" + Environment.NewLine + AEx.Message, true);
|
||||
return Resources.mRemote_Icon;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "GetIconFromFile failed (Tools.Misc)" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, "GetIconFromFile failed (Tools.Misc)" + Environment.NewLine + ex.Message, true);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -85,14 +62,7 @@ namespace mRemoteNG.Tools
|
||||
{
|
||||
PasswordForm passwordForm = new PasswordForm(passwordName, verify);
|
||||
|
||||
if (passwordForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
return passwordForm.Password;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return passwordForm.ShowDialog() == DialogResult.OK ? passwordForm.Password : "";
|
||||
}
|
||||
|
||||
|
||||
@@ -104,18 +74,15 @@ namespace mRemoteNG.Tools
|
||||
|
||||
public static string LeadingZero(string Number)
|
||||
{
|
||||
if (Convert.ToInt32(Number) < 10)
|
||||
if (Convert.ToInt32(Number) < 10)
|
||||
{
|
||||
return "0" + Number;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Number;
|
||||
}
|
||||
return Number;
|
||||
}
|
||||
|
||||
|
||||
public static string DBDate(DateTime Dt)
|
||||
|
||||
public static string DBDate(DateTime Dt)
|
||||
{
|
||||
var strDate = Dt.Year + LeadingZero(Convert.ToString(Dt.Month)) + LeadingZero(Convert.ToString(Dt.Day)) + " " + LeadingZero(Convert.ToString(Dt.Hour)) + ":" + LeadingZero(Convert.ToString(Dt.Minute)) + ":" + LeadingZero(Convert.ToString(Dt.Second));
|
||||
return strDate;
|
||||
@@ -155,13 +122,13 @@ namespace mRemoteNG.Tools
|
||||
{
|
||||
return GetExceptionMessageRecursive(ex, Environment.NewLine);
|
||||
}
|
||||
public static string GetExceptionMessageRecursive(Exception ex, string separator)
|
||||
private static string GetExceptionMessageRecursive(Exception ex, string separator)
|
||||
{
|
||||
string message = ex.Message;
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
string innerMessage = GetExceptionMessageRecursive(ex.InnerException, separator);
|
||||
message = string.Join(separator, new string[] {message, innerMessage});
|
||||
message = Join(separator, message, innerMessage);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
@@ -186,7 +153,7 @@ namespace mRemoteNG.Tools
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Taking Screenshot failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "Taking Screenshot failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -208,17 +175,15 @@ namespace mRemoteNG.Tools
|
||||
|
||||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
FieldInfo fi = _enumType.GetField(Enum.GetName(_enumType, value));
|
||||
DescriptionAttribute dna = (DescriptionAttribute) (Attribute.GetCustomAttribute(fi, typeof(DescriptionAttribute)));
|
||||
if (value != null)
|
||||
{
|
||||
FieldInfo fi = _enumType.GetField(Enum.GetName(_enumType, value: value));
|
||||
DescriptionAttribute dna = (DescriptionAttribute) (Attribute.GetCustomAttribute(fi, typeof(DescriptionAttribute)));
|
||||
|
||||
if (dna != null)
|
||||
{
|
||||
return dna.Description;
|
||||
}
|
||||
else
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
return dna != null ? dna.Description : value.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type srcType)
|
||||
@@ -232,7 +197,7 @@ namespace mRemoteNG.Tools
|
||||
{
|
||||
DescriptionAttribute dna = (DescriptionAttribute) (Attribute.GetCustomAttribute(fi, typeof(DescriptionAttribute)));
|
||||
|
||||
if ((dna != null) && (((string) value) == dna.Description))
|
||||
if ((dna != null) && ((string) value == dna.Description))
|
||||
{
|
||||
return Enum.Parse(_enumType, fi.Name);
|
||||
}
|
||||
@@ -267,14 +232,14 @@ namespace mRemoteNG.Tools
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (value.GetType() == typeof(string))
|
||||
if (value is string)
|
||||
{
|
||||
if ((value).ToString().ToLower() == Language.strYes.ToLower())
|
||||
if (string.Equals(value.ToString(), Language.strYes, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((value).ToString().ToLower() == Language.strNo.ToLower())
|
||||
if (string.Equals(value.ToString(), Language.strNo, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -302,7 +267,7 @@ namespace mRemoteNG.Tools
|
||||
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
bool[] bools = new bool[] {true, false};
|
||||
bool[] bools = {true, false};
|
||||
|
||||
StandardValuesCollection svc = new StandardValuesCollection(bools);
|
||||
|
||||
@@ -322,7 +287,7 @@ namespace mRemoteNG.Tools
|
||||
private FormBorderStyle _savedBorderStyle;
|
||||
private Rectangle _savedBounds;
|
||||
|
||||
private bool _value = false;
|
||||
private bool _value;
|
||||
public bool Value
|
||||
{
|
||||
get
|
||||
|
||||
6
mRemoteV1/Tools/ReconnectGroup.Designer.cs
generated
6
mRemoteV1/Tools/ReconnectGroup.Designer.cs
generated
@@ -56,7 +56,7 @@ namespace mRemoteNG
|
||||
this.grpAutomaticReconnect.Size = new System.Drawing.Size(171, 98);
|
||||
this.grpAutomaticReconnect.TabIndex = 8;
|
||||
this.grpAutomaticReconnect.TabStop = false;
|
||||
this.grpAutomaticReconnect.Text = "Automatisches wiederverbinden";
|
||||
this.grpAutomaticReconnect.Text = Language.strGroupboxAutomaticReconnect;
|
||||
//
|
||||
//lblAnimation
|
||||
//
|
||||
@@ -72,7 +72,7 @@ namespace mRemoteNG
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(159, 23);
|
||||
this.btnClose.TabIndex = 7;
|
||||
this.btnClose.Text = "&Schließen";
|
||||
this.btnClose.Text = Language.strButtonClose;
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//lblServerStatus
|
||||
@@ -92,7 +92,7 @@ namespace mRemoteNG
|
||||
this.chkReconnectWhenReady.Name = "chkReconnectWhenReady";
|
||||
this.chkReconnectWhenReady.Size = new System.Drawing.Size(129, 17);
|
||||
this.chkReconnectWhenReady.TabIndex = 6;
|
||||
this.chkReconnectWhenReady.Text = "Verbinden wenn bereit";
|
||||
this.chkReconnectWhenReady.Text = Language.strCheckboxReconnectWhenReady;
|
||||
this.chkReconnectWhenReady.UseVisualStyleBackColor = true;
|
||||
//
|
||||
//pbServerStatus
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
private void tsExtAppEntry_Click(object sender, EventArgs e)
|
||||
{
|
||||
var extA = (ExternalTool)((Control)sender).Tag;
|
||||
var extA = (ExternalTool)((ToolStripButton)sender).Tag;
|
||||
|
||||
if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttySession)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using mRemoteNG.Connection;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Tree;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
@@ -13,7 +12,7 @@ using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace mRemoteNG.UI.Window
|
||||
{
|
||||
public partial class ConnectionTreeWindow : BaseWindow
|
||||
public partial class ConnectionTreeWindow
|
||||
{
|
||||
#region Form Stuff
|
||||
public void Tree_Load(object sender, EventArgs e)
|
||||
@@ -124,16 +123,16 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "FillImageList (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "FillImageList (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void tvConnections_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
|
||||
private void tvConnections_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
|
||||
{
|
||||
cMenTreeDelete.ShortcutKeys = Keys.None;
|
||||
}
|
||||
|
||||
public void tvConnections_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
|
||||
|
||||
private void tvConnections_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -146,11 +145,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_AfterLabelEdit (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_AfterLabelEdit (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void tvConnections_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
|
||||
private void tvConnections_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -160,7 +159,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
else if (ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.Container)
|
||||
{
|
||||
Windows.configForm.SetPropertyGridObject((e.Node.Tag as ContainerInfo).ConnectionInfo);
|
||||
Windows.configForm.SetPropertyGridObject(((ContainerInfo) e.Node.Tag).ConnectionInfo);
|
||||
}
|
||||
else if ((ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.Root) || (ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.PuttyRoot))
|
||||
{
|
||||
@@ -178,11 +177,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_AfterSelect (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_AfterSelect (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void tvConnections_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
|
||||
private void tvConnections_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -191,14 +190,14 @@ namespace mRemoteNG.UI.Window
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
if (mRemoteNG.Settings.Default.SingleClickOnConnectionOpensIt &&
|
||||
if (Settings.Default.SingleClickOnConnectionOpensIt &&
|
||||
(ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.Connection |
|
||||
ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.PuttySession))
|
||||
{
|
||||
Runtime.OpenConnection();
|
||||
}
|
||||
|
||||
if (mRemoteNG.Settings.Default.SingleClickSwitchesToOpenConnection && ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.Connection)
|
||||
if (Settings.Default.SingleClickSwitchesToOpenConnection && ConnectionTreeNode.GetNodeType(e.Node) == TreeNodeType.Connection)
|
||||
{
|
||||
Runtime.SwitchToOpenConnection((ConnectionInfo)e.Node.Tag);
|
||||
}
|
||||
@@ -206,11 +205,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_NodeMouseClick (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_NodeMouseClick (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
static public void tvConnections_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
|
||||
private static void tvConnections_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
{
|
||||
if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Connection |
|
||||
ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttySession)
|
||||
@@ -218,8 +217,8 @@ namespace mRemoteNG.UI.Window
|
||||
Runtime.OpenConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public void tvConnections_MouseMove(object sender, MouseEventArgs e)
|
||||
|
||||
private void tvConnections_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -227,16 +226,15 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_MouseMove (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_MouseMove (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnableMenuItemsRecursive(ToolStripItemCollection items, bool enable = true)
|
||||
{
|
||||
ToolStripMenuItem menuItem = default(ToolStripMenuItem);
|
||||
foreach (ToolStripItem item in items)
|
||||
foreach (ToolStripItem item in items)
|
||||
{
|
||||
menuItem = item as ToolStripMenuItem;
|
||||
var menuItem = item as ToolStripMenuItem;
|
||||
if (menuItem == null)
|
||||
{
|
||||
continue;
|
||||
@@ -320,13 +318,12 @@ namespace mRemoteNG.UI.Window
|
||||
cMenTreeDisconnect.Enabled = false;
|
||||
|
||||
int openConnections = 0;
|
||||
ConnectionInfo connectionInfo = default(ConnectionInfo);
|
||||
foreach (TreeNode node in selectedNode.Nodes)
|
||||
foreach (TreeNode node in selectedNode.Nodes)
|
||||
{
|
||||
if (node.Tag is ConnectionInfo)
|
||||
{
|
||||
connectionInfo = (ConnectionInfo)node.Tag;
|
||||
openConnections = openConnections + connectionInfo.OpenConnections.Count;
|
||||
var connectionInfo = (ConnectionInfo)node.Tag;
|
||||
openConnections = openConnections + connectionInfo.OpenConnections.Count;
|
||||
}
|
||||
}
|
||||
if (openConnections == 0)
|
||||
@@ -376,13 +373,13 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "ShowHideTreeContextMenuItems (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "ShowHideTreeContextMenuItems (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Drag and Drop
|
||||
static public void tvConnections_DragDrop(object sender, DragEventArgs e)
|
||||
private static void tvConnections_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -399,13 +396,13 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragDrop (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragDrop (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static public void tvConnections_DragEnter(object sender, DragEventArgs e)
|
||||
|
||||
private static void tvConnections_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -423,11 +420,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragEnter (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragEnter (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
static public void tvConnections_DragOver(object sender, DragEventArgs e)
|
||||
|
||||
private static void tvConnections_DragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -453,11 +450,10 @@ namespace mRemoteNG.UI.Window
|
||||
//also that it is not a child of the dropNode and
|
||||
//therefore an invalid target
|
||||
TreeNode dropNode = (TreeNode) (e.Data.GetData("System.Windows.Forms.TreeNode"));
|
||||
|
||||
Root.PuttySessions.PuttySessionsNodeInfo puttyRootInfo = default(Root.PuttySessions.PuttySessionsNodeInfo);
|
||||
while (!(targetNode == null))
|
||||
|
||||
while (targetNode != null)
|
||||
{
|
||||
puttyRootInfo = targetNode.Tag as Root.PuttySessions.PuttySessionsNodeInfo;
|
||||
var puttyRootInfo = targetNode.Tag as Root.PuttySessions.PuttySessionsNodeInfo;
|
||||
if (puttyRootInfo != null || targetNode == dropNode)
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
@@ -471,11 +467,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragOver (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_DragOver (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void tvConnections_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
|
||||
private void tvConnections_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -500,142 +496,142 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_ItemDrag (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_ItemDrag (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Tree Context Menu
|
||||
public void cMenTreeAddConnection_Click(System.Object sender, EventArgs e)
|
||||
private void cMenTreeAddConnection_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddConnection();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
public void cMenTreeAddFolder_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void cMenTreeAddFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddFolder();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
static public void cMenTreeConnect_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.DoNotJump);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
static public void cMenTreeConnectWithOptionsConnectToConsoleSession_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnectWithOptionsConnectToConsoleSession_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.UseConsoleSession | mRemoteNG.Connection.ConnectionInfo.Force.DoNotJump);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.UseConsoleSession | ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
static public void cMenTreeConnectWithOptionsNoCredentials_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnectWithOptionsNoCredentials_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.NoCredentials);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.NoCredentials);
|
||||
}
|
||||
|
||||
static public void cMenTreeConnectWithOptionsDontConnectToConsoleSession_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnectWithOptionsDontConnectToConsoleSession_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.DontUseConsoleSession | mRemoteNG.Connection.ConnectionInfo.Force.DoNotJump);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.DontUseConsoleSession | ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
static public void cMenTreeConnectWithOptionsConnectInFullscreen_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnectWithOptionsConnectInFullscreen_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.Fullscreen | mRemoteNG.Connection.ConnectionInfo.Force.DoNotJump);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.Fullscreen | ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
static public void cMenTreeConnectWithOptionsChoosePanelBeforeConnecting_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeConnectWithOptionsChoosePanelBeforeConnecting_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime.OpenConnection(mRemoteNG.Connection.ConnectionInfo.Force.OverridePanel | mRemoteNG.Connection.ConnectionInfo.Force.DoNotJump);
|
||||
Runtime.OpenConnection(ConnectionInfo.Force.OverridePanel | ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
|
||||
public void cMenTreeDisconnect_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void cMenTreeDisconnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
DisconnectConnection();
|
||||
}
|
||||
|
||||
static public void cMenTreeToolsTransferFile_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeToolsTransferFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
SshTransferFile();
|
||||
}
|
||||
|
||||
public void mMenSortAscending_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void mMenSortAscending_Click(object sender, EventArgs e)
|
||||
{
|
||||
tvConnections.BeginUpdate();
|
||||
ConnectionTree.Sort(tvConnections.Nodes[0], SortOrder.Ascending);
|
||||
tvConnections.EndUpdate();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
public void cMenTreeToolsSortAscending_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void cMenTreeToolsSortAscending_Click(object sender, EventArgs e)
|
||||
{
|
||||
tvConnections.BeginUpdate();
|
||||
ConnectionTree.Sort(tvConnections.SelectedNode, SortOrder.Ascending);
|
||||
tvConnections.EndUpdate();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
public void cMenTreeToolsSortDescending_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void cMenTreeToolsSortDescending_Click(object sender, EventArgs e)
|
||||
{
|
||||
tvConnections.BeginUpdate();
|
||||
ConnectionTree.Sort(tvConnections.SelectedNode, SortOrder.Descending);
|
||||
tvConnections.EndUpdate();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
public void cMenTree_DropDownOpening(object sender, EventArgs e)
|
||||
|
||||
private void cMenTree_DropDownOpening(object sender, EventArgs e)
|
||||
{
|
||||
AddExternalApps();
|
||||
}
|
||||
|
||||
private static void cMenTreeToolsExternalAppsEntry_Click(object sender, EventArgs e)
|
||||
{
|
||||
StartExternalApp((mRemoteNG.Tools.ExternalTool)((System.Windows.Forms.ToolStripMenuItem)sender).Tag);
|
||||
StartExternalApp((Tools.ExternalTool)((ToolStripMenuItem)sender).Tag);
|
||||
}
|
||||
|
||||
public void cMenTreeDuplicate_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private void cMenTreeDuplicate_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTreeNode.CloneNode(tvConnections.SelectedNode);
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
static public void cMenTreeRename_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeRename_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTree.StartRenameSelectedNode();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
static public void cMenTreeDelete_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTree.DeleteSelectedNode();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
static public void cMenTreeImportFile_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeImportFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
Import.ImportFromFile(Windows.treeForm.tvConnections.Nodes[0], Windows.treeForm.tvConnections.SelectedNode, true);
|
||||
}
|
||||
|
||||
static public void cMenTreeImportActiveDirectory_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeImportActiveDirectory_Click(object sender, EventArgs e)
|
||||
{
|
||||
Windows.Show(WindowType.ActiveDirectoryImport);
|
||||
}
|
||||
|
||||
static public void cMenTreeImportPortScan_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeImportPortScan_Click(object sender, EventArgs e)
|
||||
{
|
||||
Windows.Show(UI.Window.WindowType.PortScan, true);
|
||||
Windows.Show(WindowType.PortScan, true);
|
||||
}
|
||||
|
||||
static public void cMenTreeExportFile_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeExportFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
Export.ExportToFile(Windows.treeForm.tvConnections.Nodes[0], Windows.treeForm.tvConnections.SelectedNode);
|
||||
}
|
||||
static public void cMenTreeMoveUp_Click(System.Object sender, EventArgs e)
|
||||
private static void cMenTreeMoveUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTree.MoveNodeUp();
|
||||
Runtime.SaveConnectionsBG();
|
||||
}
|
||||
|
||||
static public void cMenTreeMoveDown_Click(System.Object sender, EventArgs e)
|
||||
|
||||
private static void cMenTreeMoveDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTree.MoveNodeDown();
|
||||
Runtime.SaveConnectionsBG();
|
||||
@@ -700,7 +696,7 @@ namespace mRemoteNG.UI.Window
|
||||
newContainerInfo.TreeNode = newNode;
|
||||
|
||||
TreeNode selectedNode = ConnectionTree.SelectedNode;
|
||||
TreeNode parentNode = default(TreeNode);
|
||||
TreeNode parentNode;
|
||||
if (selectedNode == null)
|
||||
{
|
||||
parentNode = tvConnections.Nodes[0];
|
||||
@@ -771,7 +767,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "DisconnectConnection (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "DisconnectConnection (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,7 +786,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SSHTransferFile (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "SSHTransferFile (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,7 +820,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "cMenTreeTools_DropDownOpening failed (UI.Window.Tree)" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "cMenTreeTools_DropDownOpening failed (UI.Window.ConnectionTreeWindow)" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,18 +835,18 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "cMenTreeToolsExternalAppsEntry_Click failed (UI.Window.Tree)" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "cMenTreeToolsExternalAppsEntry_Click failed (UI.Window.ConnectionTreeWindow)" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Menu
|
||||
static public void mMenViewExpandAllFolders_Click(System.Object sender, EventArgs e)
|
||||
public static void mMenViewExpandAllFolders_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionTree.ExpandAllNodes();
|
||||
}
|
||||
|
||||
public void mMenViewCollapseAllFolders_Click(System.Object sender, EventArgs e)
|
||||
public void mMenViewCollapseAllFolders_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (tvConnections.SelectedNode != null)
|
||||
{
|
||||
@@ -906,11 +902,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "txtSearch_KeyDown (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "txtSearch_KeyDown (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void txtSearch_TextChanged(System.Object sender, EventArgs e)
|
||||
public void txtSearch_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
tvConnections.SelectedNode = ConnectionTree.Find(tvConnections.Nodes[0], txtSearch.Text);
|
||||
}
|
||||
@@ -929,7 +925,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_KeyPress (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_KeyPress (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,7 +960,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_KeyDown (UI.Window.Tree) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, "tvConnections_KeyDown (UI.Window.ConnectionTreeWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -19,80 +19,80 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
#region Form Init
|
||||
internal ContextMenuStrip cmenTab;
|
||||
private System.ComponentModel.Container components = null;
|
||||
internal ToolStripMenuItem cmenTabFullscreen;
|
||||
internal ToolStripMenuItem cmenTabScreenshot;
|
||||
internal ToolStripMenuItem cmenTabTransferFile;
|
||||
internal ToolStripMenuItem cmenTabSendSpecialKeys;
|
||||
internal ToolStripSeparator cmenTabSep1;
|
||||
internal ToolStripMenuItem cmenTabRenameTab;
|
||||
internal ToolStripMenuItem cmenTabDuplicateTab;
|
||||
internal ToolStripMenuItem cmenTabDisconnect;
|
||||
internal ToolStripMenuItem cmenTabSmartSize;
|
||||
internal ToolStripMenuItem cmenTabSendSpecialKeysCtrlAltDel;
|
||||
internal ToolStripMenuItem cmenTabSendSpecialKeysCtrlEsc;
|
||||
internal ToolStripMenuItem cmenTabViewOnly;
|
||||
private System.ComponentModel.Container components;
|
||||
private ToolStripMenuItem cmenTabFullscreen;
|
||||
private ToolStripMenuItem cmenTabScreenshot;
|
||||
private ToolStripMenuItem cmenTabTransferFile;
|
||||
private ToolStripMenuItem cmenTabSendSpecialKeys;
|
||||
private ToolStripSeparator cmenTabSep1;
|
||||
private ToolStripMenuItem cmenTabRenameTab;
|
||||
private ToolStripMenuItem cmenTabDuplicateTab;
|
||||
private ToolStripMenuItem cmenTabDisconnect;
|
||||
private ToolStripMenuItem cmenTabSmartSize;
|
||||
private ToolStripMenuItem cmenTabSendSpecialKeysCtrlAltDel;
|
||||
private ToolStripMenuItem cmenTabSendSpecialKeysCtrlEsc;
|
||||
private ToolStripMenuItem cmenTabViewOnly;
|
||||
internal ToolStripMenuItem cmenTabReconnect;
|
||||
internal ToolStripMenuItem cmenTabExternalApps;
|
||||
internal ToolStripMenuItem cmenTabStartChat;
|
||||
internal ToolStripMenuItem cmenTabRefreshScreen;
|
||||
internal ToolStripSeparator ToolStripSeparator1;
|
||||
internal ToolStripMenuItem cmenTabPuttySettings;
|
||||
private ToolStripMenuItem cmenTabStartChat;
|
||||
private ToolStripMenuItem cmenTabRefreshScreen;
|
||||
private ToolStripSeparator ToolStripSeparator1;
|
||||
private ToolStripMenuItem cmenTabPuttySettings;
|
||||
|
||||
public Crownwood.Magic.Controls.TabControl TabController;
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
Load += new EventHandler(Connection_Load);
|
||||
DockStateChanged += new EventHandler(Connection_DockStateChanged);
|
||||
FormClosing += new FormClosingEventHandler(Connection_FormClosing);
|
||||
Load += Connection_Load;
|
||||
DockStateChanged += Connection_DockStateChanged;
|
||||
FormClosing += Connection_FormClosing;
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConnectionWindow));
|
||||
TabController = new Crownwood.Magic.Controls.TabControl();
|
||||
TabController.ClosePressed += new EventHandler(TabController_ClosePressed);
|
||||
TabController.DoubleClickTab += new Crownwood.Magic.Controls.TabControl.DoubleClickTabHandler(TabController_DoubleClickTab);
|
||||
TabController.DragDrop += new DragEventHandler(TabController_DragDrop);
|
||||
TabController.DragEnter += new DragEventHandler(TabController_DragEnter);
|
||||
TabController.DragOver += new DragEventHandler(TabController_DragOver);
|
||||
TabController.SelectionChanged += new EventHandler(TabController_SelectionChanged);
|
||||
TabController.MouseUp += new MouseEventHandler(TabController_MouseUp);
|
||||
TabController.PageDragEnd += new MouseEventHandler(TabController_PageDragStart);
|
||||
TabController.PageDragStart += new MouseEventHandler(TabController_PageDragStart);
|
||||
TabController.PageDragMove += new MouseEventHandler(TabController_PageDragMove);
|
||||
TabController.PageDragEnd += new MouseEventHandler(TabController_PageDragEnd);
|
||||
TabController.PageDragQuit += new MouseEventHandler(TabController_PageDragEnd);
|
||||
TabController.ClosePressed += TabController_ClosePressed;
|
||||
TabController.DoubleClickTab += TabController_DoubleClickTab;
|
||||
TabController.DragDrop += TabController_DragDrop;
|
||||
TabController.DragEnter += TabController_DragEnter;
|
||||
TabController.DragOver += TabController_DragOver;
|
||||
TabController.SelectionChanged += TabController_SelectionChanged;
|
||||
TabController.MouseUp += TabController_MouseUp;
|
||||
TabController.PageDragEnd += TabController_PageDragStart;
|
||||
TabController.PageDragStart += TabController_PageDragStart;
|
||||
TabController.PageDragMove += TabController_PageDragMove;
|
||||
TabController.PageDragEnd += TabController_PageDragEnd;
|
||||
TabController.PageDragQuit += TabController_PageDragEnd;
|
||||
cmenTab = new ContextMenuStrip(components);
|
||||
cmenTabFullscreen = new ToolStripMenuItem();
|
||||
cmenTabFullscreen.Click += new EventHandler(cmenTabFullscreen_Click);
|
||||
cmenTabFullscreen.Click += cmenTabFullscreen_Click;
|
||||
cmenTabSmartSize = new ToolStripMenuItem();
|
||||
cmenTabSmartSize.Click += new EventHandler(cmenTabSmartSize_Click);
|
||||
cmenTabSmartSize.Click += cmenTabSmartSize_Click;
|
||||
cmenTabViewOnly = new ToolStripMenuItem();
|
||||
cmenTabViewOnly.Click += new EventHandler(cmenTabViewOnly_Click);
|
||||
cmenTabViewOnly.Click += cmenTabViewOnly_Click;
|
||||
ToolStripSeparator1 = new ToolStripSeparator();
|
||||
cmenTabScreenshot = new ToolStripMenuItem();
|
||||
cmenTabScreenshot.Click += new EventHandler(cmenTabScreenshot_Click);
|
||||
cmenTabScreenshot.Click += cmenTabScreenshot_Click;
|
||||
cmenTabStartChat = new ToolStripMenuItem();
|
||||
cmenTabStartChat.Click += new EventHandler(cmenTabStartChat_Click);
|
||||
cmenTabStartChat.Click += cmenTabStartChat_Click;
|
||||
cmenTabTransferFile = new ToolStripMenuItem();
|
||||
cmenTabTransferFile.Click += new EventHandler(cmenTabTransferFile_Click);
|
||||
cmenTabTransferFile.Click += cmenTabTransferFile_Click;
|
||||
cmenTabRefreshScreen = new ToolStripMenuItem();
|
||||
cmenTabRefreshScreen.Click += new EventHandler(cmenTabRefreshScreen_Click);
|
||||
cmenTabRefreshScreen.Click += cmenTabRefreshScreen_Click;
|
||||
cmenTabSendSpecialKeys = new ToolStripMenuItem();
|
||||
cmenTabSendSpecialKeysCtrlAltDel = new ToolStripMenuItem();
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Click += new EventHandler(cmenTabSendSpecialKeysCtrlAltDel_Click);
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Click += cmenTabSendSpecialKeysCtrlAltDel_Click;
|
||||
cmenTabSendSpecialKeysCtrlEsc = new ToolStripMenuItem();
|
||||
cmenTabSendSpecialKeysCtrlEsc.Click += new EventHandler(cmenTabSendSpecialKeysCtrlEsc_Click);
|
||||
cmenTabSendSpecialKeysCtrlEsc.Click += cmenTabSendSpecialKeysCtrlEsc_Click;
|
||||
cmenTabExternalApps = new ToolStripMenuItem();
|
||||
cmenTabSep1 = new ToolStripSeparator();
|
||||
cmenTabRenameTab = new ToolStripMenuItem();
|
||||
cmenTabRenameTab.Click += new EventHandler(cmenTabRenameTab_Click);
|
||||
cmenTabRenameTab.Click += cmenTabRenameTab_Click;
|
||||
cmenTabDuplicateTab = new ToolStripMenuItem();
|
||||
cmenTabDuplicateTab.Click += new EventHandler(cmenTabDuplicateTab_Click);
|
||||
cmenTabDuplicateTab.Click += cmenTabDuplicateTab_Click;
|
||||
cmenTabReconnect = new ToolStripMenuItem();
|
||||
cmenTabReconnect.Click += new EventHandler(cmenTabReconnect_Click);
|
||||
cmenTabReconnect.Click += cmenTabReconnect_Click;
|
||||
cmenTabDisconnect = new ToolStripMenuItem();
|
||||
cmenTabDisconnect.Click += new EventHandler(cmenTabDisconnect_Click);
|
||||
cmenTabDisconnect.Click += cmenTabDisconnect_Click;
|
||||
cmenTabPuttySettings = new ToolStripMenuItem();
|
||||
cmenTabPuttySettings.Click += new EventHandler(cmenTabPuttySettings_Click);
|
||||
cmenTabPuttySettings.Click += cmenTabPuttySettings_Click;
|
||||
cmenTab.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
@@ -123,20 +123,20 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabFullscreen.Image = Resources.arrow_out;
|
||||
cmenTabFullscreen.Name = "cmenTabFullscreen";
|
||||
cmenTabFullscreen.Size = new Size(201, 22);
|
||||
cmenTabFullscreen.Text = "Fullscreen (RDP)";
|
||||
cmenTabFullscreen.Text = @"Fullscreen (RDP)";
|
||||
//
|
||||
//cmenTabSmartSize
|
||||
//
|
||||
cmenTabSmartSize.Image = Resources.SmartSize;
|
||||
cmenTabSmartSize.Name = "cmenTabSmartSize";
|
||||
cmenTabSmartSize.Size = new Size(201, 22);
|
||||
cmenTabSmartSize.Text = "SmartSize (RDP/VNC)";
|
||||
cmenTabSmartSize.Text = @"SmartSize (RDP/VNC)";
|
||||
//
|
||||
//cmenTabViewOnly
|
||||
//
|
||||
cmenTabViewOnly.Name = "cmenTabViewOnly";
|
||||
cmenTabViewOnly.Size = new Size(201, 22);
|
||||
cmenTabViewOnly.Text = "View Only (VNC)";
|
||||
cmenTabViewOnly.Text = @"View Only (VNC)";
|
||||
//
|
||||
//ToolStripSeparator1
|
||||
//
|
||||
@@ -148,14 +148,14 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabScreenshot.Image = Resources.Screenshot_Add;
|
||||
cmenTabScreenshot.Name = "cmenTabScreenshot";
|
||||
cmenTabScreenshot.Size = new Size(201, 22);
|
||||
cmenTabScreenshot.Text = "Screenshot";
|
||||
cmenTabScreenshot.Text = @"Screenshot";
|
||||
//
|
||||
//cmenTabStartChat
|
||||
//
|
||||
cmenTabStartChat.Image = Resources.Chat;
|
||||
cmenTabStartChat.Name = "cmenTabStartChat";
|
||||
cmenTabStartChat.Size = new Size(201, 22);
|
||||
cmenTabStartChat.Text = "Start Chat (VNC)";
|
||||
cmenTabStartChat.Text = @"Start Chat (VNC)";
|
||||
cmenTabStartChat.Visible = false;
|
||||
//
|
||||
//cmenTabTransferFile
|
||||
@@ -163,14 +163,14 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabTransferFile.Image = Resources.SSHTransfer;
|
||||
cmenTabTransferFile.Name = "cmenTabTransferFile";
|
||||
cmenTabTransferFile.Size = new Size(201, 22);
|
||||
cmenTabTransferFile.Text = "Transfer File (SSH)";
|
||||
cmenTabTransferFile.Text = @"Transfer File (SSH)";
|
||||
//
|
||||
//cmenTabRefreshScreen
|
||||
//
|
||||
cmenTabRefreshScreen.Image = Resources.Refresh;
|
||||
cmenTabRefreshScreen.Name = "cmenTabRefreshScreen";
|
||||
cmenTabRefreshScreen.Size = new Size(201, 22);
|
||||
cmenTabRefreshScreen.Text = "Refresh Screen (VNC)";
|
||||
cmenTabRefreshScreen.Text = @"Refresh Screen (VNC)";
|
||||
//
|
||||
//cmenTabSendSpecialKeys
|
||||
//
|
||||
@@ -178,26 +178,26 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabSendSpecialKeys.Image = Resources.Keyboard;
|
||||
cmenTabSendSpecialKeys.Name = "cmenTabSendSpecialKeys";
|
||||
cmenTabSendSpecialKeys.Size = new Size(201, 22);
|
||||
cmenTabSendSpecialKeys.Text = "Send special Keys (VNC)";
|
||||
cmenTabSendSpecialKeys.Text = @"Send special Keys (VNC)";
|
||||
//
|
||||
//cmenTabSendSpecialKeysCtrlAltDel
|
||||
//
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Name = "cmenTabSendSpecialKeysCtrlAltDel";
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Size = new Size(141, 22);
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Text = "Ctrl+Alt+Del";
|
||||
cmenTabSendSpecialKeysCtrlAltDel.Text = @"Ctrl+Alt+Del";
|
||||
//
|
||||
//cmenTabSendSpecialKeysCtrlEsc
|
||||
//
|
||||
cmenTabSendSpecialKeysCtrlEsc.Name = "cmenTabSendSpecialKeysCtrlEsc";
|
||||
cmenTabSendSpecialKeysCtrlEsc.Size = new Size(141, 22);
|
||||
cmenTabSendSpecialKeysCtrlEsc.Text = "Ctrl+Esc";
|
||||
cmenTabSendSpecialKeysCtrlEsc.Text = @"Ctrl+Esc";
|
||||
//
|
||||
//cmenTabExternalApps
|
||||
//
|
||||
cmenTabExternalApps.Image = (Image) (resources.GetObject("cmenTabExternalApps.Image"));
|
||||
cmenTabExternalApps.Name = "cmenTabExternalApps";
|
||||
cmenTabExternalApps.Size = new Size(201, 22);
|
||||
cmenTabExternalApps.Text = "External Applications";
|
||||
cmenTabExternalApps.Text = @"External Applications";
|
||||
//
|
||||
//cmenTabSep1
|
||||
//
|
||||
@@ -209,33 +209,33 @@ namespace mRemoteNG.UI.Window
|
||||
cmenTabRenameTab.Image = Resources.Rename;
|
||||
cmenTabRenameTab.Name = "cmenTabRenameTab";
|
||||
cmenTabRenameTab.Size = new Size(201, 22);
|
||||
cmenTabRenameTab.Text = "Rename Tab";
|
||||
cmenTabRenameTab.Text = @"Rename Tab";
|
||||
//
|
||||
//cmenTabDuplicateTab
|
||||
//
|
||||
cmenTabDuplicateTab.Name = "cmenTabDuplicateTab";
|
||||
cmenTabDuplicateTab.Size = new Size(201, 22);
|
||||
cmenTabDuplicateTab.Text = "Duplicate Tab";
|
||||
cmenTabDuplicateTab.Text = @"Duplicate Tab";
|
||||
//
|
||||
//cmenTabReconnect
|
||||
//
|
||||
cmenTabReconnect.Image = (Image) (resources.GetObject("cmenTabReconnect.Image"));
|
||||
cmenTabReconnect.Name = "cmenTabReconnect";
|
||||
cmenTabReconnect.Size = new Size(201, 22);
|
||||
cmenTabReconnect.Text = "Reconnect";
|
||||
cmenTabReconnect.Text = @"Reconnect";
|
||||
//
|
||||
//cmenTabDisconnect
|
||||
//
|
||||
cmenTabDisconnect.Image = Resources.Pause;
|
||||
cmenTabDisconnect.Name = "cmenTabDisconnect";
|
||||
cmenTabDisconnect.Size = new Size(201, 22);
|
||||
cmenTabDisconnect.Text = "Disconnect";
|
||||
cmenTabDisconnect.Text = @"Disconnect";
|
||||
//
|
||||
//cmenTabPuttySettings
|
||||
//
|
||||
cmenTabPuttySettings.Name = "cmenTabPuttySettings";
|
||||
cmenTabPuttySettings.Size = new Size(201, 22);
|
||||
cmenTabPuttySettings.Text = "PuTTY Settings";
|
||||
cmenTabPuttySettings.Text = @"PuTTY Settings";
|
||||
//
|
||||
//Connection
|
||||
//
|
||||
@@ -243,9 +243,9 @@ namespace mRemoteNG.UI.Window
|
||||
Controls.Add(TabController);
|
||||
Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, Convert.ToByte(0));
|
||||
Icon = Resources.mRemote_Icon;
|
||||
Name = "Connection";
|
||||
TabText = "UI.Window.Connection";
|
||||
Text = "UI.Window.Connection";
|
||||
Name = $"Connection";
|
||||
TabText = @"UI.Window.Connection";
|
||||
Text = @"UI.Window.Connection";
|
||||
cmenTab.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
|
||||
@@ -263,6 +263,7 @@ namespace mRemoteNG.UI.Window
|
||||
WindowType = WindowType.Connection;
|
||||
DockPnl = Panel;
|
||||
InitializeComponent();
|
||||
// ReSharper disable once VirtualMemberCallInConstructor
|
||||
Text = FormText;
|
||||
TabText = FormText;
|
||||
}
|
||||
@@ -276,7 +277,7 @@ namespace mRemoteNG.UI.Window
|
||||
|
||||
if (Settings.Default.ShowProtocolOnTabs)
|
||||
{
|
||||
nTab.Title = conI.Protocol.ToString() + ": ";
|
||||
nTab.Title = conI.Protocol.ToString() + @": ";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -287,7 +288,7 @@ namespace mRemoteNG.UI.Window
|
||||
|
||||
if (Settings.Default.ShowLogonInfoOnTabs)
|
||||
{
|
||||
nTab.Title += " (";
|
||||
nTab.Title += @" (";
|
||||
|
||||
if (conI.Domain != "")
|
||||
{
|
||||
@@ -298,13 +299,13 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
if (conI.Domain != "")
|
||||
{
|
||||
nTab.Title += "\\";
|
||||
nTab.Title += @"\";
|
||||
}
|
||||
|
||||
nTab.Title += conI.Username;
|
||||
}
|
||||
|
||||
nTab.Title += ")";
|
||||
nTab.Title += @")";
|
||||
}
|
||||
|
||||
nTab.Title = nTab.Title.Replace("&", "&&");
|
||||
@@ -331,7 +332,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddConnectionTab (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddConnectionTab (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -366,9 +367,9 @@ namespace mRemoteNG.UI.Window
|
||||
ApplyLanguage();
|
||||
}
|
||||
|
||||
private bool _documentHandlersAdded = false;
|
||||
private bool _floatHandlersAdded = false;
|
||||
private void Connection_DockStateChanged(Object sender, EventArgs e)
|
||||
private bool _documentHandlersAdded;
|
||||
private bool _floatHandlersAdded;
|
||||
private void Connection_DockStateChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (DockState == DockState.Float)
|
||||
{
|
||||
@@ -464,7 +465,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void Connection_ResizeBegin(Object sender, EventArgs e)
|
||||
private void Connection_ResizeBegin(object sender, EventArgs e)
|
||||
{
|
||||
ResizeBeginEvent?.Invoke(this, e);
|
||||
}
|
||||
@@ -481,12 +482,11 @@ namespace mRemoteNG.UI.Window
|
||||
ResizeEndEvent = (EventHandler) Delegate.Remove(ResizeEndEvent, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void Connection_ResizeEnd(Object sender, EventArgs e)
|
||||
|
||||
private void Connection_ResizeEnd(object sender, EventArgs e)
|
||||
{
|
||||
if (ResizeEndEvent != null)
|
||||
ResizeEndEvent(sender, e);
|
||||
}
|
||||
ResizeEndEvent?.Invoke(sender, e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region TabController
|
||||
@@ -574,12 +574,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl IC = (InterfaceControl) TabController.SelectedTab?.Tag;
|
||||
|
||||
if (IC == null)
|
||||
{
|
||||
@@ -643,33 +638,33 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ShowHideMenuButtons (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ShowHideMenuButtons (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void cmenTabScreenshot_Click(Object sender, EventArgs e)
|
||||
private void cmenTabScreenshot_Click(object sender, EventArgs e)
|
||||
{
|
||||
cmenTab.Close();
|
||||
Application.DoEvents();
|
||||
Windows.screenshotForm.AddScreenshot(Tools.MiscTools.TakeScreenshot(this));
|
||||
}
|
||||
|
||||
private void cmenTabSmartSize_Click(Object sender, EventArgs e)
|
||||
private void cmenTabSmartSize_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToggleSmartSize();
|
||||
}
|
||||
|
||||
private void cmenTabReconnect_Click(Object sender, EventArgs e)
|
||||
private void cmenTabReconnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
Reconnect();
|
||||
}
|
||||
|
||||
private void cmenTabTransferFile_Click(Object sender, EventArgs e)
|
||||
private void cmenTabTransferFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
TransferFile();
|
||||
}
|
||||
|
||||
private void cmenTabViewOnly_Click(Object sender, EventArgs e)
|
||||
private void cmenTabViewOnly_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToggleViewOnly();
|
||||
}
|
||||
@@ -684,42 +679,42 @@ namespace mRemoteNG.UI.Window
|
||||
RefreshScreen();
|
||||
}
|
||||
|
||||
private void cmenTabSendSpecialKeysCtrlAltDel_Click(Object sender, EventArgs e)
|
||||
private void cmenTabSendSpecialKeysCtrlAltDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendSpecialKeys(ProtocolVNC.SpecialKeys.CtrlAltDel);
|
||||
}
|
||||
|
||||
private void cmenTabSendSpecialKeysCtrlEsc_Click(Object sender, EventArgs e)
|
||||
private void cmenTabSendSpecialKeysCtrlEsc_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendSpecialKeys(ProtocolVNC.SpecialKeys.CtrlEsc);
|
||||
}
|
||||
|
||||
private void cmenTabFullscreen_Click(Object sender, EventArgs e)
|
||||
private void cmenTabFullscreen_Click(object sender, EventArgs e)
|
||||
{
|
||||
ToggleFullscreen();
|
||||
}
|
||||
|
||||
private void cmenTabPuttySettings_Click(Object sender, EventArgs e)
|
||||
private void cmenTabPuttySettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowPuttySettingsDialog();
|
||||
}
|
||||
|
||||
private void cmenTabExternalAppsEntry_Click(object sender, EventArgs e)
|
||||
{
|
||||
StartExternalApp((Tools.ExternalTool)((Control)sender).Tag);
|
||||
StartExternalApp((Tools.ExternalTool)((ToolStripMenuItem)sender).Tag);
|
||||
}
|
||||
|
||||
private void cmenTabDisconnect_Click(Object sender, EventArgs e)
|
||||
private void cmenTabDisconnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
CloseTabMenu();
|
||||
}
|
||||
|
||||
private void cmenTabDuplicateTab_Click(Object sender, EventArgs e)
|
||||
private void cmenTabDuplicateTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
DuplicateTab();
|
||||
}
|
||||
|
||||
private void cmenTabRenameTab_Click(Object sender, EventArgs e)
|
||||
private void cmenTabRenameTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
RenameTab();
|
||||
}
|
||||
@@ -730,28 +725,26 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
|
||||
if (IC.Protocol is ProtocolRDP)
|
||||
{
|
||||
ProtocolRDP rdp = (ProtocolRDP)IC.Protocol;
|
||||
rdp.ToggleSmartSize();
|
||||
}
|
||||
else if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.ToggleSmartSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
|
||||
var protocol = IC.Protocol as ProtocolRDP;
|
||||
if (protocol != null)
|
||||
{
|
||||
ProtocolRDP rdp = protocol;
|
||||
rdp.ToggleSmartSize();
|
||||
}
|
||||
else if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.ToggleSmartSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleSmartSize (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleSmartSize (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,26 +752,23 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
|
||||
if (IC.Info.Protocol == ProtocolType.SSH1 | IC.Info.Protocol == ProtocolType.SSH2)
|
||||
{
|
||||
SSHTransferFile();
|
||||
}
|
||||
else if (IC.Info.Protocol == ProtocolType.VNC)
|
||||
{
|
||||
VNCTransferFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IC.Info.Protocol == ProtocolType.SSH1 | IC.Info.Protocol == ProtocolType.SSH2)
|
||||
{
|
||||
SSHTransferFile();
|
||||
}
|
||||
else if (IC.Info.Protocol == ProtocolType.VNC)
|
||||
{
|
||||
VNCTransferFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TransferFile (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TransferFile (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,7 +790,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SSHTransferFile (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SSHTransferFile (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +804,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "VNCTransferFile (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "VNCTransferFile (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -822,25 +812,22 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
|
||||
if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
cmenTabViewOnly.Checked = !cmenTabViewOnly.Checked;
|
||||
if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
cmenTabViewOnly.Checked = !cmenTabViewOnly.Checked;
|
||||
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.ToggleViewOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.ToggleViewOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleViewOnly (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleViewOnly (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,23 +835,17 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl IC = TabController.SelectedTab?.Tag as InterfaceControl;
|
||||
|
||||
if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.StartChat();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IC?.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.StartChat();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "StartChat (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "StartChat (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,23 +853,17 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl IC = TabController.SelectedTab?.Tag as InterfaceControl;
|
||||
|
||||
if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.RefreshScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IC?.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.RefreshScreen();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "RefreshScreen (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "RefreshScreen (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,23 +871,17 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl IC = TabController.SelectedTab?.Tag as InterfaceControl;
|
||||
|
||||
if (IC.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.SendSpecialKeys(Keys);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IC?.Protocol is ProtocolVNC)
|
||||
{
|
||||
ProtocolVNC vnc = (ProtocolVNC)IC.Protocol;
|
||||
vnc.SendSpecialKeys(Keys);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SendSpecialKeys (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "SendSpecialKeys (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -920,23 +889,17 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl IC = TabController.SelectedTab?.Tag as InterfaceControl;
|
||||
|
||||
if (IC.Protocol is ProtocolRDP)
|
||||
{
|
||||
ProtocolRDP rdp = (ProtocolRDP)IC.Protocol;
|
||||
rdp.ToggleFullscreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (IC?.Protocol is ProtocolRDP)
|
||||
{
|
||||
ProtocolRDP rdp = (ProtocolRDP)IC.Protocol;
|
||||
rdp.ToggleFullscreen();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleFullscreen (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ToggleFullscreen (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -944,24 +907,18 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null)
|
||||
{
|
||||
if (TabController.SelectedTab.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl objInterfaceControl = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
InterfaceControl objInterfaceControl = TabController.SelectedTab?.Tag as InterfaceControl;
|
||||
|
||||
if (objInterfaceControl.Protocol is PuttyBase)
|
||||
{
|
||||
PuttyBase objPuttyBase = (PuttyBase)objInterfaceControl.Protocol;
|
||||
if (objInterfaceControl?.Protocol is PuttyBase)
|
||||
{
|
||||
PuttyBase objPuttyBase = (PuttyBase)objInterfaceControl.Protocol;
|
||||
|
||||
objPuttyBase.ShowSettingsDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
objPuttyBase.ShowSettingsDialog();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ShowPuttySettingsDialog (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ShowPuttySettingsDialog (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -983,20 +940,25 @@ namespace mRemoteNG.UI.Window
|
||||
//add ext apps
|
||||
foreach (Tools.ExternalTool extA in Runtime.ExternalTools)
|
||||
{
|
||||
ToolStripMenuItem nItem = new ToolStripMenuItem();
|
||||
nItem.Text = extA.DisplayName;
|
||||
nItem.Tag = extA;
|
||||
|
||||
nItem.Image = extA.Image;
|
||||
|
||||
nItem.Click += cmenTabExternalAppsEntry_Click;
|
||||
ToolStripMenuItem nItem = new ToolStripMenuItem
|
||||
{
|
||||
Text = extA.DisplayName,
|
||||
Tag = extA,
|
||||
/* rare failure here. While ExternalTool.Image already tries to default this
|
||||
* try again so it's not null/doesn't crash.
|
||||
*/
|
||||
Image = extA.Image ?? Resources.mRemote_Icon.ToBitmap()
|
||||
};
|
||||
|
||||
|
||||
nItem.Click += cmenTabExternalAppsEntry_Click;
|
||||
|
||||
cmenTabExternalApps.DropDownItems.Add(nItem);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "cMenTreeTools_DropDownOpening failed (UI.Window.Tree)" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "cMenTreeTools_DropDownOpening failed (UI.Window.ConnectionWindow)" + Environment.NewLine + ex.StackTrace, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1004,7 +966,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null && TabController.SelectedTab.Tag is InterfaceControl)
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
ExtA.Start(IC.Info);
|
||||
@@ -1012,7 +974,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "cmenTabExternalAppsEntry_Click failed (UI.Window.Tree)" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "cmenTabExternalAppsEntry_Click failed (UI.Window.ConnectionWindow)" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,7 +982,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null && TabController.SelectedTab.Tag is InterfaceControl)
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
IC.Protocol.Close();
|
||||
@@ -1028,7 +990,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "CloseTabMenu (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "CloseTabMenu (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,7 +998,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null && TabController.SelectedTab.Tag is InterfaceControl)
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
Runtime.OpenConnection(IC.Info, ConnectionInfo.Force.DoNotJump);
|
||||
@@ -1045,7 +1007,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "DuplicateTab (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "DuplicateTab (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1053,7 +1015,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TabController.SelectedTab != null && TabController.SelectedTab.Tag is InterfaceControl)
|
||||
if (TabController.SelectedTab?.Tag is InterfaceControl)
|
||||
{
|
||||
InterfaceControl IC = (InterfaceControl)TabController.SelectedTab.Tag;
|
||||
IC.Protocol.Close();
|
||||
@@ -1062,7 +1024,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Reconnect (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "Reconnect (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1079,7 +1041,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "RenameTab (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "RenameTab (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1098,7 +1060,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
if (TabController.InvokeRequired)
|
||||
{
|
||||
CloseTabCB s = new CloseTabCB(CloseTab);
|
||||
CloseTabCB s = CloseTab;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1136,7 +1098,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private bool _ignoreChangeSelectedTabClick = false;
|
||||
private bool _ignoreChangeSelectedTabClick;
|
||||
private void TabController_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
_ignoreChangeSelectedTabClick = true;
|
||||
@@ -1145,7 +1107,7 @@ namespace mRemoteNG.UI.Window
|
||||
RefreshIC();
|
||||
}
|
||||
|
||||
private int _firstClickTicks = 0;
|
||||
private int _firstClickTicks;
|
||||
private Rectangle _doubleClickRectangle;
|
||||
private void TabController_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
@@ -1190,7 +1152,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TabController_MouseUp (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TabController_MouseUp (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1209,7 +1171,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "FocusIC (UI.Window.Connections) failed" + Environment.NewLine + ex.Message, true);
|
||||
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "FocusIC (UI.Window.ConnectionWindow) failed" + Environment.NewLine + ex.Message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1273,7 +1235,7 @@ namespace mRemoteNG.UI.Window
|
||||
#endregion
|
||||
|
||||
#region Tab drag and drop
|
||||
private bool _InTabDrag = false;
|
||||
private bool _InTabDrag;
|
||||
public bool InTabDrag
|
||||
{
|
||||
get
|
||||
@@ -1316,10 +1278,7 @@ namespace mRemoteNG.UI.Window
|
||||
Cursor = Cursors.Default;
|
||||
InTabDrag = false;
|
||||
InterfaceControl interfaceControl = TabController.SelectedTab.Tag as InterfaceControl;
|
||||
if (interfaceControl != null)
|
||||
{
|
||||
interfaceControl.Protocol.Focus();
|
||||
}
|
||||
interfaceControl?.Protocol.Focus();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -12,134 +12,134 @@ namespace mRemoteNG.UI.Window
|
||||
public class ScreenshotManagerWindow : BaseWindow
|
||||
{
|
||||
#region Form Init
|
||||
internal System.Windows.Forms.MenuStrip msMain;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFile;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileSaveAll;
|
||||
internal System.Windows.Forms.ToolStripMenuItem mMenFileRemoveAll;
|
||||
internal System.Windows.Forms.ContextMenuStrip cMenScreenshot;
|
||||
internal MenuStrip msMain;
|
||||
internal ToolStripMenuItem mMenFile;
|
||||
internal ToolStripMenuItem mMenFileSaveAll;
|
||||
internal ToolStripMenuItem mMenFileRemoveAll;
|
||||
internal ContextMenuStrip cMenScreenshot;
|
||||
private System.ComponentModel.Container components = null;
|
||||
internal System.Windows.Forms.ToolStripMenuItem cMenScreenshotCopy;
|
||||
internal System.Windows.Forms.ToolStripMenuItem cMenScreenshotSave;
|
||||
internal System.Windows.Forms.SaveFileDialog dlgSaveSingleImage;
|
||||
internal System.Windows.Forms.FolderBrowserDialog dlgSaveAllImages;
|
||||
internal System.Windows.Forms.FlowLayoutPanel flpScreenshots;
|
||||
internal ToolStripMenuItem cMenScreenshotCopy;
|
||||
internal ToolStripMenuItem cMenScreenshotSave;
|
||||
internal SaveFileDialog dlgSaveSingleImage;
|
||||
internal FolderBrowserDialog dlgSaveAllImages;
|
||||
internal FlowLayoutPanel flpScreenshots;
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.Load += new System.EventHandler(ScreenshotManager_Load);
|
||||
this.flpScreenshots = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.msMain = new System.Windows.Forms.MenuStrip();
|
||||
this.mMenFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenFile.DropDownOpening += new System.EventHandler(this.mMenFile_DropDownOpening);
|
||||
this.mMenFileSaveAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenFileSaveAll.Click += new System.EventHandler(this.mMenFileSaveAll_Click);
|
||||
this.mMenFileRemoveAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mMenFileRemoveAll.Click += new System.EventHandler(this.mMenFileRemoveAll_Click);
|
||||
this.cMenScreenshot = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.cMenScreenshotCopy = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cMenScreenshotCopy.Click += new System.EventHandler(this.cMenScreenshotCopy_Click);
|
||||
this.cMenScreenshotSave = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cMenScreenshotSave.Click += new System.EventHandler(this.cMenScreenshotSave_Click);
|
||||
this.dlgSaveSingleImage = new System.Windows.Forms.SaveFileDialog();
|
||||
this.dlgSaveAllImages = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.msMain.SuspendLayout();
|
||||
this.cMenScreenshot.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
components = new System.ComponentModel.Container();
|
||||
Load += new EventHandler(ScreenshotManager_Load);
|
||||
flpScreenshots = new FlowLayoutPanel();
|
||||
msMain = new MenuStrip();
|
||||
mMenFile = new ToolStripMenuItem();
|
||||
mMenFile.DropDownOpening += new EventHandler(mMenFile_DropDownOpening);
|
||||
mMenFileSaveAll = new ToolStripMenuItem();
|
||||
mMenFileSaveAll.Click += new EventHandler(mMenFileSaveAll_Click);
|
||||
mMenFileRemoveAll = new ToolStripMenuItem();
|
||||
mMenFileRemoveAll.Click += new EventHandler(mMenFileRemoveAll_Click);
|
||||
cMenScreenshot = new ContextMenuStrip(components);
|
||||
cMenScreenshotCopy = new ToolStripMenuItem();
|
||||
cMenScreenshotCopy.Click += new EventHandler(cMenScreenshotCopy_Click);
|
||||
cMenScreenshotSave = new ToolStripMenuItem();
|
||||
cMenScreenshotSave.Click += new EventHandler(cMenScreenshotSave_Click);
|
||||
dlgSaveSingleImage = new SaveFileDialog();
|
||||
dlgSaveAllImages = new FolderBrowserDialog();
|
||||
msMain.SuspendLayout();
|
||||
cMenScreenshot.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
//flpScreenshots
|
||||
//
|
||||
this.flpScreenshots.Anchor = (System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right);
|
||||
this.flpScreenshots.AutoScroll = true;
|
||||
this.flpScreenshots.Location = new System.Drawing.Point(0, 26);
|
||||
this.flpScreenshots.Name = "flpScreenshots";
|
||||
this.flpScreenshots.Size = new System.Drawing.Size(542, 296);
|
||||
this.flpScreenshots.TabIndex = 0;
|
||||
flpScreenshots.Anchor = ((AnchorStyles.Top | AnchorStyles.Bottom)
|
||||
| AnchorStyles.Left)
|
||||
| AnchorStyles.Right;
|
||||
flpScreenshots.AutoScroll = true;
|
||||
flpScreenshots.Location = new Point(0, 26);
|
||||
flpScreenshots.Name = "flpScreenshots";
|
||||
flpScreenshots.Size = new Size(542, 296);
|
||||
flpScreenshots.TabIndex = 0;
|
||||
//
|
||||
//msMain
|
||||
//
|
||||
this.msMain.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, Convert.ToByte(0));
|
||||
this.msMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.mMenFile});
|
||||
this.msMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.msMain.Name = "msMain";
|
||||
this.msMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
|
||||
this.msMain.Size = new System.Drawing.Size(542, 24);
|
||||
this.msMain.TabIndex = 1;
|
||||
this.msMain.Text = "MenuStrip1";
|
||||
msMain.Font = new Font("Segoe UI", 8.25F, FontStyle.Regular, GraphicsUnit.Point, Convert.ToByte(0));
|
||||
msMain.Items.AddRange(new ToolStripItem[] {mMenFile});
|
||||
msMain.Location = new Point(0, 0);
|
||||
msMain.Name = "msMain";
|
||||
msMain.RenderMode = ToolStripRenderMode.Professional;
|
||||
msMain.Size = new Size(542, 24);
|
||||
msMain.TabIndex = 1;
|
||||
msMain.Text = "MenuStrip1";
|
||||
//
|
||||
//mMenFile
|
||||
//
|
||||
this.mMenFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {this.mMenFileSaveAll, this.mMenFileRemoveAll});
|
||||
this.mMenFile.Image = Resources.File;
|
||||
this.mMenFile.Name = "mMenFile";
|
||||
this.mMenFile.Size = new System.Drawing.Size(51, 20);
|
||||
this.mMenFile.Text = "&File";
|
||||
mMenFile.DropDownItems.AddRange(new ToolStripItem[] {mMenFileSaveAll, mMenFileRemoveAll});
|
||||
mMenFile.Image = Resources.File;
|
||||
mMenFile.Name = "mMenFile";
|
||||
mMenFile.Size = new Size(51, 20);
|
||||
mMenFile.Text = "&File";
|
||||
//
|
||||
//mMenFileSaveAll
|
||||
//
|
||||
this.mMenFileSaveAll.Image = Resources.Screenshot_Save;
|
||||
this.mMenFileSaveAll.Name = "mMenFileSaveAll";
|
||||
this.mMenFileSaveAll.Size = new System.Drawing.Size(128, 22);
|
||||
this.mMenFileSaveAll.Text = "Save All";
|
||||
mMenFileSaveAll.Image = Resources.Screenshot_Save;
|
||||
mMenFileSaveAll.Name = "mMenFileSaveAll";
|
||||
mMenFileSaveAll.Size = new Size(128, 22);
|
||||
mMenFileSaveAll.Text = "Save All";
|
||||
//
|
||||
//mMenFileRemoveAll
|
||||
//
|
||||
this.mMenFileRemoveAll.Image = Resources.Screenshot_Delete;
|
||||
this.mMenFileRemoveAll.Name = "mMenFileRemoveAll";
|
||||
this.mMenFileRemoveAll.Size = new System.Drawing.Size(128, 22);
|
||||
this.mMenFileRemoveAll.Text = "Remove All";
|
||||
mMenFileRemoveAll.Image = Resources.Screenshot_Delete;
|
||||
mMenFileRemoveAll.Name = "mMenFileRemoveAll";
|
||||
mMenFileRemoveAll.Size = new Size(128, 22);
|
||||
mMenFileRemoveAll.Text = "Remove All";
|
||||
//
|
||||
//cMenScreenshot
|
||||
//
|
||||
this.cMenScreenshot.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.cMenScreenshotCopy, this.cMenScreenshotSave});
|
||||
this.cMenScreenshot.Name = "cMenScreenshot";
|
||||
this.cMenScreenshot.Size = new System.Drawing.Size(100, 48);
|
||||
cMenScreenshot.Items.AddRange(new ToolStripItem[] {cMenScreenshotCopy, cMenScreenshotSave});
|
||||
cMenScreenshot.Name = "cMenScreenshot";
|
||||
cMenScreenshot.Size = new Size(100, 48);
|
||||
//
|
||||
//cMenScreenshotCopy
|
||||
//
|
||||
this.cMenScreenshotCopy.Image = Resources.Screenshot_Copy;
|
||||
this.cMenScreenshotCopy.Name = "cMenScreenshotCopy";
|
||||
this.cMenScreenshotCopy.Size = new System.Drawing.Size(99, 22);
|
||||
this.cMenScreenshotCopy.Text = "Copy";
|
||||
cMenScreenshotCopy.Image = Resources.Screenshot_Copy;
|
||||
cMenScreenshotCopy.Name = "cMenScreenshotCopy";
|
||||
cMenScreenshotCopy.Size = new Size(99, 22);
|
||||
cMenScreenshotCopy.Text = "Copy";
|
||||
//
|
||||
//cMenScreenshotSave
|
||||
//
|
||||
this.cMenScreenshotSave.Image = Resources.Screenshot_Save;
|
||||
this.cMenScreenshotSave.Name = "cMenScreenshotSave";
|
||||
this.cMenScreenshotSave.Size = new System.Drawing.Size(99, 22);
|
||||
this.cMenScreenshotSave.Text = "Save";
|
||||
cMenScreenshotSave.Image = Resources.Screenshot_Save;
|
||||
cMenScreenshotSave.Name = "cMenScreenshotSave";
|
||||
cMenScreenshotSave.Size = new Size(99, 22);
|
||||
cMenScreenshotSave.Text = "Save";
|
||||
//
|
||||
//dlgSaveSingleImage
|
||||
//
|
||||
this.dlgSaveSingleImage.Filter = "Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group Fi" +
|
||||
dlgSaveSingleImage.Filter = "Graphics Interchange Format File (.gif)|*.gif|Joint Photographic Experts Group Fi" +
|
||||
"le (.jpeg)|*.jpeg|Joint Photographic Experts Group File (.jpg)|*.jpg|Portable Ne" +
|
||||
"twork Graphics File (.png)|*.png";
|
||||
this.dlgSaveSingleImage.FilterIndex = 4;
|
||||
dlgSaveSingleImage.FilterIndex = 4;
|
||||
//
|
||||
//ScreenshotManager
|
||||
//
|
||||
this.ClientSize = new System.Drawing.Size(542, 323);
|
||||
this.Controls.Add(this.flpScreenshots);
|
||||
this.Controls.Add(this.msMain);
|
||||
this.HideOnClose = true;
|
||||
this.Icon = Resources.Screenshot_Icon;
|
||||
this.MainMenuStrip = this.msMain;
|
||||
this.Name = "ScreenshotManager";
|
||||
this.TabText = "Screenshots";
|
||||
this.Text = "Screenshots";
|
||||
this.msMain.ResumeLayout(false);
|
||||
this.msMain.PerformLayout();
|
||||
this.cMenScreenshot.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
ClientSize = new Size(542, 323);
|
||||
Controls.Add(flpScreenshots);
|
||||
Controls.Add(msMain);
|
||||
HideOnClose = true;
|
||||
Icon = Resources.Screenshot_Icon;
|
||||
MainMenuStrip = msMain;
|
||||
Name = "ScreenshotManager";
|
||||
TabText = "Screenshots";
|
||||
Text = "Screenshots";
|
||||
msMain.ResumeLayout(false);
|
||||
msMain.PerformLayout();
|
||||
cMenScreenshot.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Form Stuff
|
||||
private void ScreenshotManager_Load(object sender, System.EventArgs e)
|
||||
private void ScreenshotManager_Load(object sender, EventArgs e)
|
||||
{
|
||||
ApplyLanguage();
|
||||
}
|
||||
@@ -160,9 +160,9 @@ namespace mRemoteNG.UI.Window
|
||||
#region Public Methods
|
||||
public ScreenshotManagerWindow(DockContent Panel)
|
||||
{
|
||||
this.WindowType = WindowType.ScreenshotManager;
|
||||
this.DockPnl = Panel;
|
||||
this.InitializeComponent();
|
||||
WindowType = WindowType.ScreenshotManager;
|
||||
DockPnl = Panel;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void AddScreenshot(Image Screenshot)
|
||||
@@ -170,12 +170,12 @@ namespace mRemoteNG.UI.Window
|
||||
try
|
||||
{
|
||||
PictureBox nPB = new PictureBox();
|
||||
nPB.MouseDown += this.pbScreenshot_MouseDown;
|
||||
nPB.MouseDown += pbScreenshot_MouseDown;
|
||||
|
||||
nPB.Parent = this.flpScreenshots;
|
||||
nPB.Parent = flpScreenshots;
|
||||
nPB.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
nPB.BorderStyle = BorderStyle.FixedSingle;
|
||||
nPB.ContextMenuStrip = this.cMenScreenshot;
|
||||
nPB.ContextMenuStrip = cMenScreenshot;
|
||||
nPB.Image = Screenshot;
|
||||
nPB.Size = new Size(100, 100); //New Size((Screenshot.Width / 100) * 20, (Screenshot.Height / 100) * 20)
|
||||
nPB.Show();
|
||||
@@ -190,7 +190,7 @@ namespace mRemoteNG.UI.Window
|
||||
nBtn.Location = new Point(nPB.Width - nBtn.Width, -1);
|
||||
nBtn.Show();
|
||||
|
||||
this.Show(frmMain.Default.pnlDock);
|
||||
Show(frmMain.Default.pnlDock);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -200,21 +200,21 @@ namespace mRemoteNG.UI.Window
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
private void pbScreenshot_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e)
|
||||
private void pbScreenshot_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
this.cMenScreenshot.Tag = sender;
|
||||
cMenScreenshot.Tag = sender;
|
||||
|
||||
if (e.Button == System.Windows.Forms.MouseButtons.Left)
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
this.OpenScreenshot((System.Windows.Forms.PictureBox)sender);
|
||||
OpenScreenshot((PictureBox)sender);
|
||||
}
|
||||
}
|
||||
|
||||
private void pbScreenshotOpen_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e)
|
||||
private void pbScreenshotOpen_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == System.Windows.Forms.MouseButtons.Left)
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
this.CloseOpenedScreenshot((System.Windows.Forms.Form)((Control)sender).Parent);
|
||||
CloseOpenedScreenshot((Form)((PictureBox)sender).Parent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,19 +237,19 @@ namespace mRemoteNG.UI.Window
|
||||
nForm.MinimizeBox = false;
|
||||
nForm.Width = mImage.Width + 2;
|
||||
nForm.Height = mImage.Height + 2;
|
||||
nForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
nForm.FormBorderStyle = FormBorderStyle.None;
|
||||
|
||||
PictureBox nPB = new PictureBox();
|
||||
nPB.Parent = nForm;
|
||||
nPB.BorderStyle = BorderStyle.FixedSingle;
|
||||
nPB.Location = new Point(0, 0);
|
||||
nPB.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
nPB.Anchor = (System.Windows.Forms.AnchorStyles) (AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top);
|
||||
nPB.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top;
|
||||
nPB.Image = mImage;
|
||||
nPB.ContextMenuStrip = this.cMenScreenshot;
|
||||
nPB.ContextMenuStrip = cMenScreenshot;
|
||||
nPB.Show();
|
||||
|
||||
nPB.MouseDown += this.pbScreenshotOpen_MouseDown;
|
||||
nPB.MouseDown += pbScreenshotOpen_MouseDown;
|
||||
|
||||
nForm.ShowDialog();
|
||||
}
|
||||
@@ -259,11 +259,11 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCloseScreenshot_Click(System.Object sender, System.EventArgs e)
|
||||
private void btnCloseScreenshot_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
((Control)sender).Parent.Dispose();
|
||||
((PictureBox)sender).Parent.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -271,19 +271,19 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void mMenFileRemoveAll_Click(System.Object sender, System.EventArgs e)
|
||||
private void mMenFileRemoveAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RemoveAllImages();
|
||||
RemoveAllImages();
|
||||
}
|
||||
|
||||
private void RemoveAllImages()
|
||||
{
|
||||
this.flpScreenshots.Controls.Clear();
|
||||
flpScreenshots.Controls.Clear();
|
||||
}
|
||||
|
||||
private void mMenFileSaveAll_Click(System.Object sender, System.EventArgs e)
|
||||
private void mMenFileSaveAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveAllImages();
|
||||
SaveAllImages();
|
||||
}
|
||||
|
||||
private void SaveAllImages()
|
||||
@@ -292,9 +292,9 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
int pCount = 1;
|
||||
|
||||
if (this.dlgSaveAllImages.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
if (dlgSaveAllImages.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (string fPath in Directory.GetFiles(this.dlgSaveAllImages.SelectedPath, "Screenshot_*", SearchOption.TopDirectoryOnly))
|
||||
foreach (string fPath in Directory.GetFiles(dlgSaveAllImages.SelectedPath, "Screenshot_*", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
FileInfo f = new FileInfo(fPath);
|
||||
|
||||
@@ -305,11 +305,11 @@ namespace mRemoteNG.UI.Window
|
||||
pCount = (int) (double.Parse(fCount) + 1);
|
||||
}
|
||||
|
||||
foreach (System.Windows.Forms.Control ctrl in this.flpScreenshots.Controls)
|
||||
foreach (Control ctrl in flpScreenshots.Controls)
|
||||
{
|
||||
if (ctrl is PictureBox)
|
||||
{
|
||||
(ctrl as PictureBox).Image.Save(this.dlgSaveAllImages.SelectedPath + "\\Screenshot_" + Tools.MiscTools.LeadingZero(Convert.ToString(pCount)) +".png", System.Drawing.Imaging.ImageFormat.Png);
|
||||
(ctrl as PictureBox).Image.Save(dlgSaveAllImages.SelectedPath + "\\Screenshot_" + Tools.MiscTools.LeadingZero(Convert.ToString(pCount)) +".png", System.Drawing.Imaging.ImageFormat.Png);
|
||||
pCount++;
|
||||
}
|
||||
}
|
||||
@@ -321,16 +321,16 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void cMenScreenshotCopy_Click(System.Object sender, System.EventArgs e)
|
||||
private void cMenScreenshotCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.CopyImageToClipboard();
|
||||
CopyImageToClipboard();
|
||||
}
|
||||
|
||||
private void CopyImageToClipboard()
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetImage((cMenScreenshot.Tag as PictureBox).Image);
|
||||
Clipboard.SetImage(((PictureBox) cMenScreenshot.Tag).Image);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -338,30 +338,30 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void cMenScreenshotSave_Click(System.Object sender, System.EventArgs e)
|
||||
private void cMenScreenshotSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveSingleImage();
|
||||
SaveSingleImage();
|
||||
}
|
||||
|
||||
private void SaveSingleImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.dlgSaveSingleImage.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
if (dlgSaveSingleImage.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
switch (this.dlgSaveSingleImage.FileName.Substring(this.dlgSaveSingleImage.FileName.LastIndexOf(".") + 1).ToLower())
|
||||
switch (dlgSaveSingleImage.FileName.Substring(dlgSaveSingleImage.FileName.LastIndexOf(".", StringComparison.Ordinal) + 1).ToLower())
|
||||
{
|
||||
case "gif":
|
||||
(this.cMenScreenshot.Tag as PictureBox).Image.Save(this.dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Gif);
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Gif);
|
||||
break;
|
||||
case "jpeg":
|
||||
(this.cMenScreenshot.Tag as PictureBox).Image.Save(this.dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "jpg":
|
||||
(this.cMenScreenshot.Tag as PictureBox).Image.Save(this.dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "png":
|
||||
(this.cMenScreenshot.Tag as PictureBox).Image.Save(this.dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -372,17 +372,17 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private void mMenFile_DropDownOpening(object sender, System.EventArgs e)
|
||||
private void mMenFile_DropDownOpening(object sender, EventArgs e)
|
||||
{
|
||||
if (this.flpScreenshots.Controls.Count < 1)
|
||||
if (flpScreenshots.Controls.Count < 1)
|
||||
{
|
||||
this.mMenFileSaveAll.Enabled = false;
|
||||
this.mMenFileRemoveAll.Enabled = false;
|
||||
mMenFileSaveAll.Enabled = false;
|
||||
mMenFileRemoveAll.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.mMenFileSaveAll.Enabled = true;
|
||||
this.mMenFileRemoveAll.Enabled = true;
|
||||
mMenFileSaveAll.Enabled = true;
|
||||
mMenFileRemoveAll.Enabled = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -606,4 +606,8 @@
|
||||
</setting>
|
||||
</mRemoteNG.Settings>
|
||||
</applicationSettings>
|
||||
|
||||
<runtime>
|
||||
<generatePublisherEvidence enabled="false"/>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1195,6 +1195,9 @@
|
||||
<PostBuildEvent>call "$(DevEnvDir)..\tools\vsvars32.bat"
|
||||
set /p buildenv=<buildenv.tmp
|
||||
|
||||
echo Copy PUTTYNG to correct directory
|
||||
copy /Y "$(SolutionDir)mRemoteV1\Resources\PuTTYNG.exe" .\
|
||||
|
||||
REM Move Help files to correct directory
|
||||
move /Y Resources\Help .\
|
||||
rmdir /s /q Resources
|
||||
|
||||
Reference in New Issue
Block a user