Example #1
0
 public Runner(Parameters parameters, CancellationToken cancellationToken, TextWriter writer)
     : base(parameters, writer, cancellationToken)
 {
     this.stepProgress = new Progress<Indicator>();
 }
Example #2
0
 private static string GetTimeFormat(Parameters parameters)
 {
     return Reformat(parameters.TimeFormat);
 }
Example #3
0
 protected RunnerBase(Parameters parameters, TextWriter writer, CancellationToken cancellationToken)
     : this(parameters.Verbosity, GetFormats(parameters), writer, cancellationToken, new Progress<Indicator>(), new SemaphoreSlim(1))
 {
 }
Example #4
0
 private static string GetStepPrologueFormat(Parameters parameters)
 {
     return parameters.Verbosity == Verbosity.Insane
         ? " STEP {1}/{2} {0}"
         : " {0}";
 }
Example #5
0
 private static string GetStepProgressFormat(Parameters parameters)
 {
     return parameters.Verbosity == Verbosity.Insane
         ? "{0}  {1:000.00}%  "
         : "{0}  ";
 }
Example #6
0
 private static string GetStepEpilogueFormat(Parameters parameters)
 {
     return parameters.Verbosity == Verbosity.Insane
         ? " FINISHED {1}IN {0}"
         : " {1}FINISHED IN {0}";
 }
Example #7
0
 private static Formats GetFormats(Parameters parameters)
 {
     return new Formats
     {
         Time = GetTimeFormat(parameters),
         Duration = GetDurationFormat(parameters),
         StepPrologue = GetStepPrologueFormat(parameters),
         StepEpilogue = GetStepEpilogueFormat(parameters),
         StepProgress = GetStepProgressFormat(parameters),
     };
 }
Example #8
0
 private static string GetDurationFormat(Parameters parameters)
 {
     var init = parameters.DurationFormat.Trim();
     var split = parameters.DurationFormat.Split(':', '.', ',', '-', '/', ' ');
     int index = 0;
     string durationFormat = null;
     foreach (var s in split)
     {
         if (!string.IsNullOrEmpty(s))
         {
             durationFormat += Reformat(s);
             index += s.Length;
         }
         if (index < init.Length - 1)
             durationFormat += init[index++];
     }
     return durationFormat;
 }