Пример #1
0
        private void OnOK(object sender, EventArgs args)
        {
            this.DialogResult = DialogResult.None;

            StringResource sr = SSHUtilPlugin.Instance.Strings;

            try {
                SSH2UserAuthKey key = SSH2UserAuthKey.FromSECSHStyleFile(_tKeyFile.Text, _tCurrentPassphrase.Text);
                if (_tNewPassphrase.Text != _tNewPassphraseAgain.Text)
                {
                    GUtil.Warning(this, sr.GetString("Message.ChangePassphrase.PassphraseMismatch"));
                }
                else
                {
                    if (_tNewPassphrase.Text.Length > 0 || GUtil.AskUserYesNo(this, sr.GetString("Message.ChangePassphrase.AskEmptyPassphrase")) == DialogResult.Yes)
                    {
                        FileStream s = new FileStream(_tKeyFile.Text, FileMode.Create);
                        key.WritePrivatePartInSECSHStyleFile(s, "", _tNewPassphrase.Text);
                        s.Close();
                        GUtil.Warning(this, sr.GetString("Message.ChangePassphrase.NotifyChanged"), MessageBoxIcon.Information);
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                }
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
                GUtil.Warning(this, ex.Message);
            }
        }
Пример #2
0
        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(EnumListItem <LogType> .GetListItems());

            _session = session;
            ISimpleLogSettings ls = GetSimpleLogSettings();

            if (ls != null)
            {
                _logTypeBox.SelectedItem = ls.LogType;  // select EnumListItem<T> by T
                if (ls.LogType != LogType.None)
                {
                    _fileNameBox.Items.Add(ls.LogPath);
                    _fileNameBox.SelectedIndex = 0;
                }
            }
            else
            {
                _logTypeBox.SelectedItem = LogType.None;    // select EnumListItem<T> by T
            }
            AdjustUI();
        }
Пример #3
0
        private bool ValidateParams()
        {
            StringResource res = PipePlugin.Instance.Strings;

            _name = _textBoxName.Text;

            if (_name.Length == 0)
            {
                GUtil.Warning(this, res.GetString("Form.EditVariableDialog.Error.EnterName"));
                return(false);
            }

            if (_name.IndexOf('=') != -1)
            {
                GUtil.Warning(this, res.GetString("Form.EditVariableDialog.Error.NameHasIllegalCharacter"));
                return(false);
            }

            _value = _textBoxValue.Text;

            if (_value.Length == 0)
            {
                GUtil.Warning(this, res.GetString("Form.EditVariableDialog.Error.EnterValue"));
                return(false);
            }

            return(true);
        }
Пример #4
0
        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();
        }
        public EditEscapeSequenceColor(Color back, Color fore, EscapesequenceColorSet cs)
        {
            StringResource sr = TerminalUIPlugin.Instance.Strings;

            //
            // Windows フォーム デザイナ サポートに必要です。
            //
            InitializeComponent();

            _colorBoxes = new ColorButton[16];
            _backColor  = back;
            _foreColor  = fore;
            _esColorSet = (EscapesequenceColorSet)cs.Clone();
            int ti = 0;

            int y = 8;

            AddBackColorUI(y, ref ti);
            y += 24;

            {
                AddUI(-1, 0, y, ref ti);                 //-1はデフォルト色設定
                y += 24;

                int y1 = y;
                for (int i = 0; i < 8; i++)
                {
                    AddUI(i, 0, y, ref ti);                     //-1はデフォルト色設定
                    y += 24;
                }
                y = y1;
                for (int i = 8; i < 16; i++)
                {
                    AddUI(i, 250, y, ref ti);
                    y += 24;
                }
            }

            y += 8;
            _setDefaultButton           = new Button();
            _setDefaultButton.Left      = 356;
            _setDefaultButton.Width     = 144;
            _setDefaultButton.Click    += new EventHandler(OnSetDefault);
            _setDefaultButton.Text      = sr.GetString("Form.EditEscapesequenceColor._setDefaultButton");
            _setDefaultButton.Top       = y;
            _setDefaultButton.TabIndex  = ti++;
            _setDefaultButton.FlatStyle = FlatStyle.System;
            this.Controls.Add(_setDefaultButton);

            y += 32;
            _okButton.Text     = sr.GetString("Common.OK");
            _okButton.Top      = y;
            _cancelButton.Text = sr.GetString("Common.Cancel");
            _cancelButton.Top  = y;
            this.Text          = sr.GetString("Form.EditEscapesequenceColor.Text");

            this.ClientSize = new Size(this.ClientSize.Width, y + 32);
        }
Пример #6
0
        private void InitText()
        {
            StringResource sr = SSHUtilPlugin.Instance.Strings;

            this.Text             = sr.GetString("Form.InputPassphraseDialog.Text");
            _fileNameLabel.Text   = sr.GetString("Form.InputPassphraseDialog._fileNameLabel");
            _fileNameBox.Text     = _key.FileName;
            _passphraseLabel.Text = sr.GetString("Form.InputPassphraseDialog._passphraseLabel");
            _okButton.Text        = sr.GetString("Common.OK");
            _cancelButton.Text    = sr.GetString("Common.Cancel");
        }
Пример #7
0
        private void SetupControls()
        {
            StringResource res = PipePlugin.Instance.Strings;

            this.Text = res.GetString("Form.EditVariableDialog.Title");

            _labelName.Text  = res.GetString("Form.EditVariableDialog._labelName");
            _labelValue.Text = res.GetString("Form.EditVariableDialog._labelValue");

            _buttonOK.Text     = res.GetString("Common.OK");
            _buttonCancel.Text = res.GetString("Common.Cancel");
        }
        public ModuleProperty(MacroList p, MacroModule mod)
        {
            _parent = p;
            //_prevShortCut = shortcut;
            _module = mod == null? new MacroModule(0, "", "") : (MacroModule)mod.Clone();
            //
            // Windows フォーム デザイナ サポートに必要です。
            //
            InitializeComponent();

            StringResource sr = MacroPlugin.Instance.Strings;

            this._titleLabel.Text = sr.GetString("Form.ModuleProperty._titleLabel");
            this._pathLabel.Text  = sr.GetString("Form.ModuleProperty._pathLabel");
            this._additionalAssemblyLabel.Text = sr.GetString("Form.ModuleProperty._additionalAssemblyLabel");
            this._shortcutLabel.Text           = sr.GetString("Form.ModuleProperty._shortcutLabel");
            this._debugOption.Text             = sr.GetString("Form.ModuleProperty._debugOption");
            this._okButton.Text     = sr.GetString("Common.OK");
            this._cancelButton.Text = sr.GetString("Common.Cancel");
            this.Text = sr.GetString("Form.ModuleProperty.Text");

            _shortcutLabel.Visible = false;
            //_shortcut.Visible = false;

            if (mod != null)
            {
                _title.Text = _module.Title;
                _path.Text  = _module.Path;
                _additionalAssembly.Text = Concat(_module.AdditionalAssemblies);
                _debugOption.Checked     = _module.DebugMode;
                //_shortcut.Key = shortcut;
            }
        }