Пример #1
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance       = this;
            _stringResource = new StringResource("Poderosa.Macro.strings", typeof(MacroPlugin).Assembly);
            _instance.PoderosaWorld.Culture.AddChangeListener(_stringResource);

            IPluginManager pm = poderosa.PluginManager;

            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            _macroManager = new MacroManager();

            _macroListCommand = new MacroListCommand();
            _coreServices.CommandManager.Register(_macroListCommand);

            pm.FindExtensionPoint("org.poderosa.menu.tool").RegisterExtension(new MacroMenuGroup());

            _coreServices.PreferenceExtensionPoint.RegisterExtension(_macroManager);

            ISessionManager sessionManager = poderosa.PluginManager.FindPlugin("org.poderosa.core.sessions", typeof(ISessionManager)) as ISessionManager;

            if (sessionManager != null)
            {
                sessionManager.AddSessionListener(_sessionBinder);
            }
        }
Пример #2
0
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);
            _instance = this;
            _stringResource = new StringResource("Poderosa.Macro.strings", typeof(MacroPlugin).Assembly);
            _instance.PoderosaWorld.Culture.AddChangeListener(_stringResource);

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

            _macroListCommand = new MacroListCommand();
            _coreServices.CommandManager.Register(_macroListCommand);

            pm.FindExtensionPoint("org.poderosa.menu.tool").RegisterExtension(new MacroMenuGroup());

            _coreServices.PreferenceExtensionPoint.RegisterExtension(_macroManager);

            ISessionManager sessionManager = poderosa.PluginManager.FindPlugin("org.poderosa.core.sessions", typeof(ISessionManager)) as ISessionManager;
            if (sessionManager != null) {
                sessionManager.AddSessionListener(_sessionBinder);
            }
        }