Ejemplo n.º 1
0
        public void IndicateMacroFinished()
        {
            _runningMacro = null;
            GApp.Frame.RefreshConnection(GEnv.Connections.ActiveTag);
            GApp.Frame.MenuMacroStop.Enabled = false;
            if (_macroListener != null)
            {
                _macroListener.IndicateMacroFinished();
            }

            foreach (ConnectionTag ct in GEnv.Connections)
            {
                ct.Terminal.ClearMacroBuffer();
            }
        }
Ejemplo n.º 2
0
        public void Execute(IWin32Window parent, MacroModule mod)
        {
            if (_runningMacro != null)
            {
                GUtil.Warning(parent, GApp.Strings.GetString("Message.MacroModule.AlreadyRunning"));
                return;
            }

            if (mod.Type == MacroType.Unknown)
            {
                GUtil.Warning(parent, GApp.Strings.GetString("Message.MacroModule.UnknownModuleType"));
                return;
            }
            else
            {
                try {
                    GApp.Frame.Cursor = Cursors.WaitCursor;
                    Assembly   asm = MacroUtil.LoadMacroAssembly(mod);
                    MethodInfo ep  = asm.EntryPoint;
                    if (ep == null)
                    {
                        throw new Exception(GApp.Strings.GetString("Message.MacroModule.NoEntryPoint"));
                    }

                    _runningMacro = new MacroExecutor(mod, ep);
                    IndicateMacroStarted();
                    _runningMacro.AsyncExec();
                }
                catch (Exception ex) {
                    GUtil.Warning(parent, ex.Message);
                }
                finally {
                    GApp.Frame.Cursor = Cursors.Default;
                }
            }
        }
Ejemplo n.º 3
0
        public void IndicateMacroFinished()
        {
            _runningMacro = null;
            GApp.Frame.RefreshConnection(GEnv.Connections.ActiveTag);
            GApp.Frame.MenuMacroStop.Enabled = false;
            if(_macroListener!=null)
                _macroListener.IndicateMacroFinished();

            foreach(ConnectionTag ct in GEnv.Connections)
                ct.Terminal.ClearMacroBuffer();
        }
Ejemplo n.º 4
0
        public void Execute(IWin32Window parent, MacroModule mod)
        {
            if(_runningMacro!=null) {
                GUtil.Warning(parent, GApp.Strings.GetString("Message.MacroModule.AlreadyRunning"));
                return;
            }

            if(mod.Type==MacroType.Unknown) {
                GUtil.Warning(parent, GApp.Strings.GetString("Message.MacroModule.UnknownModuleType"));
                return;
            }
            else {
                try {
                    GApp.Frame.Cursor = Cursors.WaitCursor;
                    Assembly asm = MacroUtil.LoadMacroAssembly(mod);
                    MethodInfo ep = asm.EntryPoint;
                    if(ep==null)
                        throw new Exception(GApp.Strings.GetString("Message.MacroModule.NoEntryPoint"));

                    _runningMacro = new MacroExecutor(mod, ep);
                    IndicateMacroStarted();
                    _runningMacro.AsyncExec();
                }
                catch(Exception ex) {
                    GUtil.Warning(parent, ex.Message);
                }
                finally {
                    GApp.Frame.Cursor = Cursors.Default;
                }
            }
        }