Esempio n. 1
0
        public override void TerminatePlugin()
        {
            base.TerminatePlugin();

            PoderosaRemotingServiceHost.Shutdown();

            if (_windows.Count > 0)
            {
                CloseAllPopupWindows();
                MainWindow[] t = _windows.ToArray(); //クローズイベント内で_windowsの要素が変化するのでローカルコピーが必要
                foreach (MainWindow w in t)
                {
                    w.Close();
                }
            }
        }
Esempio n. 2
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);

            PoderosaRemotingServiceHost.Start(new PoderosaRemotingService(this));
        }