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;
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
        //必ず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();
        }
Beispiel #4
0
 public object QueryAdapter(IPreferenceFolder folder, Type type)
 {
     return null;
 }
 public abstract bool Commit(IPreferenceFolder[] values);
Beispiel #6
0
 public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues)
 {
     _lastImportedFolder = newvalues;
     _count++;
 }
Beispiel #7
0
            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;
            }
Beispiel #8
0
 internal static void InitPreference(IPreferenceBuilder builder, IPreferenceFolder window_root)
 {
     _aboutBoxID = builder.DefineStringValue(window_root, "aboutBoxFactoryID", "default", null);
 }
Beispiel #9
0
 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)));
 }
Beispiel #10
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _knownHostsPath = builder.DefineStringValue(folder, "knownHostsPath", "ssh_known_hosts", null);
 }
 public ProtocolOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #12
0
 public SnapshotAwarePreferenceBase(IPreferenceFolder folder)
 {
     _folder = folder;
 }
Beispiel #13
0
 private PreferenceFolder CastFolder(IPreferenceFolder folder)
 {
     return((PreferenceFolder)folder);
 }
Beispiel #14
0
 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();
 }
Beispiel #16
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _promptSearchMaxLines = builder.DefineIntValue(folder, "promptSearchMaxLines", DEFAULT_PROMPT_SEARCH_MAX_LINES, PreferenceValidatorUtil.PositiveIntegerValidator);
 }
Beispiel #17
0
        //IPreferencesupplier
        public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) {
            _originalFolder = folder;
            _originalOptions = new TerminalOptions(folder);
            _originalOptions.DefineItems(builder);


            //defaultRenderProfileのリセットをする
            _originalFolder.AddChangeListener(this);
        }
Beispiel #18
0
 internal static void InitPreference(IPreferenceBuilder builder, IPreferenceFolder window_root)
 {
     _aboutBoxID = builder.DefineStringValue(window_root, "aboutBoxFactoryID", "default", null);
 }
Beispiel #19
0
 public override void InitiUI(IPreferenceFolder[] values)
 {
     if (_panel == null)
         _panel = new CommandOptionPanel();
     _panel.InitUI(OptionDialogPlugin.Instance.CommandManager.GetKeyBinds(values[0]));
 }
Beispiel #20
0
 public TerminalOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #21
0
        /// <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;
            }
        }
Beispiel #22
0
 public KeyAgentOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #23
0
 public ProtocolOptions(IPreferenceFolder folder)
     : base(folder) {
 }
Beispiel #24
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _modifyCursorKeys = builder.DefineIntValue(folder, "modifyCursorKeys", DEFAULT_MODIFY_CURSOR_KEYS, PreferenceValidatorUtil.PositiveIntegerValidator);
 }
Beispiel #25
0
 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);
 }
Beispiel #26
0
 public StartupActionOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #27
0
 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));
 }
Beispiel #28
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _originalFolder  = folder;
     _originalOptions = new StartupActionOptions(folder);
     _originalOptions.DefineItems(builder);
 }
Beispiel #29
0
 /// <summary>
 /// <ja>コンストラクタ</ja>
 /// </summary>
 public ExtendPasteOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #30
0
 public FolderTag(IPreferenceFolder original)
 {
     _original = original;
     _work     = original.Clone();
 }
 public abstract void InitiUI(IPreferenceFolder[] values);
Beispiel #32
0
 //TODO QueryAdapter経由にすべき?
 public IKeyBinds GetKeyBinds(IPreferenceFolder folder)
 {
     return(GetKeyBindInternal(folder));
 }
Beispiel #33
0
 public TerminalOptions(IPreferenceFolder folder)
     : base(folder) {
 }
Beispiel #34
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _keyBindNode = builder.DefineLooseNode(folder, _keyBind, "keybinds");
     folder.AddChangeListener(this);
 }
Beispiel #35
0
 public override bool Commit(IPreferenceFolder[] values)
 {
     Debug.Assert(_panel != null);
     return _panel.Commit(OptionDialogPlugin.Instance.CommandManager.GetKeyBinds(values[0]));
 }
Beispiel #36
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));
        }
Beispiel #37
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _modifyCursorKeys = builder.DefineIntValue(folder, "modifyCursorKeys", DEFAULT_MODIFY_CURSOR_KEYS, PreferenceValidatorUtil.PositiveIntegerValidator);
 }
Beispiel #38
0
 public CoreServicePreferenceAdapter(IPreferenceFolder folder)
     : base(folder) {
 }
Beispiel #39
0
            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));
                }
            }
Beispiel #40
0
 public CoreServicePreferenceAdapter(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #41
0
 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;
 }
Beispiel #42
0
        public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
        {
            IIntPreferenceItem limitCount = builder.DefineIntValue(folder, "limitcount", 5, PreferenceValidatorUtil.PositiveIntegerValidator); //上限値

            builder.DefineLooseNode(folder, _mruList, "list");
        }
Beispiel #43
0
 public MRUOptions(IPreferenceFolder folder)
     : base(folder)
 {
 }
Beispiel #44
0
 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);
 }
Beispiel #45
0
 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)));
 }
Beispiel #46
0
 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));
 }
Beispiel #47
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder) {
     _originalFolder = folder;
     _originalOptions = new ProtocolOptions(folder);
     _originalOptions.DefineItems(builder);
 }
Beispiel #48
0
 public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues)
 {
     _lastImportedFolder = newvalues;
     _count++;
 }
Beispiel #49
0
 public virtual void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _rootFolder = folder;
 }
Beispiel #50
0
 public virtual void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _rootFolder = folder;
 }
Beispiel #51
0
 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);
 }
Beispiel #52
0
 public virtual object QueryAdapter(IPreferenceFolder folder, Type type)
 {
     return(null);
 }
Beispiel #53
0
 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;
 }
Beispiel #54
0
 public void ValidateFolder(IPreferenceFolder folder, IPreferenceValidationResult output)
 {
 }
Beispiel #55
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _fileName = builder.DefineStringValue(folder, "filename", "ssh_known_hosts", null);
 }
Beispiel #56
0
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _knownHostsPath = builder.DefineStringValue(folder, "knownHostsPath", "ssh_known_hosts", null);
 }
Beispiel #57
0
 public void ValidateFolder(IPreferenceFolder folder, IPreferenceValidationResult output)
 {
 }
Beispiel #58
0
 /// <summary>
 /// <ja>初期化</ja>
 /// </summary>
 public void InitializePreference(IPreferenceBuilder builder, IPreferenceFolder folder)
 {
     _originalFolder  = folder;
     _originalOptions = new ExtendPasteOptions(_originalFolder);
     _originalOptions.DefineItems(builder);
 }