public object Deserialize(StructuredText node) { TerminalSettings ts = new TerminalSettings(); ts.BeginUpdate(); ts.Encoding = (EncodingType)EnumDescAttribute.For(typeof(EncodingType)).FromDescription(node.Get("encoding", ""), EncodingType.ISO8859_1); ts.TerminalType = ParseUtil.ParseEnum <TerminalType>(node.Get("terminal-type"), TerminalType.XTerm); ts.LocalEcho = ParseUtil.ParseBool(node.Get("localecho"), false); ts.LineFeedRule = ParseUtil.ParseEnum <LineFeedRule>(node.Get("linefeedrule"), LineFeedRule.Normal); ts.TransmitNL = ParseUtil.ParseEnum <NewLine>(node.Get("transmit-nl"), NewLine.CR); ts.EnabledCharTriggerIntelliSense = ParseUtil.ParseBool(node.Get("char-trigger-intellisense"), false); string shellscheme = node.Get("shellscheme", ShellSchemeCollection.DEFAULT_SCHEME_NAME); if (shellscheme.Length > 0) { ts.SetShellSchemeName(shellscheme); } ts.Caption = node.Get("caption", ""); #if !UNITTEST //現在テストではRenderProfileは対象外 StructuredText rp = node.FindChild(typeof(RenderProfile).FullName); if (rp != null) { ts.RenderProfile = _serializeService.Deserialize(rp) as RenderProfile; } #endif ts.EndUpdate(); return(ts); }
private void FillText() { StringResource sr = OptionDialogPlugin.Instance.Strings; this._charDecodeErrorBehaviorLabel.Text = sr.GetString("Form.OptionDialog._charDecodeErrorBehaviorLabel"); this._bufferSizeLabel.Text = sr.GetString("Form.OptionDialog._bufferSizeLabel"); this._disconnectNotificationLabel.Text = sr.GetString("Form.OptionDialog._disconnectNotificationLabel"); this._closeOnDisconnect.Text = sr.GetString("Form.OptionDialog._closeOnDisconnect"); this._beepOnBellChar.Text = sr.GetString("Form.OptionDialog._beepOnBellChar"); this._allowsScrollInAppMode.Text = sr.GetString("Form.OptionDialog._allowsScrollInAppMode"); this._keepAliveCheck.Text = sr.GetString("Form.OptionDialog._keepAliveCheck"); this._keepAliveLabel.Text = sr.GetString("Form.OptionDialog._keepAliveLabel"); this._defaultLogTypeLabel.Text = sr.GetString("Form.OptionDialog._defaultLogTypeLabel"); this._defaultLogDirectoryLabel.Text = sr.GetString("Form.OptionDialog._defaultLogDirectoryLabel"); this._autoLogCheckBox.Text = sr.GetString("Form.OptionDialog._autoLogCheckBox"); this._additionalWordElementLabel.Text = sr.GetString("Form.OptionDialog._additionalWordElementLabel"); this._shellSupportGroup.Text = sr.GetString("Form.OptionDialog._shellSupportGroup"); this._enableComplementForNewConnections.Text = sr.GetString("Form.OptionDialog._enableComplementForNewConnections"); this._commandPopupAlwaysOnTop.Text = sr.GetString("Form.OptionDialog._commandPopupAlwaysOnTop"); this._commandPopupInTaskBar.Text = sr.GetString("Form.OptionDialog._commandPopupInTaskBar"); this._alertOnPasteNewLineCharCheck.Text = sr.GetString("Form.OptionDialog._alertOnPasteNewLineCharCheck"); _charDecodeErrorBehaviorBox.Items.AddRange(EnumDescAttribute.For(typeof(WarningOption)).DescriptionCollection()); _disconnectNotification.Items.AddRange(EnumDescAttribute.For(typeof(WarningOption)).DescriptionCollection()); _defaultLogTypeBox.Items.AddRange(new object[] { EnumDescAttribute.For(typeof(LogType)).GetDescription(LogType.Default), EnumDescAttribute.For(typeof(LogType)).GetDescription(LogType.Binary), EnumDescAttribute.For(typeof(LogType)).GetDescription(LogType.Xml) }); }
public EditRenderProfile(RenderProfile prof) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); StringResource sr = TerminalUIPlugin.Instance.Strings; _imageStyleBox.Items.AddRange(EnumDescAttribute.For(typeof(ImageStyle)).DescriptionCollection()); this._bgColorLabel.Text = sr.GetString("Form.EditRenderProfile._bgColorLabel"); this._textColorLabel.Text = sr.GetString("Form.EditRenderProfile._textColorLabel"); this._fontSelectButton.Text = sr.GetString("Form.EditRenderProfile._fontSelectButton"); this._fontLabel.Text = sr.GetString("Form.EditRenderProfile._fontLabel"); this._backgroundImageLabel.Text = sr.GetString("Form.EditRenderProfile._backgroungImageLabel"); this._imageStyleLabel.Text = sr.GetString("Form.EditRenderProfile._imageStyleLabel"); this._cancelButton.Text = sr.GetString("Common.Cancel"); this._okButton.Text = sr.GetString("Common.OK"); this._setToDefaultButton.Text = sr.GetString("Form.EditRenderProfile._setToDefaultButton"); this._fontSample.Text = sr.GetString("Common.FontSample"); this._editColorEscapeSequence.Text = sr.GetString("Form.EditRenderProfile._editEscapeSequenceColorBox"); this.Text = sr.GetString("Form.EditRenderProfile.Text"); _profile = prof == null?TerminalUIPlugin.Instance.TerminalEmulatorPlugin.TerminalEmulatorOptions.CreateRenderProfile() : (RenderProfile)prof.Clone(); InitUI(); }
public LocalShellLoginDialog(IPoderosaMainWindow parentWindow) : base(parentWindow) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); // // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。 // this._loginButton.Text = TEnv.Strings.GetString("Common.OK"); this._cancelButton.Text = TEnv.Strings.GetString("Common.Cancel"); this._homeDirectoryLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._homeDirectoryLabel"); this._lMessage.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._lMessage"); this._advancedOptionCheck.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._advancedOptionCheck"); this._shellLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._shellLabel"); this._logFileLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._logFileLabel"); this._logTypeLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._logTypeLabel"); this._encodingLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._encodingLabel"); this._terminalTypeLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._terminalTypeLabel"); this._cygwinDirLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._cygwinDirLabel"); this._autoExecMacroPathLabel.Text = TEnv.Strings.GetString("Form.CygwinLoginDialog._autoExecMacroPathLabel"); this._logTypeBox.Items.AddRange(EnumDescAttribute.For(typeof(LogType)).DescriptionCollection()); this._encodingBox.Items.AddRange(EnumDescAttribute.For(typeof(EncodingType)).DescriptionCollection()); this._terminalTypeBox.Items.AddRange(EnumDescAttribute.For(typeof(TerminalType)).DescriptionCollection()); //作っておく AdjustLoginDialogUISupport("org.poderosa.terminalsessions.loginDialogUISupport", "cygwinLoginDialogUISupport"); }
public void Import(ConfigNode data) { CommonOptions opt = GEnv.Options; _fontName = data["font-name"]; if (_fontName == null) { _fontName = opt.FontName; } _japaneseFontName = data["japanese-font-name"]; if (_japaneseFontName == null) { _japaneseFontName = opt.JapaneseFontName; } _fontSize = (float)GUtil.ParseInt(data["font-size"], 10); _useClearType = GUtil.ParseBool(data["clear-type"], false); ClearFont(); unchecked { _forecolor = Color.FromArgb(GUtil.ParseHexInt(data["fore-color"], (int)0xFF000000)); _bgcolor = Color.FromArgb(GUtil.ParseHexInt(data["back-color"], (int)0xFFFFFFFF)); } if (_esColorSet == null) { _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone(); } _esColorSet.Load(data["color-sequence"]); ClearBrush(); _backgroundImageFileName = data["image-file"]; _imageLoadIsAttempted = false; _imageStyle = (ImageStyle)EnumDescAttribute.For(typeof(ImageStyle)).FromName(data["bg-style"], ImageStyle.Center); }
private void FillText() { StringResource sr = OptionDialogPlugin.Instance.Strings; this._mouseGroup.Text = sr.GetString("Form.OptionDialog._mouseGroup"); this._keyboardGroup.Text = sr.GetString("Form.OptionDialog._keyboardGroup"); this._leftAltKeyLabel.Text = sr.GetString("Form.OptionDialog._leftAltKeyLabel"); this._rightAltKeyLabel.Text = sr.GetString("Form.OptionDialog._rightAltKeyLabel"); this._send0x7FByDel.Text = sr.GetString("Form.OptionDialog._send0x7FByDel"); this._send0x7FByBack.Text = sr.GetString("Form.OptionDialog._send0x7FByBack"); this._autoCopyByLeftButton.Text = sr.GetString("Form.OptionDialog._autoCopyByLeftButton"); this._viewSplitModifierLabel.Text = sr.GetString("Form.OptionDialog._viewSplitModifierLabel"); this._rightButtonActionLabel.Text = sr.GetString("Form.OptionDialog._rightButtonActionLabel"); this._middleButtonActionLabel.Text = sr.GetString("Form.OptionDialog._middleButtonActionLabel"); this._wheelAmountLabel.Text = sr.GetString("Form.OptionDialog._wheelAmountLabel"); this._zone0x1FLabel.Text = sr.GetString("Form.OptionDialog._zone0x1FLabel"); this._autoKeySettingsLabel.Text = sr.GetString("Form.OptionDialog._autoKeySettingsLabel"); this._customKeySettingsLabel.Text = sr.GetString("Form.OptionDialog._customKeySettingsLabel"); _leftAltKeyAction.Items.AddRange(EnumDescAttribute.For(typeof(AltKeyAction)).DescriptionCollection()); _rightAltKeyAction.Items.AddRange(EnumDescAttribute.For(typeof(AltKeyAction)).DescriptionCollection()); _rightButtonAction.Items.AddRange(EnumDescAttribute.For(typeof(MouseButtonAction)).DescriptionCollection()); _middleButtonAction.Items.AddRange(EnumDescAttribute.For(typeof(MouseButtonAction)).DescriptionCollection()); _zone0x1FBox.Items.AddRange(EnumDescAttribute.For(typeof(KeyboardStyle)).DescriptionCollection()); //NOTE 独自のEnum用意するのがいいのかなあ _viewSplitModifierBox.Items.AddRange(new string[] { sr.GetString("Caption.KeysNone"), "Ctrl", "Shift", "Alt" }); }
public SSHShortcutLoginDialog(IPoderosaMainWindow parent, ISSHLoginParameter param, ITerminalSettings settings) : base(parent) { this.TerminalSettings = settings; // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); this._privateKeyLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._privateKeyLabel"); this._passphraseLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._passphraseLabel"); this._logFileLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._logFileLabel"); this._hostLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._hostLabel"); this._methodLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._methodLabel"); this._accountLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._accountLabel"); this._authenticationTypeLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._authenticationTypeLabel"); this._encodingLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._encodingLabel"); this._logTypeLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._logTypeLabel"); this.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog.Text"); this._autoExecMacroPathLabel.Text = TEnv.Strings.GetString("Form.SSHShortcutLoginDialog._autoExecMacroPathLabel"); this._cancelButton.Text = TEnv.Strings.GetString("Common.Cancel"); this._loginButton.Text = TEnv.Strings.GetString("Common.OK"); this._logTypeBox.Items.AddRange(EnumDescAttribute.For(typeof(LogType)).DescriptionCollection()); _sshParam = param; InitUI(); }
public ChangeLog(ITerminalSession session) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); StringResource sr = TerminalUIPlugin.Instance.Strings; this._logTypeLabel.Text = sr.GetString("Form.ChangeLog._logTypeLabel"); this._fileNameLabel.Text = sr.GetString("Form.ChangeLog._fileNameLabel"); this._cancelButton.Text = sr.GetString("Common.Cancel"); this._okButton.Text = sr.GetString("Common.OK"); this.Text = sr.GetString("Form.ChangeLog.Text"); this._logTypeBox.Items.AddRange(EnumDescAttribute.For(typeof(LogType)).DescriptionCollection()); _session = session; ISimpleLogSettings ls = GetSimpleLogSettings(); if (ls != null) { _logTypeBox.SelectedIndex = (int)ls.LogType; if (ls.LogType != LogType.None) { _fileNameBox.Items.Add(ls.LogPath); _fileNameBox.SelectedIndex = 0; } } else { _logTypeBox.SelectedIndex = 0; } AdjustUI(); }
private void OnOK(object sender, EventArgs args) { this.DialogResult = DialogResult.None; ISimpleLogSettings ls = TerminalUIPlugin.Instance.TerminalEmulatorPlugin.CreateDefaultSimpleLogSettings(); LogType t = (LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None); string path = null; bool append = false; if (t != LogType.None) { path = _fileNameBox.Text; LogFileCheckResult r = LogUtil.CheckLogFileName(path, this); if (r == LogFileCheckResult.Cancel || r == LogFileCheckResult.Error) { return; } append = (r == LogFileCheckResult.Append); } ls.LogType = t; ls.LogPath = path; ls.LogAppend = append; _session.Terminal.ILogService.ApplyLogSettings(ls, true); this.DialogResult = DialogResult.OK; }
private void AdjustUI() { bool e = ((LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None) != LogType.None); _fileNameBox.Enabled = e; _selectlogButton.Enabled = e; }
private bool ValidateParam() { SerialTerminalSettings settings = _terminalSettings; SerialTerminalParam param = _terminalParam; try { LogType logtype = (LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None); ISimpleLogSettings logsettings = null; if (logtype != LogType.None) { logsettings = CreateSimpleLogSettings(logtype, _logFileBox.Text); if (logsettings == null) { return(false); //動作キャンセル } } param.Port = _portBox.SelectedIndex + 1; string autoExecMacroPath = null; if (_autoExecMacroPathBox.Text.Length != 0) { autoExecMacroPath = _autoExecMacroPathBox.Text; } IAutoExecMacroParameter autoExecParams = param.GetAdapter(typeof(IAutoExecMacroParameter)) as IAutoExecMacroParameter; if (autoExecParams != null) { autoExecParams.AutoExecMacroPath = autoExecMacroPath; } settings.BeginUpdate(); if (logsettings != null) { settings.LogSettings.Reset(logsettings); } settings.Caption = String.Format("COM{0}", param.Port); settings.BaudRate = Int32.Parse(_baudRateBox.Text); settings.ByteSize = (byte)(_dataBitsBox.SelectedIndex == 0? 7 : 8); settings.StopBits = (StopBits)_stopBitsBox.SelectedIndex; settings.Parity = (Parity)_parityBox.SelectedIndex; settings.FlowControl = (FlowControl)_flowControlBox.SelectedIndex; settings.Encoding = (EncodingType)_encodingBox.SelectedIndex; settings.LocalEcho = _localEchoBox.SelectedIndex == 1; settings.TransmitNL = (NewLine)EnumDescAttribute.For(typeof(NewLine)).FromDescription(_newLineBox.Text, LogType.None); settings.TransmitDelayPerChar = Int32.Parse(_transmitDelayPerCharBox.Text); settings.TransmitDelayPerLine = Int32.Parse(_transmitDelayPerLineBox.Text); settings.EndUpdate(); return(true); } catch (Exception ex) { GUtil.Warning(this, ex.Message); return(false); } }
private static void ReloadStringResource() { if (_stringResource != null) { EnumDescAttribute.RemoveResourceTable(typeof(GEnv).Assembly, _stringResource); } _stringResource = new StringResource("Poderosa.TerminalEmulator.strings", typeof(GEnv).Assembly, true); TerminalEmulatorPlugin.Instance.PoderosaWorld.Culture.AddChangeListener(_stringResource); }
protected override ITerminalParameter PrepareTerminalParameter() { _param.Home = _homeDirectoryBox.Text; _param.ShellName = _shellBox.Text; //ログ設定 LogType logtype = (LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None); ISimpleLogSettings logsettings = null; if (logtype != LogType.None) { logsettings = CreateSimpleLogSettings(logtype, _logFileBox.Text); if (logsettings == null) { return(null); //動作キャンセル } } ITerminalSettings settings = this.TerminalSettings; settings.BeginUpdate(); if (logsettings != null) { settings.LogSettings.Reset(logsettings); } settings.Caption = _param.ShellBody; settings.Icon = Poderosa.TerminalSession.Properties.Resources.Cygwin16x16; settings.Encoding = (EncodingType)_encodingBox.SelectedIndex; settings.TerminalType = (TerminalType)_terminalTypeBox.SelectedIndex; settings.EndUpdate(); ITerminalParameter termParam = (ITerminalParameter)_param.GetAdapter(typeof(ITerminalParameter)); termParam.SetTerminalName(_terminalTypeBox.Text); // Used for TERM environment variable (LocalShellUtil) _param.CygwinDir = _cygwinDirBox.Text; if (_param.CygwinDir.Length > 0 && _param.CygwinDir[_param.CygwinDir.Length - 1] == Path.PathSeparator) { _param.CygwinDir = _param.CygwinDir.Substring(0, _param.CygwinDir.Length - 1); } string autoExecMacroPath = null; if (_autoExecMacroPathBox.Text.Length != 0) { autoExecMacroPath = _autoExecMacroPathBox.Text; } IAutoExecMacroParameter autoExecParams = _param.GetAdapter(typeof(IAutoExecMacroParameter)) as IAutoExecMacroParameter; if (autoExecParams != null) { autoExecParams.AutoExecMacroPath = autoExecMacroPath; } return((ITerminalParameter)_param.GetAdapter(typeof(ITerminalParameter))); }
private void ProcessSequence(byte[] response) { if (response[1] == 1) { if (response[0] == (byte)TelnetOption.TerminalType) { _optionWriter.WriteTerminalName(EnumDescAttribute.For(typeof(TerminalType)).GetDescription(_param.TerminalType)); } } }
private void Init(string name, Assembly asm, bool register_enumdesc) { _resourceName = name; _asm = asm; LoadResourceManager(); if (register_enumdesc) { EnumDescAttribute.AddResourceTable(asm, this); } }
private static void SaveEnvironment() { //OptionDialogで、レジストリへの書き込み権限がないとOptionPreservePlaceは変更できないようにしてあるのでWritableなときだけ書いておけばOK if (IsRegistryWritable) { RegistryKey g = Registry.CurrentUser.CreateSubKey(GCConst.REGISTRY_PATH); g.SetValue("option-place", EnumDescAttribute.For(typeof(OptionPreservePlace)).GetName(_options.OptionPreservePlace)); } if (Win32.WaitForSingleObject(_globalMutex, 10000) != Win32.WAIT_OBJECT_0) { throw new Exception("Global mutex lock error"); } try { string dir = GetOptionDirectory(_options.OptionPreservePlace); TextWriter wr = null; try { if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } _sshKnownHosts.WriteTo(dir + "ssh_known_hosts"); wr = new StreamWriter(dir + "options.conf", false, Encoding.Default); } catch (Exception ex) { //GUtil.ReportCriticalError(ex); GUtil.Warning(Form.ActiveForm, String.Format(GApp.Strings.GetString("Message.GApp.WriteError"), ex.Message, dir)); } if (wr != null) { try { ConfigNode node = new ConfigNode("poderosa"); _options.Save(node); _history.Save(node); _macroManager.Save(node); wr.WriteLine(GCConst.CONFIG_HEADER); node.WriteTo(wr); wr.Close(); } catch (Exception ex) { GUtil.ReportCriticalError(ex); } } } finally { Win32.ReleaseMutex(_globalMutex); } }
private void FillText() { StringResource sr = OptionDialogPlugin.Instance.Strings; this._MRUSizeLabel.Text = sr.GetString("Form.OptionDialog._MRUSizeLabel"); this._askCloseOnExit.Text = sr.GetString("Form.OptionDialog._askCloseOnExit"); this._languageLabel.Text = sr.GetString("Form.OptionDialog._languageLabel"); this._showToolBar.Text = sr.GetString("Form.OptionDialog._showToolBar"); this._startupOptionLabel.Text = sr.GetString("Form.OptionDialog._startupOptionLabel"); _languageBox.Items.AddRange(EnumDescAttribute.For(typeof(Language)).DescriptionCollection()); _startupOptionBox.Items.AddRange(EnumDescAttribute.For(typeof(StartupAction)).DescriptionCollection()); }
private static OptionPreservePlace GetOptionPreservePlace() { RegistryKey g = Registry.CurrentUser.OpenSubKey(REGISTRY_PATH, false); if (g == null) { return(OptionPreservePlace.AppData); } else { return((OptionPreservePlace)EnumDescAttribute.For(typeof(OptionPreservePlace)).FromName((string)g.GetValue("option-place"), OptionPreservePlace.AppData)); } }
public SerialLoginDialog() { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); StringResource sr = SerialPortPlugin.Instance.Strings; this._serialGroup.Text = sr.GetString("Form.SerialLoginDialog._serialGroup"); //以下、SerialConfigとテキストを共用 this._portLabel.Text = sr.GetString("Form.SerialConfig._portLabel"); this._baudRateLabel.Text = sr.GetString("Form.SerialConfig._baudRateLabel"); this._dataBitsLabel.Text = sr.GetString("Form.SerialConfig._dataBitsLabel"); this._parityLabel.Text = sr.GetString("Form.SerialConfig._parityLabel"); this._stopBitsLabel.Text = sr.GetString("Form.SerialConfig._stopBitsLabel"); this._flowControlLabel.Text = sr.GetString("Form.SerialConfig._flowControlLabel"); this._transmitDelayPerLineLabel.Text = "Transmit Delay(line)"; this._transmitDelayPerCharLabel.Text = "Transmit Delay(char)"; string bits = sr.GetString("Caption.SerialConfig.Bits"); this._parityBox.Items.AddRange(EnumDescAttribute.For(typeof(Parity)).DescriptionCollection()); this._dataBitsBox.Items.AddRange(new object[] { String.Format("{0}{1}", 7, bits), String.Format("{0}{1}", 8, bits) }); this._stopBitsBox.Items.AddRange(EnumDescAttribute.For(typeof(StopBits)).DescriptionCollection()); this._baudRateBox.Items.AddRange(TerminalUtil.BaudRates); this._flowControlBox.Items.AddRange(EnumDescAttribute.For(typeof(FlowControl)).DescriptionCollection()); this._terminalGroup.Text = sr.GetString("Form.SerialLoginDialog._terminalGroup"); this._localEchoLabel.Text = sr.GetString("Form.SerialLoginDialog._localEchoLabel"); this._newLineLabel.Text = sr.GetString("Form.SerialLoginDialog._newLineLabel"); this._logFileLabel.Text = sr.GetString("Form.SerialLoginDialog._logFileLabel"); this._encodingLabel.Text = sr.GetString("Form.SerialLoginDialog._encodingLabel"); this._logTypeLabel.Text = sr.GetString("Form.SerialLoginDialog._logTypeLabel"); this._logTypeBox.Items.AddRange(EnumDescAttribute.For(typeof(LogType)).DescriptionCollection()); this._localEchoBox.Items.AddRange(new object[] { sr.GetString("Common.DoNot"), sr.GetString("Common.Do") }); this._newLineBox.Items.AddRange(EnumDescAttribute.For(typeof(NewLine)).DescriptionCollection()); this._encodingBox.Items.AddRange(EnumDescAttribute.For(typeof(EncodingType)).DescriptionCollection()); this._autoExecMacroPathLabel.Text = sr.GetString("Form.SerialLoginDialog._autoExecMacroPathLabel"); this._loginButton.Text = sr.GetString("Common.OK"); this._cancelButton.Text = sr.GetString("Common.Cancel"); this.Text = sr.GetString("Form.SerialLoginDialog.Text"); InitUI(); }
public virtual void Import(ConfigNode data) { _encoding = ParseEncoding(data["encoding"]); _terminalType = (TerminalType)EnumDescAttribute.For(typeof(TerminalType)).FromName(data["terminal-type"], TerminalType.VT100); _transmitnl = (NewLine)EnumDescAttribute.For(typeof(NewLine)).FromName(data["transmit-nl"], NewLine.CR); _localecho = GUtil.ParseBool(data["localecho"], false); //_lineFeedByCR = GUtil.ParseBool((string)data["linefeed-by-cr"], false); _lineFeedRule = (LineFeedRule)EnumDescAttribute.For(typeof(LineFeedRule)).FromName(data["linefeed"], LineFeedRule.Normal); _caption = data["caption"]; if (data.Contains("font-name")) //項目がなければ空のまま { _renderProfile = new RenderProfile(data); } }
private void InitUI() { ITCPParameter tcp = (ITCPParameter)_sshParam.GetAdapter(typeof(ITCPParameter)); _hostBox.Text = tcp.Destination; _methodBox.Text = _sshParam.Method.ToString(); //if(_sshParam.Port!=22) _methodBox.Text += String.Format(TEnv.Strings.GetString("Caption.SSHShortcutLoginDialog.NotStandardPort"), _sshParam.Port); _accountBox.Text = _sshParam.Account; _authenticationTypeBox.Text = _sshParam.AuthenticationType.ToString(); //さぼり _encodingBox.Text = EnumDescAttribute.For(typeof(EncodingType)).GetDescription(this.TerminalSettings.Encoding); _logTypeBox.SelectedIndex = 0; if (_sshParam.AuthenticationType == AuthenticationType.Password) { _privateKeyBox.Enabled = false; _privateKeySelect.Enabled = false; } else if (_sshParam.AuthenticationType == AuthenticationType.PublicKey) { _privateKeyBox.Text = _sshParam.IdentityFileName; } else if (_sshParam.AuthenticationType == AuthenticationType.KeyboardInteractive) { _privateKeyBox.Enabled = false; _privateKeySelect.Enabled = false; _passphraseBox.Enabled = false; } _passphraseBox.Text = ""; if (_sshParam.PasswordOrPassphrase.Length == 0 && TerminalSessionsPlugin.Instance.ProtocolService.ProtocolOptions.RetainsPassphrase) { string p = TerminalSessionsPlugin.Instance.ProtocolService.PassphraseCache.GetOrEmpty(tcp.Destination, _sshParam.Account); _passphraseBox.Text = p; } IAutoExecMacroParameter autoExecParams = _sshParam.GetAdapter(typeof(IAutoExecMacroParameter)) as IAutoExecMacroParameter; if (autoExecParams != null && TelnetSSHPlugin.Instance.MacroEngine != null) { _autoExecMacroPathBox.Text = (autoExecParams.AutoExecMacroPath != null) ? autoExecParams.AutoExecMacroPath : String.Empty; } else { _autoExecMacroPathLabel.Enabled = false; _autoExecMacroPathBox.Enabled = false; _selectAutoExecMacroButton.Enabled = false; } AdjustUI(); }
protected override void Negotiate() { SSHConnectionParameter con = new SSHConnectionParameter(); con.Protocol = _param.Method == ConnectionMethod.SSH1 ? SSHProtocol.SSH1 : SSHProtocol.SSH2; con.CheckMACError = GEnv.Options.SSHCheckMAC; con.UserName = _param.Account; con.Password = _password; con.AuthenticationType = _param.AuthType == AuthType.KeyboardInteractive ? AuthenticationType.KeyboardInteractive : _param.AuthType == AuthType.Password ? AuthenticationType.Password : AuthenticationType.PublicKey; con.IdentityFile = _param.IdentityFile; con.TerminalWidth = _size.Width; con.TerminalHeight = _size.Height; con.TerminalName = EnumDescAttribute.For(typeof(TerminalType)).GetDescription(_param.TerminalType); //con.TerminalName = "xterm"; con.WindowSize = GEnv.Options.SSHWindowSize; con.PreferableCipherAlgorithms = LocalSSHUtil.ParseCipherAlgorithm(GEnv.Options.CipherAlgorithmOrder); con.PreferableHostKeyAlgorithms = LocalSSHUtil.ParsePublicKeyAlgorithm(GEnv.Options.HostKeyAlgorithmOrder); if (_keycheck != null) { con.KeyCheck += new HostKeyCheckCallback(this.CheckKey); } SSHTerminalConnection r = new SSHTerminalConnection(_param, _size.Width, _size.Height); SSHConnection ssh = SSHConnection.Connect(con, r, _socket); if (ssh != null) { if (GEnv.Options.RetainsPassphrase) { _param.Passphrase = _password; } r.FixConnection(ssh); if (ssh.AuthenticationResult == AuthenticationResult.Success) { r.OpenShell(); } r.UsingSocks = _socks != null; r.SetServerInfo(_param.Host, this.IPAddress); _result = new ConnectionTag(r); } else { throw new IOException(GEnv.Strings.GetString("Message.SSHConnector.Cancelled")); } }
private void FillText() { StringResource sr = OptionDialogPlugin.Instance.Strings; this._useSocks.Text = sr.GetString("Form.OptionDialog._useSocks"); this._socksServerLabel.Text = sr.GetString("Form.OptionDialog._socksServerLabel"); this._socksPortLabel.Text = sr.GetString("Form.OptionDialog._socksPortLabel"); this._socksAccountLabel.Text = sr.GetString("Form.OptionDialog._socksAccountLabel"); this._socksPasswordLabel.Text = sr.GetString("Form.OptionDialog._socksPasswordLabel"); this._socksNANetworksLabel.Text = sr.GetString("Form.OptionDialog._socksNANetworksLabel"); _IPv6Group.Text = sr.GetString("Form.OptionDialog._IPv6Group"); _IPv6PriorityLabel.Text = sr.GetString("Form.OptionDialog._IPv6PriorityLabel"); _IPv6PriorityBox.Items.AddRange(EnumDescAttribute.For(typeof(IPVersionPriority)).DescriptionCollection()); }
//BACK-BURNER public virtual void Export(ConfigNode node) { node["encoding"] = EnumDescAttribute.For(typeof(EncodingType)).GetDescription(_encoding); node["terminal-type"] = EnumDescAttribute.For(typeof(TerminalType)).GetName(_terminalType); node["transmit-nl"] = EnumDescAttribute.For(typeof(NewLine)).GetName(_transmitnl); node["localecho"] = _localecho.ToString(); node["linefeed"] = EnumDescAttribute.For(typeof(LineFeedRule)).GetName(_lineFeedRule); if (_caption != null && _caption.Length > 0) { node["caption"] = _caption; } if (_renderProfile != null) { _renderProfile.Export(node); } }
private void FillText() { this._leftAltKeyLabel.Text = GApp.Strings.GetString("Form.OptionDialog._leftAltKeyLabel"); this._rightAltKeyLabel.Text = GApp.Strings.GetString("Form.OptionDialog._rightAltKeyLabel"); this._send0x7FByDel.Text = GApp.Strings.GetString("Form.OptionDialog._send0x7FByDel"); this._autoCopyByLeftButton.Text = GApp.Strings.GetString("Form.OptionDialog._autoCopyByLeftButton"); this._rightButtonActionLabel.Text = GApp.Strings.GetString("Form.OptionDialog._rightButtonActionLabel"); this._wheelAmountLabel.Text = GApp.Strings.GetString("Form.OptionDialog._wheelAmountLabel"); this._additionalWordElementLabel.Text = GApp.Strings.GetString("Form.OptionDialog._additionalWordElementLabel"); this._localBufferScrollModifierLabel.Text = GApp.Strings.GetString("Form.OptionDialog._localBufferScrollModifierLabel"); _leftAltKeyAction.Items.AddRange(EnumDescAttribute.For(typeof(AltKeyAction)).DescriptionCollection()); _rightAltKeyAction.Items.AddRange(EnumDescAttribute.For(typeof(AltKeyAction)).DescriptionCollection()); _rightButtonAction.Items.AddRange(EnumDescAttribute.For(typeof(RightButtonAction)).DescriptionCollection()); _localBufferScrollModifierBox.Items.AddRange(new object[] { "Control", "Shift" }); }
private void OnKeyMapItemActivated(object sender, EventArgs args) { if (_keyConfigList.SelectedItems.Count == 0) { return; } CID id = (CID)_keyConfigList.SelectedItems[0].Tag; Commands.Entry e = _commands.FindEntry(id); Debug.Assert(e != null); _hotKey.Key = e.Modifiers | e.Key; _commandName.Text = String.Format("{0} - {1}", EnumDescAttribute.For(typeof(Commands.Category)).GetDescription(e.Category), e.Description); _currentCommand.Text = e.KeyDisplayString; _allocateKeyButton.Enabled = true; }
private void EnableValidControls() { bool ssh = _methodBox.Text != "Telnet"; bool pubkey = _authOptions.SelectedIndex == (int)AuthType.PublicKey; bool kbd = _authOptions.SelectedIndex == (int)AuthType.KeyboardInteractive; _userNameBox.Enabled = ssh; _authOptions.Enabled = ssh; _passphraseBox.Enabled = ssh && (pubkey || !kbd); _privateKeyFile.Enabled = ssh && pubkey; _privateKeySelect.Enabled = ssh && pubkey; bool e = ((LogType)EnumDescAttribute.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None) != LogType.None); _logFileBox.Enabled = e; _selectLogButton.Enabled = e; }
public OptionDialog() { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); // // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。 // _tabControl.SelectedIndex = _FIRSTTABPAGE; _optionPreservePlace.Items.AddRange(EnumDescAttribute.For(typeof(OptionPreservePlace)).DescriptionCollection()); _languageBox.Items.AddRange(EnumDescAttribute.For(typeof(Language)).DescriptionCollection()); InitializeText(); //TODO SOCKSとOptionPreservePlaceまわりは未サポート _useSocks.Enabled = false; }
private void InitKeyConfigUI() { _keyConfigList.Items.Clear(); IEnumerator ie = _commands.EnumEntries(); while (ie.MoveNext()) { Commands.Entry e = (Commands.Entry)ie.Current; if (e.Category == Commands.Category.Fixed) { continue; } ListViewItem li = new ListViewItem(EnumDescAttribute.For(typeof(Commands.Category)).GetDescription(e.Category)); li = _keyConfigList.Items.Add(li); li.SubItems.Add(e.Description); li.SubItems.Add(e.KeyDisplayString); li.Tag = e.CID; } }
private void FillText() { this._actionOnLaunchLabel.Text = GApp.Strings.GetString("Form.OptionDialog._actionOnLaunchLabel"); this._MRUSizeLabel.Text = GApp.Strings.GetString("Form.OptionDialog._MRUSizeLabel"); this._serialCountLabel.Text = GApp.Strings.GetString("Form.OptionDialog._serialCountLabel"); this._showTabBar.Text = GApp.Strings.GetString("Form.OptionDialog._showTabBar"); this._tabStyleLabel.Text = GApp.Strings.GetString("Form.OptionDialog._tabStyleLabel"); this._splitterRatioBox.Text = GApp.Strings.GetString("Form.OptionDialog._splitterRatioBox"); this._showToolBar.Text = GApp.Strings.GetString("Form.OptionDialog._showToolBar"); this._showStatusBar.Text = GApp.Strings.GetString("Form.OptionDialog._showStatusBar"); this._askCloseOnExit.Text = GApp.Strings.GetString("Form.OptionDialog._askCloseOnExit"); this._quitAppWithLastPane.Text = GApp.Strings.GetString("Form.OptionDialog._quitAppWithLastPane"); this._optionPreservePlaceLabel.Text = GApp.Strings.GetString("Form.OptionDialog._optionPreservePlaceLabel"); this._languageLabel.Text = GApp.Strings.GetString("Form.OptionDialog._languageLabel"); _tabStyleBox.Items.AddRange(EnumDescAttribute.For(typeof(TabBarStyle)).DescriptionCollection()); _optionPreservePlace.Items.AddRange(EnumDescAttribute.For(typeof(OptionPreservePlace)).DescriptionCollection()); _languageBox.Items.AddRange(EnumDescAttribute.For(typeof(Language)).DescriptionCollection()); }