mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
minor cleanup of PuttySessionInfo
This commit is contained in:
@@ -1,21 +1,77 @@
|
||||
using mRemoteNG.App;
|
||||
using mRemoteNG.Messages;
|
||||
using mRemoteNG.My;
|
||||
using mRemoteNG.Tools;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Root.PuttySessions;
|
||||
|
||||
|
||||
namespace mRemoteNG.Connection
|
||||
{
|
||||
public class PuttySessionInfo : ConnectionInfo, IComponent
|
||||
{
|
||||
[Command(),LocalizedAttributes.LocalizedDisplayName("strPuttySessionSettings")]
|
||||
#region Properties
|
||||
[Browsable(false)]
|
||||
public PuttySessionsNodeInfo RootPuttySessionsInfo { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string PuttySession { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Name { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Description { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Icon
|
||||
{
|
||||
get { return "PuTTY"; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Panel
|
||||
{
|
||||
get { return RootPuttySessionsInfo.Panel; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Hostname { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Username { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Password { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override ProtocolType Protocol { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override int Port { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string PreExtApp { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string PostExtApp { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string MacAddress { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string UserField { get; set; }
|
||||
#endregion
|
||||
|
||||
[Command(),LocalizedAttributes.LocalizedDisplayName("strPuttySessionSettings")]
|
||||
public void SessionSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
PuttyProcessController puttyProcess = new PuttyProcessController();
|
||||
var puttyProcess = new PuttyProcessController();
|
||||
if (!puttyProcess.Start())
|
||||
{
|
||||
return ;
|
||||
@@ -30,65 +86,11 @@ namespace mRemoteNG.Connection
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorCouldNotLaunchPutty + Environment.NewLine + ex.Message, false);
|
||||
Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorCouldNotLaunchPutty + Environment.NewLine + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
#region Properties
|
||||
[Browsable(false)]
|
||||
public Root.PuttySessions.PuttySessionsNodeInfo RootPuttySessionsInfo { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string PuttySession { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Name { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Description { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Icon
|
||||
{
|
||||
get { return "PuTTY"; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Panel
|
||||
{
|
||||
get { return RootPuttySessionsInfo.Panel; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Hostname { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override string Username { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string Password { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override Protocol.ProtocolType Protocol { get; set; }
|
||||
|
||||
[ReadOnly(true)]
|
||||
public override int Port { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string PreExtApp { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string PostExtApp { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string MacAddress { get; set; }
|
||||
|
||||
[ReadOnly(true), Browsable(false)]
|
||||
public override string UserField { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region IComponent
|
||||
[Browsable(false)]
|
||||
public ISite Site
|
||||
@@ -99,11 +101,10 @@ namespace mRemoteNG.Connection
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Disposed != null)
|
||||
Disposed(this, EventArgs.Empty);
|
||||
Disposed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public event EventHandler Disposed;
|
||||
|
||||
public event EventHandler Disposed;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user