//終了のハンドリング 非同期に別スレッドから呼ばれるので注意 public void ConnectionClosed(ISSHConnection connection) { IDictionaryEnumerator e = _profileToConnection.GetEnumerator(); while (e.MoveNext()) { if (connection == e.Value) { ChannelProfile prof = (ChannelProfile)e.Key; _profileToConnection.Remove(e.Key); bool manual = false; lock (this) { manual = _manualClosingConnections.Contains(connection); if (manual) { _manualClosingConnections.Remove(connection); } } if (!manual) { Util.InterThreadWarning(Env.Strings.GetString("Message.ConnectionManager.Disconnected")); } Env.MainForm.Invoke(new RefreshProfileStatusDelegate(Env.MainForm.RefreshProfileStatus), prof); break; } } }
public void RefreshProfileStatus(ChannelProfile prof) { ListViewItem li = FindItem(prof); Debug.Assert(li != null); li.SubItems[6].Text = Util.GetProfileStatusString(prof); }
public void Load(ConfigNode parent) { ConfigNode n = parent.FindChildConfigNode("profiles"); if (n != null) { foreach (ConfigNode ch in n.Children) { ChannelProfile p = null; if (ch.Name == "local-to-remote") { p = new LocalToRemoteChannelProfile(); } else if (ch.Name == "remote-to-local") { p = new RemoteToLocalChannelProfile(); } else { throw new FormatException(ch.Name + " is invalid channel profile name."); } p.Import(ch); _data.Add(p); } } }
//profに対応したSSHConnectionを返す。接続がなければparentを親に認証ダイアログを出して認証する public ISSHConnection GetOrCreateConnection(ChannelProfile prof, Form parent) { //ホスト名とアカウントのペアからコネクションを共有する仕組みがあるとよいかも ISSHConnection c = _profileToConnection[prof] as ISSHConnection; if (c != null) { return(c); } SSHShortcutLoginDialog dlg = new SSHShortcutLoginDialog(prof); if (dlg.ShowDialog(parent) == DialogResult.OK) { c = dlg.Result.Connection; try { dlg.Result.WaitRequest(); } catch (Exception ex) { Debug.WriteLine(ex.StackTrace); Util.Warning(parent, ex.Message); c.Close(); return(null); } _profileToConnection[prof] = c; Env.MainForm.RefreshProfileStatus(prof); } return(c); }
public void LogConnectionClosed(ChannelProfile prof, int id) { string t = String.Format("{0} {1} connection closed; id={2}", DateTime.Now.ToString(), prof.ProtocolType.ToString(), id); _strm.WriteLine(t); _strm.Flush(); }
public void RemoveProfile(ChannelProfile prof) { if (Env.Connections.IsConnected(prof)) { Util.Warning(Env.MainForm, Env.Strings.GetString("Message.Commands.CannotDeleteConnectedProfile")); return; } Env.Profiles.RemoveProfile(prof); Env.MainForm.RefreshAllProfiles(); }
public void MoveProfileDown(ChannelProfile prof) { int index = Env.Profiles.IndexOf(prof); if (index < Env.Profiles.Count - 1) { Env.Profiles.RemoveProfile(prof); Env.Profiles.InsertAt(index + 1, prof); Env.MainForm.RefreshAllProfiles(); Env.MainForm.SetSelectedIndex(index + 1); } }
public void MoveProfileUp(ChannelProfile prof) { int index = Env.Profiles.IndexOf(prof); if (index > 0) { Env.Profiles.RemoveProfile(prof); Env.Profiles.InsertAt(index - 1, prof); Env.MainForm.RefreshAllProfiles(); Env.MainForm.SetSelectedIndex(index - 1); } }
public static SocketWithTimeout StartNewConnection(ISocketWithTimeoutClient client, ChannelProfile prof, string password, HostKeyCheckCallback keycheck) { SocketWithTimeout swt; swt = new SSHConnector(prof, password, keycheck); /* if (Env.Options.UseSocks) swt.AsyncConnect(client, CreateSocksParam(prof.SSHHost, prof.SSHPort)); else*/ swt.AsyncConnect(client, prof.SSHHost, prof.SSHPort); return swt; }
public void LogConnectionOpened(ChannelProfile prof, int id) { string t = String.Format("{0} {1} connection opened; id={2}", DateTime.Now.ToString(), prof.ProtocolType.ToString(), id); if (prof is LocalToRemoteChannelProfile) t = String.Format("{0}; from=localhost:{1}; to={2}:{3}", t, prof.ListenPort, prof.DestinationHost, prof.DestinationPort); else t = String.Format("{0}; from={1}:{2}; to={3}:{4}", t, prof.SSHHost, prof.ListenPort, prof.DestinationHost, prof.DestinationPort); _strm.WriteLine(t); _strm.Flush(); }
public static IPAddress ChannelProfileToListeningAddress(ChannelProfile prof) { if (prof.UseIPv6) { return(prof.AllowsForeignConnection ? IPAddress.IPv6Any : IPAddress.IPv6Loopback); } else { return(prof.AllowsForeignConnection ? IPAddress.Any : IPAddress.Loopback); } }
private void OnListViewDoubleClicked(object sender, EventArgs args) { ChannelProfile prof = GetSelectedProfile(); if (prof == null) { return; } Env.Commands.ConnectProfile(prof); }
private ListViewItem FindItem(ChannelProfile prof) { foreach (ListViewItem li in _list.Items) { if (li.Tag == prof) { return(li); } } return(null); }
public static string GetProfileTypeString(ChannelProfile prof) { if (prof is LocalToRemoteChannelProfile) { return(Env.Strings.GetString("Caption.Util.Local")); } else { return(Env.Strings.GetString("Caption.Util.Remote")); } }
public void EditProfile(ChannelProfile prof) { if (Env.Connections.IsConnected(prof)) { Util.Warning(Env.MainForm, Env.Strings.GetString("Message.Commands.CannotEditConnectedProfile")); return; } ProfileEdit dlg = new ProfileEdit(prof); if (dlg.ShowDialog(Env.MainForm) == DialogResult.OK) { Env.Profiles.ReplaceProfile(prof, dlg.ResultProfile); Env.MainForm.RefreshAllProfiles(); } }
/* private static Socks CreateSocksParam(string dest_host, int dest_port) { Socks s = new Socks(); s.DestName = dest_host; s.DestPort = (short)dest_port; s.Account = Env.Options.SocksAccount; s.Password = Env.Options.SocksPassword; s.ServerName = Env.Options.SocksServer; s.ServerPort = (short)Env.Options.SocksPort; s.ExcludingNetworks = Env.Options.SocksNANetworks; return s; } */ public void ManualClose(ChannelProfile prof) { if (!IsConnected(prof)) { Debug.WriteLine("ManualClose - Not connected"); return; } lock (this) { SSHConnection c = (SSHConnection)_profileToConnection[prof]; _manualClosingConnections.Add(c); c.Disconnect(""); } }
private void OnListViewMouseUp(object sender, MouseEventArgs args) { ChannelProfile prof = GetSelectedProfile(); if (args.Button != MouseButtons.Right || prof == null) { return; } AdjustMenu(_listViewContextMenu.Items, prof); _listViewContextMenu.Show(this, new Point(args.X, args.Y)); }
public ProfileEdit(ChannelProfile prof) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); InitializeText(); // // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。 // InitUI(prof); }
public ProfileEdit(ChannelProfile prof) { // // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B // InitializeComponent(); InitializeText(); // // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B // InitUI(prof); }
public SSHShortcutLoginDialog(ChannelProfile profile) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); InitializeText(); // // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。 // _profile = profile; InitUI(); }
/* * private static Socks CreateSocksParam(string dest_host, int dest_port) { * Socks s = new Socks(); * s.DestName = dest_host; * s.DestPort = (short)dest_port; * s.Account = Env.Options.SocksAccount; * s.Password = Env.Options.SocksPassword; * s.ServerName = Env.Options.SocksServer; * s.ServerPort = (short)Env.Options.SocksPort; * s.ExcludingNetworks = Env.Options.SocksNANetworks; * return s; * } */ public void ManualClose(ChannelProfile prof) { if (!IsConnected(prof)) { Debug.WriteLine("ManualClose - Not connected"); return; } lock (this) { ISSHConnection c = (ISSHConnection)_profileToConnection[prof]; _manualClosingConnections.Add(c); c.Disconnect(DisconnectionReasonCode.ByApplication, "close by application"); } }
//コンテキストメニューと双方で使用する private void AdjustMenu(ToolStripItemCollection items, ChannelProfile prof) { bool connected = prof != null && Env.Connections.IsConnected(prof); ConvertMenuItem(items, _menuProfileConnect).Enabled = prof != null && !connected; ConvertMenuItem(items, _menuProfileDisconnect).Enabled = prof != null && connected; ConvertMenuItem(items, _menuProfileRemove).Enabled = prof != null && !connected; ConvertMenuItem(items, _menuProfileProperty).Enabled = prof != null && !connected; int index = prof == null ? -1 : Env.Profiles.IndexOf(prof); ConvertMenuItem(items, _menuProfileUp).Enabled = prof != null && index > 0; ConvertMenuItem(items, _menuProfileDown).Enabled = prof != null && index < Env.Profiles.Count - 1; }
/* * private static Socks CreateSocksParam(string dest_host, int dest_port) { * Socks s = new Socks(); * s.DestName = dest_host; * s.DestPort = (short)dest_port; * s.Account = Env.Options.SocksAccount; * s.Password = Env.Options.SocksPassword; * s.ServerName = Env.Options.SocksServer; * s.ServerPort = (short)Env.Options.SocksPort; * s.ExcludingNetworks = Env.Options.SocksNANetworks; * return s; * } */ public void ManualClose(ChannelProfile prof) { if (!IsConnected(prof)) { Debug.WriteLine("ManualClose - Not connected"); return; } lock (this) { SSHConnection c = (SSHConnection)_profileToConnection[prof]; _manualClosingConnections.Add(c); c.Disconnect(""); } }
public SSHShortcutLoginDialog(ChannelProfile profile) { // // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B // InitializeComponent(); InitializeText(); // // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B // _profile = profile; InitUI(); }
public void LogConnectionOpened(ChannelProfile prof, int id) { string t = String.Format("{0} {1} connection opened; id={2}", DateTime.Now.ToString(), prof.ProtocolType.ToString(), id); if (prof is LocalToRemoteChannelProfile) { t = String.Format("{0}; from=localhost:{1}; to={2}:{3}", t, prof.ListenPort, prof.DestinationHost, prof.DestinationPort); } else { t = String.Format("{0}; from={1}:{2}; to={3}:{4}", t, prof.SSHHost, prof.ListenPort, prof.DestinationHost, prof.DestinationPort); } _strm.WriteLine(t); _strm.Flush(); }
public static ChannelFactory Create(ChannelProfile prof) { /* * if(prof.ProtocolType==ProtocolType.Udp) * return new UdpChannelFactory(prof); * else */ if (prof is LocalToRemoteChannelProfile) { return(new LocalToRemoteChannelFactory((LocalToRemoteChannelProfile)prof)); } else { return(new RemoteToLocalChannelFactory((RemoteToLocalChannelProfile)prof)); } }
//profに対応したSSHConnectionを返す。接続がなければparentを親に認証ダイアログを出して認証する public SSHConnection GetOrCreateConnection(ChannelProfile prof, Form parent) { //ホスト名とアカウントのペアからコネクションを共有する仕組みがあるとよいかも SSHConnection c = (SSHConnection)_profileToConnection[prof]; if (c != null) return c; SSHShortcutLoginDialog dlg = new SSHShortcutLoginDialog(prof); DialogResult result = DialogResult.No; //認証設定がない場合はそのまま接続 if (!prof.Auth) { // 疑似的にOKボタン押下 dlg.OnOK(null, EventArgs.Empty); // 非同期で接続が行われるので1秒待つ System.Threading.Thread.Sleep(1000); result = DialogResult.OK; } // 認証が必要な場合 else { // ダイアログによるユーザ認証 result = dlg.ShowDialog(parent); } if (result == DialogResult.OK) { c = dlg.Result.Connection; try { dlg.Result.WaitRequest(); } catch (Exception ex) { Debug.WriteLine(ex.StackTrace); Util.Warning(parent, ex.Message); c.Close(); return null; } _profileToConnection[prof] = c; Env.MainForm.RefreshProfileStatus(prof); } return c; }
private void OnListViewKeyPress(object sender, KeyPressEventArgs args) { if (args.KeyChar == '\r') { ChannelProfile prof = GetSelectedProfile(); if (prof != null) { if (Control.ModifierKeys == Keys.Control) { Env.Commands.EditProfile(prof); } else if (!Env.Connections.IsConnected(prof)) { Env.Commands.ConnectProfile(prof); } } } }
private void InitUI(ChannelProfile prof) { if (prof == null) { _localToRemoteOption.Checked = true; _passwordOption.Checked = true; } else { _sshHostBox.Text = prof.SSHHost; _portBox.Text = prof.SSHPort.ToString(); _accountBox.Text = prof.SSHAccount; //_udpOption.Checked = prof.ProtocolType==ProtocolType.Udp; if (prof.AuthType == AuthenticationType.Password) { _passwordOption.Checked = true; } else { _publicKeyOption.Checked = true; _privateKeyBox.Text = prof.PrivateKeyFile; } _loopbackOnly.Checked = !prof.AllowsForeignConnection; if (prof is LocalToRemoteChannelProfile) { LocalToRemoteChannelProfile p = (LocalToRemoteChannelProfile)prof; _localToRemoteOption.Checked = true; _LRLocalPortBox.Text = p.ListenPort.ToString(); _LRIPv6.Checked = p.UseIPv6; _LRRemoteHostBox.Text = p.DestinationHost; _LRRemotePortBox.Text = p.DestinationPort.ToString(); } else { RemoteToLocalChannelProfile p = (RemoteToLocalChannelProfile)prof; _remoteToLocalOption.Checked = true; _RLLocalPortBox.Text = p.DestinationPort.ToString(); _RLLocalHostBox.Text = p.DestinationHost; _RLRemotePortBox.Text = p.ListenPort.ToString(); } } }
//profに対応したSSHConnectionを返す。接続がなければparentを親に認証ダイアログを出して認証する public SSHConnection GetOrCreateConnection(ChannelProfile prof, Form parent) { //ホスト名とアカウントのペアからコネクションを共有する仕組みがあるとよいかも SSHConnection c = (SSHConnection)_profileToConnection[prof]; if (c != null) return c; SSHShortcutLoginDialog dlg = new SSHShortcutLoginDialog(prof); if (dlg.ShowDialog(parent) == DialogResult.OK) { c = dlg.Result.Connection; try { dlg.Result.WaitRequest(); } catch (Exception ex) { Debug.WriteLine(ex.StackTrace); Util.Warning(parent, ex.Message); c.Close(); return null; } _profileToConnection[prof] = c; Env.MainForm.RefreshProfileStatus(prof); } return c; }
public void DisconnectProfile(ChannelProfile prof) { Env.Connections.ManualClose(prof); }
public void InsertAt(int index, ChannelProfile prof) { _data.Insert(index, prof); }
private void InitUI(ChannelProfile prof) { if (prof == null) { _localToRemoteOption.Checked = true; _passwordOption.Checked = true; } else { _nameBox.Text = prof.Name; _sshHostBox.Text = prof.SSHHost; _portBox.Text = prof.SSHPort.ToString(); _accountBox.Text = prof.SSHAccount; _noAuth.Checked = prof.Auth; //_udpOption.Checked = prof.ProtocolType==ProtocolType.Udp; if (prof.AuthType == AuthenticationType.Password) _passwordOption.Checked = true; else { _publicKeyOption.Checked = true; _privateKeyBox.Text = prof.PrivateKeyFile; } _loopbackOnly.Checked = !prof.AllowsForeignConnection; if (prof is LocalToRemoteChannelProfile) { LocalToRemoteChannelProfile p = (LocalToRemoteChannelProfile)prof; _localToRemoteOption.Checked = true; _LRLocalPortBox.Text = p.ListenPort.ToString(); _LRIPv6.Checked = p.UseIPv6; _LRRemoteHostBox.Text = p.DestinationHost; _LRRemotePortBox.Text = p.DestinationPort.ToString(); } else { RemoteToLocalChannelProfile p = (RemoteToLocalChannelProfile)prof; _remoteToLocalOption.Checked = true; _RLLocalPortBox.Text = p.DestinationPort.ToString(); _RLLocalHostBox.Text = p.DestinationHost; _RLRemotePortBox.Text = p.ListenPort.ToString(); } } }
public void ConnectProfile(ChannelProfile prof) { Env.Connections.GetOrCreateConnection(prof, Env.MainForm); }
public void ReplaceProfile(ChannelProfile p1, ChannelProfile p2) { _data[_data.IndexOf(p1)] = p2; }
private void OnOK(object sender, EventArgs args) { this.DialogResult = DialogResult.None; string itemname = null; try { if (_localToRemoteOption.Checked) _result = new LocalToRemoteChannelProfile(); else _result = new RemoteToLocalChannelProfile(); if (_sshHostBox.Text.Length == 0) throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptySSHServer")); _result.SSHHost = _sshHostBox.Text; if (_accountBox.Text.Length == 0) throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptyAccount")); _result.SSHAccount = _accountBox.Text; _result.AuthType = _publicKeyOption.Checked ? AuthenticationType.PublicKey : AuthenticationType.Password; if (_result.AuthType == AuthenticationType.PublicKey) _result.PrivateKeyFile = _privateKeyBox.Text; _result.Name = _nameBox.Text; itemname = Env.Strings.GetString("Caption.ProfileEdit.SSHPortNumber"); _result.SSHPort = Util.ParsePort(_portBox.Text); _result.ProtocolType = ProtocolType.Tcp; _result.AllowsForeignConnection = !_loopbackOnly.Checked; if (_localToRemoteOption.Checked) { LocalToRemoteChannelProfile p = (LocalToRemoteChannelProfile)_result; itemname = Env.Strings.GetString("Caption.ProfileEdit.LocalPort"); p.ListenPort = Util.ParsePort(_LRLocalPortBox.Text); if (_LRRemoteHostBox.Text.Length == 0) throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptyRemoveHost")); p.DestinationHost = _LRRemoteHostBox.Text; itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationPort"); p.DestinationPort = Util.ParsePort(_LRRemotePortBox.Text); p.UseIPv6 = _LRIPv6.Checked; } else { RemoteToLocalChannelProfile p = (RemoteToLocalChannelProfile)_result; itemname = Env.Strings.GetString("Caption.ProfileEdit.RemotePort"); p.ListenPort = Util.ParsePort(_RLRemotePortBox.Text); itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationHost"); p.DestinationHost = _RLLocalHostBox.Text; itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationPort"); p.DestinationPort = Util.ParsePort(_RLLocalPortBox.Text); p.AllowsForeignConnection = !_loopbackOnly.Checked; /* if(_udpOption.Checked && _loopbackOnly.Checked) { throw new Exception("リモートからローカルへのUDPの転送をするときはLoopback以外からの接続を許可する必要があります。"); } */ } this.DialogResult = DialogResult.OK; } catch (FormatException) { Util.Warning(this, String.Format(Env.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname)); } catch (Exception ex) { Util.Warning(this, ex.Message); } }
public void AddProfile(ChannelProfile p) { _data.Add(p); }
public void RemoveProfile(ChannelProfile p) { _data.Remove(p); }
private void OnOK(object sender, EventArgs args) { this.DialogResult = DialogResult.None; string itemname = null; try { if (_localToRemoteOption.Checked) { _result = new LocalToRemoteChannelProfile(); } else { _result = new RemoteToLocalChannelProfile(); } if (_sshHostBox.Text.Length == 0) { throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptySSHServer")); } _result.SSHHost = _sshHostBox.Text; if (_accountBox.Text.Length == 0) { throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptyAccount")); } _result.SSHAccount = _accountBox.Text; _result.AuthType = _publicKeyOption.Checked ? AuthenticationType.PublicKey : AuthenticationType.Password; if (_result.AuthType == AuthenticationType.PublicKey) { _result.PrivateKeyFile = _privateKeyBox.Text; } itemname = Env.Strings.GetString("Caption.ProfileEdit.SSHPortNumber"); _result.SSHPort = Util.ParsePort(_portBox.Text); _result.ProtocolType = ProtocolType.Tcp; _result.AllowsForeignConnection = !_loopbackOnly.Checked; if (_localToRemoteOption.Checked) { LocalToRemoteChannelProfile p = (LocalToRemoteChannelProfile)_result; itemname = Env.Strings.GetString("Caption.ProfileEdit.LocalPort"); p.ListenPort = Util.ParsePort(_LRLocalPortBox.Text); if (_LRRemoteHostBox.Text.Length == 0) { throw new Exception(Env.Strings.GetString("Message.ProfileEdit.EmptyRemoveHost")); } p.DestinationHost = _LRRemoteHostBox.Text; itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationPort"); p.DestinationPort = Util.ParsePort(_LRRemotePortBox.Text); p.UseIPv6 = _LRIPv6.Checked; } else { RemoteToLocalChannelProfile p = (RemoteToLocalChannelProfile)_result; itemname = Env.Strings.GetString("Caption.ProfileEdit.RemotePort"); p.ListenPort = Util.ParsePort(_RLRemotePortBox.Text); itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationHost"); p.DestinationHost = _RLLocalHostBox.Text; itemname = Env.Strings.GetString("Caption.ProfileEdit.DestinationPort"); p.DestinationPort = Util.ParsePort(_RLLocalPortBox.Text); p.AllowsForeignConnection = !_loopbackOnly.Checked; /* * if(_udpOption.Checked && _loopbackOnly.Checked) { * throw new Exception("リモートからローカルへのUDPの転送をするときはLoopback以外からの接続を許可する必要があります。"); * } */ } this.DialogResult = DialogResult.OK; } catch (FormatException) { Util.Warning(this, String.Format(Env.Strings.GetString("Message.OptionDialog.InvalidItem"), itemname)); } catch (Exception ex) { Util.Warning(this, ex.Message); } }
public static IPAddress ChannelProfileToListeningAddress(ChannelProfile prof) { if (prof.UseIPv6) return prof.AllowsForeignConnection ? IPAddress.IPv6Any : IPAddress.IPv6Loopback; else return prof.AllowsForeignConnection ? IPAddress.Any : IPAddress.Loopback; }
public static Color GetProfileStatusColor(ChannelProfile prof) { return Env.Connections.IsConnected(prof) ? Color.GreenYellow : Color.White; }
public static string GetProfileStatusString(ChannelProfile prof) { return Env.Strings.GetString(Env.Connections.IsConnected(prof) ? "Caption.Util.Connected" : "Caption.Util.Disconnected"); }
public static string GetProfileTypeString(ChannelProfile prof) { if (prof is LocalToRemoteChannelProfile) return Env.Strings.GetString("Caption.Util.Local"); else return Env.Strings.GetString("Caption.Util.Remote"); }
/* private static Socks CreateSocksParam(string dest_host, int dest_port) { Socks s = new Socks(); s.DestName = dest_host; s.DestPort = (short)dest_port; s.Account = Env.Options.SocksAccount; s.Password = Env.Options.SocksPassword; s.ServerName = Env.Options.SocksServer; s.ServerPort = (short)Env.Options.SocksPort; s.ExcludingNetworks = Env.Options.SocksNANetworks; return s; } */ public void ManualClose(ChannelProfile prof) { if (!IsConnected(prof)) { Debug.WriteLine("ManualClose - Not connected"); return; } lock (this) { ISSHConnection c = (ISSHConnection)_profileToConnection[prof]; _manualClosingConnections.Add(c); c.Disconnect(DisconnectionReasonCode.ByApplication, "close by application"); } }
public int IndexOf(ChannelProfile p) { return _data.IndexOf(p); }
public static string GetProfileStatusString(ChannelProfile prof) { return(Env.Strings.GetString(Env.Connections.IsConnected(prof) ? "Caption.Util.Connected" : "Caption.Util.Disconnected")); }
public bool IsConnected(ChannelProfile prof) { return _profileToConnection[prof] != null; }
private ListViewItem FindItem(ChannelProfile prof) { foreach (ListViewItem li in _list.Items) { if (li.Tag == prof) return li; } return null; }
public SSHConnector(ChannelProfile prof, string password, VerifySSHHostKeyDelegate keycheck) { _profile = prof; _password = password; _keycheck = keycheck; }
public int IndexOf(ChannelProfile p) { return(_data.IndexOf(p)); }