public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);
            _instance = this;
            _strings = new StringResource("Poderosa.PortForwardingCommand.strings", typeof(PortForwardingCommandPlugin).Assembly);
            poderosa.Culture.AddChangeListener(_strings);

            IPluginManager pm = poderosa.PluginManager;
            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));

            _execPortForwardingCommand = new ExecPortForwardingCommand();
            _coreServices.CommandManager.Register(_execPortForwardingCommand);
            IExtensionPoint toolmenu = pm.FindExtensionPoint("org.poderosa.menu.tool");
            toolmenu.RegisterExtension(new PoderosaMenuGroupImpl(
                new IPoderosaMenu[] { new PoderosaMenuItemImpl(_execPortForwardingCommand, _strings, "Menu.PortForwarding") }, false));
        }
Esempio n. 2
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;
            _strings  = new StringResource("Poderosa.PortForwardingCommand.strings", typeof(PortForwardingCommandPlugin).Assembly);
            poderosa.Culture.AddChangeListener(_strings);

            IPluginManager pm = poderosa.PluginManager;

            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));

            _execPortForwardingCommand = new ExecPortForwardingCommand();
            _coreServices.CommandManager.Register(_execPortForwardingCommand);
            IExtensionPoint toolmenu = pm.FindExtensionPoint("org.poderosa.menu.tool");

            toolmenu.RegisterExtension(new PoderosaMenuGroupImpl(
                                           new IPoderosaMenu[] { new PoderosaMenuItemImpl(_execPortForwardingCommand, _strings, "Menu.PortForwarding") }, false));
        }