Esempio n. 1
0
 public RunOutcome Run()
 {
     try
     {
         File.Copy(_source, _destination, _overwrite);
         return(RunOutcome.Succeeded);
     }
     catch (Exception e)
     {
         StaticLogger.WriteErrorLine($"Error copying {_source} to {_destination}");
         StaticLogger.WriteErrorLine(e.ToString());
         return(RunOutcome.Failed);
     }
 }
 public RunOutcome Run()
 {
     try
     {
         StaticLogger.WriteLine($"Starting step: {this._name}");
         this._run();
         StaticLogger.WriteLine($"Finished step: {this._name}");
         return(RunOutcome.Succeeded);
     }
     catch (Exception e)
     {
         StaticLogger.WriteErrorLine($"Error in step: {this._name}, error: {e.ToString()}");
         return(RunOutcome.Failed);
     }
 }
Esempio n. 3
0
        public IRun Run()
        {
            var run = new Run();

            try
            {
                StaticLogger.WriteLine($"Starting step: {this._name}");
                run.Start();
                this._run();
                run.End();
                StaticLogger.WriteLine($"Finished step: {this._name}");
                return(run);
            }
            catch (Exception e)
            {
                StaticLogger.WriteErrorLine($"Error in step: {this._name}, error: {e.ToString()}");
                run.End();
                return(new FaultedRun(run));
            }
        }