//EXTP使用 public void ApplyParam() { ICygwinParameter parameter = null; ITerminalSettings settings = null; if (_loginDialogUISupport != null) { ITerminalParameter tp = null; _loginDialogUISupport.FillTopDestination(typeof(ICygwinParameter), out tp, out settings); parameter = tp == null ? null : (ICygwinParameter)tp.GetAdapter(typeof(ICygwinParameter)); } if (parameter == null) { parameter = TerminalSessionsPlugin.Instance.ProtocolService.CreateDefaultCygwinParameter(); } if (settings == null) { settings = CygwinPlugin.Instance.CreateDefaultCygwinTerminalSettings(); } IAutoExecMacroParameter autoExecParams = parameter.GetAdapter(typeof(IAutoExecMacroParameter)) as IAutoExecMacroParameter; if (autoExecParams != null && CygwinPlugin.Instance.MacroEngine != null) { _autoExecMacroPathBox.Text = (autoExecParams.AutoExecMacroPath != null) ? autoExecParams.AutoExecMacroPath : String.Empty; } else { _autoExecMacroPathLabel.Enabled = false; _autoExecMacroPathBox.Enabled = false; _selectAutoExecMacroButton.Enabled = false; } ApplyParam(parameter, settings); }
private void ApplyParam(ICygwinParameter shellparam, ITerminalSettings terminalSettings) { _param = (ICygwinParameter)shellparam.Clone(); this.TerminalSettings = terminalSettings.Clone(); this.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog.TextCygwin"); }
public void ApplyLoginDialogInfo(ITelnetSSHLoginDialogInitializeInfo info) { foreach (MRUItem item in _data) { ITerminalParameter tp = item.TerminalParameter; ITCPParameter tcp = (ITCPParameter)tp.GetAdapter(typeof(ITCPParameter)); ISSHLoginParameter ssh = (ISSHLoginParameter)tp.GetAdapter(typeof(ISSHLoginParameter)); ICygwinParameter cygwin = (ICygwinParameter)tp.GetAdapter(typeof(ICygwinParameter)); if (tcp != null) { info.AddHost(tcp.Destination); } if (tcp != null) { info.AddPort(tcp.Port); } if (ssh != null) { info.AddIdentityFile(ssh.IdentityFileName); } if (ssh != null) { info.AddAccount(ssh.Account); } } }
public static string FormatItemDescription(MRUItem item) { ITerminalParameter param = item.TerminalParameter; string suffix = ""; ICygwinParameter cygwin = (ICygwinParameter)param.GetAdapter(typeof(ICygwinParameter)); if (cygwin != null) { suffix = "- Cygwin"; } ISSHLoginParameter ssh = (ISSHLoginParameter)param.GetAdapter(typeof(ISSHLoginParameter)); ITCPParameter tcp = (ITCPParameter)param.GetAdapter(typeof(ITCPParameter)); if (ssh != null) { suffix = String.Format("- {0}", ssh.Method.ToString()); } else if (tcp != null) { suffix = "- Telnet"; } return(String.Format("{0} {1}", item.TerminalSettings.Caption, suffix)); }
internal override ITerminalParameter ConvertToTerminalParameter() { ICygwinParameter cygwin = MacroPlugin.Instance.ProtocolService.CreateDefaultCygwinParameter(); cygwin.Home = _home; cygwin.ShellName = _shell; return((ITerminalParameter)cygwin.GetAdapter(typeof(ITerminalParameter))); }
protected static void PrepareEnv(ProcessStartInfo psi, ICygwinParameter p) { string cygdir = CygwinUtil.GuessRootDirectory(p.CygwinDir); string cygbin = System.IO.Path.Combine(cygdir, "bin"); string path = psi.EnvironmentVariables["PATH"]; psi.EnvironmentVariables.Remove("PATH"); psi.EnvironmentVariables.Add("PATH", PathListAppend(cygbin, path)); }
public ITerminalConnection EstablishConnection(IPoderosaMainWindow window, ITerminalParameter destination, ITerminalSettings settings) { ICygwinParameter cygwin = (ICygwinParameter)destination.GetAdapter(typeof(ICygwinParameter)); IProtocolService ps = TerminalSessionsPlugin.Instance.ProtocolService; ISynchronizedConnector sc = ps.CreateFormBasedSynchronozedConnector(window); IInterruptable t = ps.AsyncCygwinConnect(sc.InterruptableConnectorClient, cygwin); ITerminalConnection con = sc.WaitConnection(t, TerminalSessionsPlugin.Instance.TerminalSessionOptions.TerminalEstablishTimeout); AdjustCaptionAndText(settings, cygwin.ShellBody, StartCommandIcon.Cygwin); return(con); }
//接続先のSocketを準備して返す。失敗すればparentを親にしてエラーを表示し、nullを返す。 internal static ITerminalConnection PrepareSocket(IPoderosaForm parent, ICygwinParameter param) { try { return new Connector(param).Connect(); } catch (Exception ex) { //string key = IsCygwin(param)? "Message.CygwinUtil.FailedToConnect" : "Message.SFUUtil.FailedToConnect"; string key = "Message.CygwinUtil.FailedToConnect"; parent.Warning(PEnv.Strings.GetString(key) + ex.Message); return null; } }
//接続先のSocketを準備して返す。失敗すればparentを親にしてエラーを表示し、nullを返す。 internal static ITerminalConnection PrepareSocket(IPoderosaForm parent, ICygwinParameter param) { try { return(new Connector(param).Connect()); } catch (Exception ex) { //string key = IsCygwin(param)? "Message.CygwinUtil.FailedToConnect" : "Message.SFUUtil.FailedToConnect"; string key = "Message.CygwinUtil.FailedToConnect"; parent.Warning(PEnv.Strings.GetString(key) + ex.Message); return(null); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (_param == null) { _param = TerminalSessionsPlugin.Instance.ProtocolService.CreateDefaultCygwinParameter(); } _homeDirectoryBox.Text = _param.Home; _shellBox.Text = _param.ShellName; _logTypeBox.SelectedIndex = 0; _encodingBox.SelectedIndex = (int)this.TerminalSettings.Encoding; _terminalTypeBox.SelectedIndex = (int)this.TerminalSettings.TerminalType; _cygwinDirBox.Text = _param.CygwinDir; AdjustUI(); }
protected static void PrepareEnv(ProcessStartInfo psi, ICygwinParameter p) { string path = psi.EnvironmentVariables["PATH"]; string cygwinDir = p.CygwinDir; if (cygwinDir == null || cygwinDir.Length == 0) { cygwinDir = CygwinUtil.GuessRootDirectory(); } if (path == null) { path = String.Empty; } else if (!path.EndsWith(";")) { path += ";"; } path += cygwinDir + "\\bin"; psi.EnvironmentVariables.Remove("PATH"); psi.EnvironmentVariables.Add("PATH", path); }
public IInterruptable AsyncCygwinConnect(IInterruptableConnectorClient result_client, ICygwinParameter destination) { return(LocalShellUtil.AsyncPrepareSocket(result_client, destination)); }
public Connector(ICygwinParameter param, IInterruptableConnectorClient client) { _param = param; _client = client; }
public Connector(ICygwinParameter param) { _param = param; }
public static Connector AsyncPrepareSocket(IInterruptableConnectorClient client, ICygwinParameter param) { Connector c = new Connector(param, client); new Thread(new ThreadStart(c.AsyncConnect)).Start(); return c; }
protected static void PrepareEnv(ProcessStartInfo psi, ICygwinParameter p) { string path = psi.EnvironmentVariables["PATH"]; string cygwinDir = p.CygwinDir; if (cygwinDir == null || cygwinDir.Length == 0) cygwinDir = CygwinUtil.GuessRootDirectory(); if (path == null) path = String.Empty; else if (!path.EndsWith(";")) path += ";"; path += cygwinDir + "\\bin"; psi.EnvironmentVariables.Remove("PATH"); psi.EnvironmentVariables.Add("PATH", path); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (_param == null) _param = TerminalSessionsPlugin.Instance.ProtocolService.CreateDefaultCygwinParameter(); _homeDirectoryBox.Text = _param.Home; _shellBox.Text = _param.ShellName; _logTypeBox.SelectedItem = LogType.None; // select EnumListItem<T> by T _encodingBox.SelectedItem = this.TerminalSettings.Encoding; // select EnumListItem<T> by T _terminalTypeBox.SelectedItem = this.TerminalSettings.TerminalType; // select EnumListItem<T> by T _cygwinDirBox.Text = _param.CygwinDir; AdjustUI(); }
public static Connector AsyncPrepareSocket(IInterruptableConnectorClient client, ICygwinParameter param) { Connector c = new Connector(param, client); new Thread(new ThreadStart(c.AsyncConnect)).Start(); return(c); }
public bool IsSupporting(ITerminalParameter param, ITerminalSettings settings) { ICygwinParameter cygwin = (ICygwinParameter)param.GetAdapter(typeof(ICygwinParameter)); return(cygwin != null); }
public IInterruptable AsyncCygwinConnect(IInterruptableConnectorClient result_client, ICygwinParameter destination) { return LocalShellUtil.AsyncPrepareSocket(result_client, destination); }
//cygwinの同期的接続 public static ITerminalConnection CreateNewLocalShellConnection(IPoderosaForm form, ICygwinParameter param) { return(LocalShellUtil.PrepareSocket(form, param)); }
//cygwinの同期的接続 public static ITerminalConnection CreateNewLocalShellConnection(IPoderosaForm form, ICygwinParameter param) { return LocalShellUtil.PrepareSocket(form, param); }