コード例 #1
0
        protected override bool ProcessDialogChar(char charCode)
        {
            if (AboutBoxUtil.ProcessDialogChar(charCode))
            {
                this.Close();
            }

            return(base.ProcessDialogChar(charCode));
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: yueker/poderosa
        public void ReloadPreference(ICoreServicePreference pref)
        {
            IPoderosaAboutBoxFactory af = AboutBoxUtil.GetCurrentAboutBoxFactory();

            if (af != null)
            {
                this.Icon = af.ApplicationIcon;
            }
            _toolStripContainer.ReloadPreference(pref);
        }
コード例 #3
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;

#if UNITTEST
            StartMode = StartMode.Slave;
#else
            //NOTE Preferenceから取得するなどすべきか
            StartMode = StartMode.StandAlone;
#endif

            //Coreアセンブリ内のプラグインを代表してここでAdapterFactoryをセット
            new CoreServices(poderosa);

            TabBar.Init();

            IPluginManager pm = poderosa.PluginManager;
            pm.FindExtensionPoint("org.poderosa.root").RegisterExtension(this);
            pm.CreateExtensionPoint(WindowManagerConstants.MAINWINDOWCONTENT_ID, typeof(IViewManagerFactory), this);
            pm.CreateExtensionPoint(WindowManagerConstants.VIEW_FACTORY_ID, typeof(IViewFactory), this);
            pm.CreateExtensionPoint(WindowManagerConstants.VIEWFORMATEVENTHANDLER_ID, typeof(IViewFormatEventHandler), this);
            pm.CreateExtensionPoint(WindowManagerConstants.TOOLBARCOMPONENT_ID, typeof(IToolBarComponent), this);
            pm.CreateExtensionPoint(WindowManagerConstants.MAINWINDOWEVENTHANDLER_ID, typeof(IMainWindowEventHandler), this);
            pm.CreateExtensionPoint(WindowManagerConstants.FILEDROPHANDLER_ID, typeof(IFileDropHandler), this);
            AboutBoxUtil.DefineExtensionPoint(pm);

            _preferences = new WindowPreference();
            pm.FindExtensionPoint(PreferencePlugin.EXTENSIONPOINT_NAME)
            .RegisterExtension(_preferences);
            pm.FindExtensionPoint(WindowManagerConstants.MAINWINDOWCONTENT_ID)
            .RegisterExtension(new DefaultViewManagerFactory());

            _windows      = new List <MainWindow>();
            _popupWindows = new List <PopupViewContainer>();

            _menu               = new MainWindowMenu();
            _selectionService   = new SelectionService(this);
            _viewFactoryManager = new ViewFactoryManager();

            CommandManagerPlugin.Instance.AddKeyBindChangeListener(this);
            poderosa.Culture.AddChangeListener(this);
        }
コード例 #4
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));
        }
コード例 #5
0
        public PoderosaForm()
        {
            _contextMenusToDispose = new List <ContextMenuStrip>();

            components = new System.ComponentModel.Container();
            _contextMenuDisposeTimer       = new Timer(components);
            _contextMenuDisposeTimer.Tick += new EventHandler(ContextMenuDisposeTimerTick);

            _messageBoxInternalDelegate = new MessageBoxInternalDelegate(this.MessageBoxInternal);

            IPoderosaAboutBoxFactory aboutBoxFactory = AboutBoxUtil.GetCurrentAboutBoxFactory();

            if (aboutBoxFactory != null)
            {
                this.Icon = aboutBoxFactory.ApplicationIcon;
            }

            //ショートカットキーは共通
            _commandKeyHandler = new KeyboardHandlerManager();
            _commandKeyHandler.AddLastHandler(new CommandShortcutKeyHandler(this));
        }
コード例 #6
0
 private void OnLoad(object sender, System.EventArgs e)
 {
     _versionText.Lines = AboutBoxUtil.GetVersionInfoContent();
 }