예제 #1
0
        public MainWindow(MainWindowArgument arg, MainWindowMenu menu)
        {
            _argument = arg;
            Debug.Assert(_argument != null);
            _commandKeyHandler.AddLastHandler(new FixedShortcutKeyHandler(this));

            this.ImeMode   = ImeMode.NoControl;
            this.AllowDrop = true;

            InitContent();

            ReloadMenu(menu, true);
        }
예제 #2
0
        public MainWindow(MainWindowArgument arg, MainWindowMenu menu) {
            _argument = arg;
            Debug.Assert(_argument != null);
            _commandKeyHandler.AddLastHandler(new FixedShortcutKeyHandler(this));

            this.ImeMode = ImeMode.NoControl;
            this.AllowDrop = true;

            arg.ApplyToUnloadedWindow(this);

            InitContent();

            ReloadMenu(menu, true);
        }
예제 #3
0
        public MainWindow(MainWindowArgument arg, MainWindowMenu menu)
        {
            _argument = arg;
            Debug.Assert(_argument != null);
            _commandKeyHandler.AddLastHandler(new FixedShortcutKeyHandler(this));

            this.ImeMode = ImeMode.NoControl;
#if MONOLITHICLIBRARY
            this.AllowDrop = false;
#else
            this.AllowDrop = true;
#endif
            arg.ApplyToUnloadedWindow(this);

            InitContent();

            ReloadMenu(menu, true);
        }
예제 #4
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);
        }
예제 #5
0
        public void ReloadMenu(MainWindowMenu menu, bool with_toolbar)
        {
            this.SuspendLayout();
            if (_mainMenu != null)
            {
                this.Controls.Remove(_mainMenu);
            }
            _mainMenu = new MenuStrip();
            menu.FullBuild(_mainMenu, this);
            this.MainMenuStrip = _mainMenu;
            this.Controls.Add(_mainMenu);

            if (with_toolbar && _toolStripContainer != null)
            {
                _toolStripContainer.Reload();
            }

            this.ResumeLayout();
        }
예제 #6
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;

            //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();
            _appContext = new PoderosaAppContext();
            _selectionService = new SelectionService(this);
            _viewFactoryManager = new ViewFactoryManager();

            CommandManagerPlugin.Instance.AddKeyBindChangeListener(this);
            poderosa.Culture.AddChangeListener(this);
        }
        public void ReloadMenu(MainWindowMenu menu, bool with_toolbar)
        {
            this.SuspendLayout();
            if (_mainMenu != null)
                this.Controls.Remove(_mainMenu);
            _mainMenu = new MenuStrip();
            menu.FullBuild(_mainMenu, this);
            this.MainMenuStrip = _mainMenu;
            this.Controls.Add(_mainMenu);

            if (with_toolbar && _toolStripContainer != null)
                _toolStripContainer.Reload();

            this.ResumeLayout();
        }
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;

            #if UNITTEST
            StartMode =  StartMode.Slave;
            #else
            //NOTE Preference����擾����Ȃǂ��ׂ���
            StartMode = StartMode.StandAlone;
            #endif

            //Core�A�Z���u����̃v���O�C�����\���Ă�����AdapterFactory��Z�b�g
            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);
        }