public object QueryAdapter(IPreferenceFolder folder, Type type) { Debug.Assert(_originalFolder.Id == folder.Id); if (type == typeof(ITerminalSessionOptions)) return folder == _originalFolder ? _originalOptions : new TerminalSessionOptions(folder).Import(_originalOptions); else return null; }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _schemeTemplate = builder.DefineFolderArray(folder, this, "scheme"); _preferenceFolderArray = folder.FindChildFolderArray("scheme"); Debug.Assert(_preferenceFolderArray != null); _namePreference = builder.DefineStringValue(_schemeTemplate, "name", "", null); _promptPreference = builder.DefineStringValue(_schemeTemplate, "prompt", GenericShellScheme.DEFAULT_PROMPT_REGEX, null); _backspacePreference = builder.DefineStringValue(_schemeTemplate, "backspace", "", null); _commandListPreference = builder.DefineStringValue(_schemeTemplate, "commands", "", null); }
//必ずimportされるという前提なのでちょっと危険 public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { ITerminalEmulatorOptions opt = (ITerminalEmulatorOptions)newvalues.QueryAdapter(typeof(ITerminalEmulatorOptions)); //DefaultRenderProfile GEnv.DefaultRenderProfile = opt.CreateRenderProfile(); //必要なTerminalSessionにApplyTerminalOptions ISessionManager sm = TerminalEmulatorPlugin.Instance.GetSessionManager(); foreach (ISession session in sm.AllSessions) { IAbstractTerminalHost ts = (IAbstractTerminalHost)session.GetAdapter(typeof(IAbstractTerminalHost)); if (ts != null) { TerminalControl tc = ts.TerminalControl; if (tc != null) { tc.ApplyTerminalOptions(opt); } } } //ASCIIWordBreakTable ASCIIWordBreakTable table = ASCIIWordBreakTable.Default; table.Reset(); foreach (char ch in opt.AdditionalWordElement) table.Set(ch, ASCIIWordBreakTable.LETTER); //キーバインド系をリセット TerminalEmulatorPlugin.Instance.CustomKeySettings.Reset(opt); //KeepAliveのリフレッシュ TerminalEmulatorPlugin.Instance.KeepAlive.Refresh(opt.KeepAliveInterval); _originalOptions.ResetParseKeyFlag(); }
public object QueryAdapter(IPreferenceFolder folder, Type type) { return null; }
public abstract bool Commit(IPreferenceFolder[] values);
public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { _lastImportedFolder = newvalues; _count++; }
public override object QueryAdapter(IPreferenceFolder folder, Type adapter) { //Snapshotに対するアクションがあるので、folder==_folderの比較ではアウト if (adapter == typeof(IUserFriendlyInterface)) { if (_folder == folder) return this; else if (folder.Id == _folder.Id) return this.CloneFor(folder); } //失敗ケース return null; }
internal static void InitPreference(IPreferenceBuilder builder, IPreferenceFolder window_root) { _aboutBoxID = builder.DefineStringValue(window_root, "aboutBoxFactoryID", "default", null); }
public override void InitiUI(IPreferenceFolder[] values) { if (_panel == null) _panel = new SSHOptionPanel(); _panel.InitUI((IProtocolOptions)values[0].QueryAdapter(typeof(IProtocolOptions)), (IKeyAgentOptions)values[1].QueryAdapter(typeof(IKeyAgentOptions))); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _knownHostsPath = builder.DefineStringValue(folder, "knownHostsPath", "ssh_known_hosts", null); }
public ProtocolOptions(IPreferenceFolder folder) : base(folder) { }
public SnapshotAwarePreferenceBase(IPreferenceFolder folder) { _folder = folder; }
private PreferenceFolder CastFolder(IPreferenceFolder folder) { return((PreferenceFolder)folder); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _fileName = builder.DefineStringValue(folder, "filename", "ssh_known_hosts", null); }
public WorkPreference(IPreferenceFolder original) { _original = original; _work = original.Clone(); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _promptSearchMaxLines = builder.DefineIntValue(folder, "promptSearchMaxLines", DEFAULT_PROMPT_SEARCH_MAX_LINES, PreferenceValidatorUtil.PositiveIntegerValidator); }
//IPreferencesupplier public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _originalFolder = folder; _originalOptions = new TerminalOptions(folder); _originalOptions.DefineItems(builder); //defaultRenderProfileのリセットをする _originalFolder.AddChangeListener(this); }
internal static void InitPreference(IPreferenceBuilder builder, IPreferenceFolder window_root) { _aboutBoxID = builder.DefineStringValue(window_root, "aboutBoxFactoryID", "default", null); }
public override void InitiUI(IPreferenceFolder[] values) { if (_panel == null) _panel = new CommandOptionPanel(); _panel.InitUI(OptionDialogPlugin.Instance.CommandManager.GetKeyBinds(values[0])); }
public TerminalOptions(IPreferenceFolder folder) : base(folder) { }
/// <summary> /// 保存 /// </summary> public void SaveToPreference() { // 一度も読み込まれていない場合は読み込む(フォームが一度も表示されてない場合に設定が消滅してしまう) if (this.PreferenceLoaded != true) { this.LoadFromPreference(); } IPreferenceFolderArray fa = _rootPreference.FindChildFolderArray(_profileDefinition.Id); fa.Clear(); foreach (ConnectProfileStruct prof in ConnectProfilePlugin.Profiles) { IPreferenceFolder f = fa.CreateNewFolder(); // パスワード暗号化(キーはPLUGIN_ID) string pw = ""; string supw = ""; if (prof.Password != "") { pw = EncryptString(prof.Password, ConnectProfilePlugin.PLUGIN_ID); } if (prof.SUPassword != "") { supw = EncryptString(prof.SUPassword, ConnectProfilePlugin.PLUGIN_ID); } // 値代入 fa.ConvertItem(f, _hostName).AsString().Value = prof.HostName; fa.ConvertItem(f, _protocol).AsString().Value = prof.Protocol.ToString(); fa.ConvertItem(f, _port).AsInt().Value = prof.Port; fa.ConvertItem(f, _authType).AsString().Value = prof.AuthType.ToString(); fa.ConvertItem(f, _keyFile).AsString().Value = prof.KeyFile; fa.ConvertItem(f, _userName).AsString().Value = prof.UserName; fa.ConvertItem(f, _password).AsString().Value = (pw != null) ? pw : ""; fa.ConvertItem(f, _autoLogin).AsBool().Value = prof.AutoLogin; fa.ConvertItem(f, _loginPrompt).AsString().Value = prof.LoginPrompt; fa.ConvertItem(f, _passwordPrompt).AsString().Value = prof.PasswordPrompt; fa.ConvertItem(f, _execCommand).AsString().Value = prof.ExecCommand; fa.ConvertItem(f, _suUserName).AsString().Value = prof.SUUserName; fa.ConvertItem(f, _suPassword).AsString().Value = (supw != null) ? supw : ""; fa.ConvertItem(f, _suType).AsString().Value = prof.SUType; fa.ConvertItem(f, _charCode).AsString().Value = prof.CharCode.ToString(); fa.ConvertItem(f, _newLine).AsString().Value = prof.NewLine.ToString(); fa.ConvertItem(f, _telnetNewLine).AsBool().Value = prof.TelnetNewLine; fa.ConvertItem(f, _terminalType).AsString().Value = prof.TerminalType.ToString(); fa.ConvertItem(f, _terminalFontColor.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ForeColor.ToArgb(), 16); fa.ConvertItem(f, _terminalBGColor.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.BackColor.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor0.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[0].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor1.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[1].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor2.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[2].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor3.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[3].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor4.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[4].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor5.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[5].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor6.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[6].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalESCColor7.PreferenceItem).AsString().Value = Convert.ToString(prof.RenderProfile.ESColorSet[7].Color.ToArgb(), 16); fa.ConvertItem(f, _terminalAsciiFont).AsString().Value = prof.RenderProfile.FontName.ToString(); fa.ConvertItem(f, _terminalCjkFont).AsString().Value = prof.RenderProfile.CJKFontName.ToString(); fa.ConvertItem(f, _terminalFontSize).AsInt().Value = (int)prof.RenderProfile.FontSize; fa.ConvertItem(f, _terminalClearType).AsBool().Value = prof.RenderProfile.UseClearType; fa.ConvertItem(f, _terminalBoldStyle).AsBool().Value = prof.RenderProfile.EnableBoldStyle; fa.ConvertItem(f, _terminalForceBoldStyle).AsBool().Value = prof.RenderProfile.ForceBoldStyle; fa.ConvertItem(f, _terminalBGImage).AsString().Value = prof.RenderProfile.BackgroundImageFileName; fa.ConvertItem(f, _terminalBGImagePos).AsString().Value = prof.RenderProfile.ImageStyle.ToString(); fa.ConvertItem(f, _commandSendInterval).AsInt().Value = prof.CommandSendInterval; fa.ConvertItem(f, _promptRecvTimeout).AsInt().Value = prof.PromptRecvTimeout; fa.ConvertItem(f, _profileItemColor.PreferenceItem).AsString().Value = Convert.ToString(prof.ProfileItemColor.ToArgb(), 16); fa.ConvertItem(f, _description).AsString().Value = prof.Description; } }
public KeyAgentOptions(IPreferenceFolder folder) : base(folder) { }
public ProtocolOptions(IPreferenceFolder folder) : base(folder) { }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _modifyCursorKeys = builder.DefineIntValue(folder, "modifyCursorKeys", DEFAULT_MODIFY_CURSOR_KEYS, PreferenceValidatorUtil.PositiveIntegerValidator); }
public override void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { base.InitializePreference(builder, folder); IPreferenceFolder foo = builder.DefineFolderArray(folder, this, "foo"); _i = builder.DefineIntValue(foo, "i", 10, null); _s = builder.DefineStringValue(foo, "s", "bobo", null); }
public StartupActionOptions(IPreferenceFolder folder) : base(folder) { }
public override void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { base.InitializePreference(builder, folder); _i = builder.DefineIntValue(folder, "i", 10, new PreferenceItemValidator<int>(ValidateI)); _s = builder.DefineStringValue(folder, "s", "bobo", new PreferenceItemValidator<string>(ValidateS)); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _originalFolder = folder; _originalOptions = new StartupActionOptions(folder); _originalOptions.DefineItems(builder); }
/// <summary> /// <ja>コンストラクタ</ja> /// </summary> public ExtendPasteOptions(IPreferenceFolder folder) : base(folder) { }
public FolderTag(IPreferenceFolder original) { _original = original; _work = original.Clone(); }
public abstract void InitiUI(IPreferenceFolder[] values);
//TODO QueryAdapter経由にすべき? public IKeyBinds GetKeyBinds(IPreferenceFolder folder) { return(GetKeyBindInternal(folder)); }
public TerminalOptions(IPreferenceFolder folder) : base(folder) { }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _keyBindNode = builder.DefineLooseNode(folder, _keyBind, "keybinds"); folder.AddChangeListener(this); }
public override bool Commit(IPreferenceFolder[] values) { Debug.Assert(_panel != null); return _panel.Commit(OptionDialogPlugin.Instance.CommandManager.GetKeyBinds(values[0])); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _originalFolder = folder; _adapter = new CoreServicePreferenceAdapter(folder); _adapter.DefineItems(builder); AboutBoxUtil.InitPreference(builder, folder); _windowTemplatePreference = builder.DefineFolderArray(folder, this, "mainwindow"); _windowArrayPreference = folder.FindChildFolderArray("mainwindow"); Debug.Assert(_windowArrayPreference != null); _windowPositionPreference = builder.DefineStringValue(_windowTemplatePreference, "position", "", null); _windowSplitFormatPreference = builder.DefineStringValue(_windowTemplatePreference, "format", "", null); _toolBarFormatPreference = builder.DefineStringValue(_windowTemplatePreference, "toolbar", "", null); _tabRowCountPreference = builder.DefineIntValue(_windowTemplatePreference, "tabrowcount", 1, null); //add listener folder.AddChangeListener(new ChangeListener(_adapter)); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _modifyCursorKeys = builder.DefineIntValue(folder, "modifyCursorKeys", DEFAULT_MODIFY_CURSOR_KEYS, PreferenceValidatorUtil.PositiveIntegerValidator); }
public CoreServicePreferenceAdapter(IPreferenceFolder folder) : base(folder) { }
public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { ICoreServicePreference nv = (ICoreServicePreference)newvalues.QueryAdapter(typeof(ICoreServicePreference)); WindowManagerPlugin.Instance.ReloadPreference(nv); _adapter.ClearSplitModifierCheckedFlag(); //言語が変わっていたら... Language lang = nv.Language; if (lang != ((ICoreServicePreference)oldvalues.QueryAdapter(typeof(ICoreServicePreference))).Language) { Debug.WriteLine("Change Language"); WindowManagerPlugin.Instance.PoderosaWorld.Culture.SetCulture(CoreServicePreferenceAdapter.LangToCulture(lang)); } }
public CoreServicePreferenceAdapter(IPreferenceFolder folder) : base(folder) { }
public object QueryAdapter(IPreferenceFolder folder, Type type) { if (type == typeof(ICoreServicePreference)) return folder == _originalFolder ? _adapter : new CoreServicePreferenceAdapter(folder).Import(_adapter); else if (type == typeof(IWindowPreference)) { Debug.Assert(folder == _originalFolder); //IWindowPreferenceについてはSnapshotサポートせず return this; } else return null; }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { IIntPreferenceItem limitCount = builder.DefineIntValue(folder, "limitcount", 5, PreferenceValidatorUtil.PositiveIntegerValidator); //上限値 builder.DefineLooseNode(folder, _mruList, "list"); }
public MRUOptions(IPreferenceFolder folder) : base(folder) { }
public override void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { base.InitializePreference(builder, folder); _i = builder.DefineIntValue(folder, "i", 10, null); _s = builder.DefineStringValue(folder, "s", "bobo", null); }
public override bool Commit(IPreferenceFolder[] values) { Debug.Assert(_panel != null); return _panel.Commit((IProtocolOptions)values[0].QueryAdapter(typeof(IProtocolOptions)), (IKeyAgentOptions)values[1].QueryAdapter(typeof(IKeyAgentOptions))); }
public override void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { base.InitializePreference(builder, folder); _i = builder.DefineIntValue(folder, "i", 10, new PreferenceItemValidator <int>(ValidateI)); _s = builder.DefineStringValue(folder, "s", "bobo", new PreferenceItemValidator <string>(ValidateS)); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _originalFolder = folder; _originalOptions = new ProtocolOptions(folder); _originalOptions.DefineItems(builder); }
public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { _lastImportedFolder = newvalues; _count++; }
public virtual void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _rootFolder = folder; }
public virtual void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _rootFolder = folder; }
public override void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { base.InitializePreference(builder, folder); _folder = folder; _i = builder.DefineIntValue(folder, "i", 10, null); _s = builder.DefineStringValue(folder, "s", "bobo", null); }
public virtual object QueryAdapter(IPreferenceFolder folder, Type type) { return(null); }
private UserFriendlySupplier CloneFor(IPreferenceFolder snapshot) { UserFriendlySupplier n = new UserFriendlySupplier(); n._folder = snapshot; n._i = snapshot.ChildAt(0) as IIntPreferenceItem; n._s = snapshot.ChildAt(1) as IStringPreferenceItem; return n; }
public void ValidateFolder(IPreferenceFolder folder, IPreferenceValidationResult output) { }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _fileName = builder.DefineStringValue(folder, "filename", "ssh_known_hosts", null); }
public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _knownHostsPath = builder.DefineStringValue(folder, "knownHostsPath", "ssh_known_hosts", null); }
public void ValidateFolder(IPreferenceFolder folder, IPreferenceValidationResult output) { }
/// <summary> /// <ja>初期化</ja> /// </summary> public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) { _originalFolder = folder; _originalOptions = new ExtendPasteOptions(_originalFolder); _originalOptions.DefineItems(builder); }