protected void InitListStore(RemoteSystem except = null) { foreach (RemoteSystem system in systemList) { if (except != null && except.GetName () == system.GetName ()) continue; InsertSystem (system); } }
public SystemInfoDialog(RemoteSystem _info, SystemList _list) : base() { Info = _info; SystemList = _list; this.Build (); this.LoadGateways (); this.LoadProtocols (); this.Populate (); }
public RemoteSystem(RemoteSystem info) { this.Name = info.GetName (); this.Host = info.GetHost (); this.GatewayName = info.GetGatewayName (); this.IsGateway = info.GetIsGateway (); this.User = info.GetUser (); this.Port = info.GetPort (); this.Protocol = info.GetProtocol (); this.AuthType = info.GetAuthType (); this.AuthKey = info.GetAuthKey (); }
private System.Diagnostics.ProcessStartInfo SetupCommand(RemoteSystem _remote) { var command = new System.Diagnostics.ProcessStartInfo (); var platform = Config.GetPlatformID (); switch (_remote.GetProtocol ()) { case "SSH": if (platform == System.PlatformID.Unix) { command.FileName = "/usr/bin/xterm"; command.Arguments = "-fa lucidatypewriter-14 " + "-fg midnightblue -bg palegoldenrod -geometry 120x40 " + "-e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no " + _remote.GetUser () + "@127.0.0.1 -p" + _remote.GetLPort ().ToString (); } else if (platform == System.PlatformID.MacOSX) { // TODO: COMPLETE } else if (platform == System.PlatformID.Win32NT) { // TODO: COMPLETE } break; case "RDP": if (platform == System.PlatformID.Unix) { command.FileName = "/usr/bin/rdesktop"; command.Arguments = "-u " + _remote.GetUser () + " -g 1280x1024 127.0.0.1:" + _remote.GetLPort ().ToString (); } else if (platform == System.PlatformID.MacOSX) { // TODO: COMPLETE } else if (platform == System.PlatformID.Win32NT) { command.FileName = "mstsc.exe"; command.Arguments = "/v 127.0.0.1:" + _remote.GetLPort (); } break; case "VNC": if (platform == System.PlatformID.Unix) { command.FileName = "/usr/bin/vncviewer"; command.Arguments = "-encodings tight -quality 6 -compresslevel 6 127.0.0.1::" + _remote.GetLPort ().ToString (); } else if (platform == System.PlatformID.MacOSX) { // TODO: COMPLETE } else if (platform == System.PlatformID.Win32NT) { command.FileName = "C:\\Program Files\\TightVNC\\tvnviewer.exe"; command.Arguments = "127.0.0.1::" + _remote.GetLPort ().ToString (); } break; default: command.FileName = "/bin/true"; command.Arguments = ""; break; } return command; }
public void SetGateway(RemoteSystem _gateway) { Gateway = _gateway; }
public bool OpenConnection(RemoteSystem _defaultGateway, int _localPort) { if (!this.IsConnected ()) { var jsch = new JSch (); var gw = _defaultGateway; this.LPort = _localPort; this.SSHSession = jsch.getSession (gw.GetUser (), gw.GetHost (), gw.GetPortNumber ()); this.SSHSession.setUserInfo (new RemoteUserInfo (gw)); try { this.SSHSession.connect (); } catch (Tamir.SharpSsh.jsch.JSchException ex) { Console.WriteLine ("Could not establish connection to remote gateway."); return false; } if (this.IsConnected ()) { this.SSHSession.setPortForwardingL (this.LPort, this.GetHost (), this.GetPortNumber ()); this.RemoteSession = new RemoteConnection (this); this.RemoteSession.ConnectionClosed += (object sender, ConnectionEventArgs args) => { this.CloseConnection (); }; this.RemoteSession.Open (); } } return this.IsConnected (); }
public RemoteConnection(RemoteSystem _remote) { RemoteSys = _remote; }
public RemoteUserInfo(RemoteSystem _system) { mSystem = _system; }
public ConnectionEventArgs(RemoteSystem _system, string _eventName) { System = _system; EventName = _eventName; }
private void InsertSystem(RemoteSystem _system) { var connState = (_system.IsConnected () ? Connected : Disconnected); systemListStore.AppendValues (_system.GetName (), _system.GetHost (), connState); }
private void SystemChanged(RemoteSystem system) { systemListStore.Clear (); this.InitListStore (system); this.InsertSystem (system); }
protected void OnSelectionChanged(object o, EventArgs args) { TreeIter iter; TreeModel model; if (((TreeSelection)o).GetSelected (out model, out iter)) { var value = (string) model.GetValue (iter, 0); selectedSystem = systemList.Find (value); } }
protected void OnNewClicked(object sender, EventArgs e) { var system = new RemoteSystem (); new SystemInfoDialog(system, systemList).Show(); }
public SystemEventArgs(RemoteSystem after, string action) { Before = new RemoteSystem (); After = after; Action = action; }
public SystemEventArgs(RemoteSystem before, RemoteSystem after, string action) { Before = before; After = after; Action = action; }
public SystemEventArgs() { Before = new RemoteSystem (); After = new RemoteSystem (); Action = ""; }