Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="poderosa">an instance of PoderosaWorld</param>
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);

            _instance      = this;
            _poderosaWorld = poderosa;

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

            _stringResource = new StringResource("Poderosa.Pipe.strings", typeof(PipePlugin).Assembly);
            poderosa.Culture.AddChangeListener(_stringResource);

            _terminalSessionsService = poderosa.PluginManager.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService)) as ITerminalSessionsService;
            _terminalEmulatorService = poderosa.PluginManager.FindPlugin("org.poderosa.terminalemulator", typeof(ITerminalEmulatorService)) as ITerminalEmulatorService;
            _serializeService        = poderosa.PluginManager.FindPlugin("org.poderosa.core.serializing", typeof(ISerializeService)) as ISerializeService;

            IExtensionPoint extSer = _coreServices.SerializerExtensionPoint;

            extSer.RegisterExtension(new PipeTerminalParameterSerializer());
            extSer.RegisterExtension(new PipeTerminalSettingsSerializer());

            _openPipeCommand = new OpenPipeCommand();

            IPluginManager pm = poderosa.PluginManager;

            pm.FindExtensionPoint("org.poderosa.menu.file").RegisterExtension(new PipeMenuGroup(_openPipeCommand));

            // Toolbar button has not been added yet
            //pm.FindExtensionPoint("org.poderosa.core.window.toolbar").RegisterExtension(new PipeToolBarComponent());

            pm.FindExtensionPoint("org.poderosa.termianlsessions.terminalConnectionFactory").RegisterExtension(new PipeConnectionFactory());
        }
Example #2
0
        /// <summary>
        /// Start benchmark
        /// </summary>
        /// <returns></returns>
        public CommandResult Start()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();

            ITerminalEmulatorService emulatorService =
                BenchmarkPlugin.Instance.PoderosaWorld.PluginManager.FindPlugin("org.poderosa.terminalemulator", typeof(ITerminalEmulatorService)) as ITerminalEmulatorService;
            ITerminalSessionsService sessionService =
                (ITerminalSessionsService)BenchmarkPlugin.Instance.PoderosaWorld.PluginManager.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService));

            if (emulatorService == null || sessionService == null)
            {
                return(CommandResult.Ignored);
            }

            ITerminalSettings settings = emulatorService.CreateDefaultTerminalSettings(GetTerminalCaption(), null);

            settings.BeginUpdate();
            settings.Encoding = Poderosa.ConnectionParam.EncodingType.UTF8;
            settings.EndUpdate();
            ITerminalConnection          connection   = GetTerminalConnection();
            ITerminalSessionStartCommand startCommand = sessionService.TerminalSessionStartCommand;
            ITerminalSession             session      = startCommand.StartTerminalSession(_target, connection, settings);

            StartBenchmarkThread(emulatorService.TerminalEmulatorOptions, session);

            return(CommandResult.Succeeded);
        }
Example #3
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);

            Instance = this;

            IPluginManager pm = poderosa.PluginManager;

            _optionSupplier = new MRUOptionsSupplier();
            _coreServices   = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            _coreServices.PreferenceExtensionPoint.RegisterExtension(_optionSupplier);

            _protocolService         = (IProtocolService)pm.FindPlugin("org.poderosa.protocols", typeof(IProtocolService));
            _terminalSessionsService = (ITerminalSessionsService)pm.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService));

            //接続成功時にリスト更新
            _mruList = new MRUList(this, pm);
            _coreServices.SessionManager.AddSessionListener(_mruList);
            pm.FindExtensionPoint("org.poderosa.menu.file").RegisterExtension(_mruList);
            pm.FindExtensionPoint("org.poderosa.terminalsessions.telnetSSHLoginDialogInitializer").RegisterExtension(_mruList);
            pm.FindExtensionPoint("org.poderosa.terminalsessions.loginDialogUISupport").RegisterExtension(_mruList);
            pm.FindExtensionPoint("org.poderosa.terminalsessions.terminalParameterStore").RegisterExtension(_mruList);

            _mruCommand = new OpenMRUCommand();
        }
 /// <summary>
 /// ターミナルセッションInvoke
 /// </summary>
 /// <param name="tp">ターミナルパラメータ</param>
 /// <param name="ts">ターミナルセッティング</param>
 private static ITerminalSession InvokeOpenSessionOrNull(ITerminalParameter tp, ITerminalSettings ts)
 {
     try {
         ITerminalSessionsService ss         = ConnectProfilePlugin.Instance.TerminalSessionsService;
         ITerminalSession         newsession = ss.TerminalSessionStartCommand.StartTerminalSession(ConnectProfilePlugin.Instance.WindowManager.ActiveWindow, tp, ts);
         return((newsession == null) ? null : newsession);
     } catch (Exception ex) {
         Poderosa.RuntimeUtil.ReportException(ex);
         return(null);
     }
 }
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);
            _instance = this;
            ICoreServices cs = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));

            _commandManager = cs.CommandManager;
            _windowManager = cs.WindowManager;
            _sessionService = (ITerminalSessionsService)poderosa.PluginManager.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService));
            _protocolService = (IProtocolService)poderosa.PluginManager.FindPlugin("org.poderosa.protocols", typeof(IProtocolService));
            _cygwinService = (ICygwinPlugin)poderosa.PluginManager.FindPlugin("org.poderosa.cygwin", typeof(ICygwinPlugin));
            Debug.Assert(_sessionService != null);
            Debug.Assert(_protocolService != null);
            Debug.Assert(_cygwinService != null);

            cs.PreferenceExtensionPoint.RegisterExtension(this);
            poderosa.PluginManager.FindExtensionPoint(WindowManagerConstants.MAINWINDOWEVENTHANDLER_ID).RegisterExtension(this);
        }
