Exemplo n.º 1
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;

            IPluginManager pm = poderosa.PluginManager;

            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            TEnv.ReloadStringResource();
            _terminalViewFactory = new TerminalViewFactory();
            pm.FindExtensionPoint(WindowManagerConstants.VIEW_FACTORY_ID).RegisterExtension(_terminalViewFactory);
            //このViewFactoryはデフォ
            foreach (IViewManagerFactory mf in pm.FindExtensionPoint(WindowManagerConstants.MAINWINDOWCONTENT_ID).GetExtensions())
            {
                mf.DefaultViewFactory = _terminalViewFactory;
            }

            //ログインダイアログのサポート用
            pm.CreateExtensionPoint("org.poderosa.terminalsessions.telnetSSHLoginDialogInitializer", typeof(ITelnetSSHLoginDialogInitializer), this);
            pm.CreateExtensionPoint("org.poderosa.terminalsessions.loginDialogUISupport", typeof(ILoginDialogUISupport), this);
            pm.CreateExtensionPoint("org.poderosa.terminalsessions.terminalParameterStore", typeof(ITerminalSessionParameterStore), this);
            IExtensionPoint factory_point = pm.CreateExtensionPoint(TERMINAL_CONNECTION_FACTORY_ID, typeof(ITerminalConnectionFactory), this);

            _pasteCommandExt = pm.CreateExtensionPoint("org.poderosa.terminalsessions.pasteCommand", typeof(IPoderosaCommand), this);

            _terminalSessionsOptionSupplier = new TerminalSessionOptionsSupplier();
            _coreServices.PreferenceExtensionPoint.RegisterExtension(_terminalSessionsOptionSupplier);


            //Add conversion for TerminalPane
            _paneBridgeAdapter = new PaneBridgeAdapter();
            poderosa.AdapterManager.RegisterFactory(_paneBridgeAdapter);

            _startCommand     = new StartCommand(factory_point);
            _reproduceCommand = new ReproduceCommand();
            _coreServices.CommandManager.Register(_reproduceCommand);

            ReproduceMenuGroup rmg         = new ReproduceMenuGroup();
            IExtensionPoint    consolemenu = pm.FindExtensionPoint("org.poderosa.menu.console");

            consolemenu.RegisterExtension(rmg);

            IExtensionPoint contextmenu = pm.FindExtensionPoint("org.poderosa.terminalemulator.contextMenu");

            contextmenu.RegisterExtension(rmg);

            IExtensionPoint documentContext = pm.FindExtensionPoint("org.poderosa.terminalemulator.documentContextMenu");

            documentContext.RegisterExtension(rmg);
        }
Exemplo n.º 2
0
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);
            _instance = this;

            IPluginManager pm = poderosa.PluginManager;
            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            TEnv.ReloadStringResource();
            _terminalViewFactory = new TerminalViewFactory();
            pm.FindExtensionPoint(WindowManagerConstants.VIEW_FACTORY_ID).RegisterExtension(_terminalViewFactory);
            //このViewFactoryはデフォ
            foreach (IViewManagerFactory mf in pm.FindExtensionPoint(WindowManagerConstants.MAINWINDOWCONTENT_ID).GetExtensions())
                mf.DefaultViewFactory = _terminalViewFactory;

            //ログインダイアログのサポート用
            pm.CreateExtensionPoint("org.poderosa.terminalsessions.telnetSSHLoginDialogInitializer", typeof(ITelnetSSHLoginDialogInitializer), this);
            pm.CreateExtensionPoint("org.poderosa.terminalsessions.loginDialogUISupport", typeof(ILoginDialogUISupport), this);
            IExtensionPoint factory_point = pm.CreateExtensionPoint(TERMINAL_CONNECTION_FACTORY_ID, typeof(ITerminalConnectionFactory), this);

            _terminalSessionsOptionSupplier = new TerminalSessionOptionsSupplier();
            _coreServices.PreferenceExtensionPoint.RegisterExtension(_terminalSessionsOptionSupplier);


            //Add conversion for TerminalPane
            _paneBridgeAdapter = new PaneBridgeAdapter();
            poderosa.AdapterManager.RegisterFactory(_paneBridgeAdapter);

            _startCommand = new StartCommand(factory_point);
            _reproduceCommand = new ReproduceCommand();
            _coreServices.CommandManager.Register(_reproduceCommand);

            ReproduceMenuGroup rmg = new ReproduceMenuGroup();
            IExtensionPoint consolemenu = pm.FindExtensionPoint("org.poderosa.menu.console");
            consolemenu.RegisterExtension(rmg);

            IExtensionPoint contextmenu = pm.FindExtensionPoint("org.poderosa.terminalemulator.contextMenu");
            contextmenu.RegisterExtension(rmg);

            IExtensionPoint documentContext = pm.FindExtensionPoint("org.poderosa.terminalemulator.documentContextMenu");
            documentContext.RegisterExtension(rmg);
        }