Exemplo n.º 1
0
 public static void Run()
 {
     using (var scriptcontrol = new ScriptControl()) {
         scriptcontrol.Build();
         ScriptDebugger.Debug(scriptcontrol, false);
     }
 }
Exemplo n.º 2
0
        public void Execute(Script script, Regex procedure_pattern)
        {
            if (!_scriptcontrol.Build(script))
            {
                return;
            }
            var list_procedures = ListProcedures(script, procedure_pattern);

            if (_scriptcontrol.Run(list_procedures.ProcInitialize))
            {
                foreach (var procedure in list_procedures)
                {
                    if (_scriptcontrol.Run(list_procedures.ProcSetup))
                    {
                        if (_scriptcontrol.Run(procedure, true))
                        {
                            OnSuccess(new ScriptSuccess(script, procedure));
                        }
                        else
                        {
                            var error = _scriptcontrol.Error;
                            if (list_procedures.ProcOnError != null)
                            {
                                list_procedures.ProcOnError.Arguments = new[] {
                                    procedure.Name,
                                    _scriptcontrol.Error.ToString()
                                };
                                if (_scriptcontrol.Run(list_procedures.ProcOnError))
                                {
                                    error.AddInfo((string)_scriptcontrol.Result);
                                }
                            }
                            OnError(error);
                        }
                        _scriptcontrol.Run(list_procedures.ProcTearDown);
                    }
                }
                _scriptcontrol.Run(list_procedures.ProcTerminate);
            }
            if (list_procedures.Count == 0 && script.Succeed)
            {
                OnSuccess(new ScriptSuccess(script));
            }
            OnInfo(script, _scriptcontrol.WScriptEcho);
        }
Exemplo n.º 3
0
 public static void Run() {
     using (var scriptcontrol = new ScriptControl()) {
         scriptcontrol.Build();
         ScriptDebugger.Debug(scriptcontrol, false);
     }
 }