Example #6
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance = this;
            ICoreServices cs = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));

            _commandManager  = cs.CommandManager;
            _windowManager   = cs.WindowManager;
            _sessionService  = (ITerminalSessionsService)poderosa.PluginManager.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService));
            _protocolService = (IProtocolService)poderosa.PluginManager.FindPlugin("org.poderosa.protocols", typeof(IProtocolService));
            _cygwinService   = (ICygwinPlugin)poderosa.PluginManager.FindPlugin("org.poderosa.cygwin", typeof(ICygwinPlugin));
            Debug.Assert(_sessionService != null);
            Debug.Assert(_protocolService != null);
            Debug.Assert(_cygwinService != null);

            cs.PreferenceExtensionPoint.RegisterExtension(this);
            poderosa.PluginManager.FindExtensionPoint(WindowManagerConstants.MAINWINDOWEVENTHANDLER_ID).RegisterExtension(this);
        }
Example #7
0
        private static ITerminalSession OpenSessionOrNull(ITerminalParameter tp, ITerminalSettings ts)
        {
            try {
                ITerminalSessionsService ss         = MacroPlugin.Instance.TerminalSessionsService;
                ITerminalSession         newsession = ss.TerminalSessionStartCommand.StartTerminalSession(MacroPlugin.Instance.WindowManager.ActiveWindow, tp, ts);
                if (newsession == null)
                {
                    return(null);
                }

                MacroPlugin.Instance.MacroManager.CurrentExecutor.AddRuntimeSession(newsession);
                return(newsession);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
                return(null);
            }
        }
Example #8
0
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);

            Instance = this;

            IPluginManager pm = poderosa.PluginManager;
            _optionSupplier = new MRUOptionsSupplier();
            _coreServices = (ICoreServices)poderosa.GetAdapter(typeof(ICoreServices));
            _coreServices.PreferenceExtensionPoint.RegisterExtension(_optionSupplier);

            _protocolService = (IProtocolService)pm.FindPlugin("org.poderosa.protocols", typeof(IProtocolService));
            _terminalSessionsService = (ITerminalSessionsService)pm.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService));

            //接続成功時にリスト更新
            _mruList = new MRUList(this, pm);
            _coreServices.SessionManager.AddSessionListener(_mruList);
            pm.FindExtensionPoint("org.poderosa.menu.file").RegisterExtension(_mruList);
            pm.FindExtensionPoint("org.poderosa.terminalsessions.telnetSSHLoginDialogInitializer").RegisterExtension(_mruList);
            pm.FindExtensionPoint("org.poderosa.terminalsessions.loginDialogUISupport").RegisterExtension(_mruList);

            _mruCommand = new OpenMRUCommand();
        }
Example #9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="poderosa">an instance of PoderosaWorld</param>
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);

            _instance = this;
            _poderosaWorld = poderosa;

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

            _stringResource = new StringResource("Poderosa.Pipe.strings", typeof(PipePlugin).Assembly);
            poderosa.Culture.AddChangeListener(_stringResource);

            _terminalSessionsService = poderosa.PluginManager.FindPlugin("org.poderosa.terminalsessions", typeof(ITerminalSessionsService)) as ITerminalSessionsService;
            _terminalEmulatorService = poderosa.PluginManager.FindPlugin("org.poderosa.terminalemulator", typeof(ITerminalEmulatorService)) as ITerminalEmulatorService;
            _serializeService = poderosa.PluginManager.FindPlugin("org.poderosa.core.serializing", typeof(ISerializeService)) as ISerializeService;

            IExtensionPoint extSer = _coreServices.SerializerExtensionPoint;
            extSer.RegisterExtension(new PipeTerminalParameterSerializer());
            extSer.RegisterExtension(new PipeTerminalSettingsSerializer());

            _openPipeCommand = new OpenPipeCommand();

            IPluginManager pm = poderosa.PluginManager;
            pm.FindExtensionPoint("org.poderosa.menu.file").RegisterExtension(new PipeMenuGroup(_openPipeCommand));

            // Toolbar button has not been added yet
            //pm.FindExtensionPoint("org.poderosa.core.window.toolbar").RegisterExtension(new PipeToolBarComponent());

            pm.FindExtensionPoint("org.poderosa.termianlsessions.terminalConnectionFactory").RegisterExtension(new PipeConnectionFactory());
        }