public bool Commit(ITerminalSessionOptions terminalsession, IMRUOptions mru, ICoreServicePreference window, IStartupActionOptions startup) { StringResource sr = OptionDialogPlugin.Instance.Strings; string itemname = null; bool successful = false; try { itemname = sr.GetString("Caption.OptionDialog.MRUCount"); mru.LimitCount = Int32.Parse(_MRUSize.Text); terminalsession.AskCloseOnExit = _askCloseOnExit.Checked; window.ShowsToolBar = _showToolBar.Checked; window.Language = (Language)_languageBox.SelectedIndex; startup.StartupAction = (StartupAction)_startupOptionBox.SelectedIndex; successful = true; } catch (FormatException) { GUtil.Warning(this, String.Format(sr.GetString("Message.OptionDialog.InvalidItem"), itemname)); } catch (Exception ex) { GUtil.Warning(this, ex.Message); } return(successful); }
public void InitUI(ITerminalSessionOptions terminalsession, IMRUOptions mru, ICoreServicePreference window, IStartupActionOptions startup) { _MRUSize.Text = mru.LimitCount.ToString(); _askCloseOnExit.Checked = terminalsession.AskCloseOnExit; _showToolBar.Checked = window.ShowsToolBar; _languageBox.SelectedItem = window.Language; // select EnumListItem<T> by T _startupOptionBox.SelectedItem = startup.StartupAction; // select EnumListItem<T> by T }
public bool Commit(ITerminalSessionOptions terminalsession, IMRUOptions mru, ICoreServicePreference window, IStartupActionOptions startup) { StringResource sr = OptionDialogPlugin.Instance.Strings; string itemname = null; bool successful = false; try { itemname = sr.GetString("Caption.OptionDialog.MRUCount"); mru.LimitCount = Int32.Parse(_MRUSize.Text); terminalsession.AskCloseOnExit = _askCloseOnExit.Checked; window.ShowsToolBar = _showToolBar.Checked; window.Language = ((EnumListItem<Language>)_languageBox.SelectedItem).Value; startup.StartupAction = ((EnumListItem<StartupAction>)_startupOptionBox.SelectedItem).Value; successful = true; } catch (FormatException) { GUtil.Warning(this, String.Format(sr.GetString("Message.OptionDialog.InvalidItem"), itemname)); } catch (Exception ex) { GUtil.Warning(this, ex.Message); } return successful; }