Esempio n. 1
0
 public CoreServicePreferenceAdapter Import(CoreServicePreferenceAdapter src) {
     _viewSplitModifier = ConvertItem(src._viewSplitModifier);
     _showsToolBar = ConvertItem(src._showsToolBar);
     _language = ConvertItem(src._language);
     _caretInterval = ConvertItem(src._caretInterval);
     _autoCopyByLeftButton = ConvertItem(src._autoCopyByLeftButton);
     _splitLimitCount = ConvertItem(src._splitLimitCount);
     return this;
 }
 public CoreServicePreferenceAdapter Import(CoreServicePreferenceAdapter src)
 {
     _viewSplitModifier    = ConvertItem(src._viewSplitModifier);
     _showsToolBar         = ConvertItem(src._showsToolBar);
     _language             = ConvertItem(src._language);
     _caretInterval        = ConvertItem(src._caretInterval);
     _autoCopyByLeftButton = ConvertItem(src._autoCopyByLeftButton);
     _splitLimitCount      = ConvertItem(src._splitLimitCount);
     return(this);
 }
            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 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));
        }
Esempio n. 5
0
        public void RunExtension()
        {
            try {
                _poderosaWorld.Culture.SetCulture(CoreServicePreferenceAdapter.LangToCulture(_preferences.OriginalPreference.Language));
                MainWindowArgument[] args = MainWindowArgument.Parse(_preferences);
                foreach (MainWindowArgument arg in args)
                {
                    _windows.Add(CreateMainWindow(arg));
                }

                if (GetStartMode() == StartMode.StandAlone)
                {
                    Application.Run(_appContext);
                    IPoderosaApplication app = (IPoderosaApplication)_poderosaWorld.GetAdapter(typeof(IPoderosaApplication));
                    app.Shutdown();
                }
            } catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
 public ChangeListener(CoreServicePreferenceAdapter adapter)
 {
     _adapter = adapter;
 }
Esempio n. 7
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));
        }
Esempio n. 8
0
 public ChangeListener(CoreServicePreferenceAdapter adapter) {
     _adapter = adapter;
 }