Пример #1
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));
        }
Пример #2
0
        public void RunExtension()
        {
            try {
                _appContext = new PoderosaAppContext(StartMode);

                _poderosaWorld.Culture.SetCulture(CoreServicePreferenceAdapter.LangToCulture(_preferences.OriginalPreference.Language));
                MainWindowArgument[] args = MainWindowArgument.Parse(_preferences);
                foreach (MainWindowArgument arg in args)
                {
                    _windows.Add(CreateMainWindow(arg));
                }

                if (StartMode == StartMode.StandAlone)
                {
                    Application.Run(_appContext);
                    IPoderosaApplication app = (IPoderosaApplication)_poderosaWorld.GetAdapter(typeof(IPoderosaApplication));
                    app.Shutdown();
                }
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
Пример #3
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 RunExtension()
        {
            try {
                _appContext = new PoderosaAppContext(StartMode);

                _poderosaWorld.Culture.SetCulture(CoreServicePreferenceAdapter.LangToCulture(_preferences.OriginalPreference.Language));
                MainWindowArgument[] args = MainWindowArgument.Parse(_preferences);
                foreach (MainWindowArgument arg in args)
                    _windows.Add(CreateMainWindow(arg));

                if (StartMode == StartMode.StandAlone) {
                    Application.Run(_appContext);
                    IPoderosaApplication app = (IPoderosaApplication)_poderosaWorld.GetAdapter(typeof(IPoderosaApplication));
                    app.Shutdown();
                }
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }