Ejemplo n.º 1
0
 internal void ParseLine(string line)
 {
     if (this.Enabled)
     {
         TimeSpan totalDuration = (this.lastProgressArgs != null) ? this.lastProgressArgs.TotalDuration : TimeSpan.Zero;
         Match    match         = DurationRegex.Match(line);
         if (match.Success)
         {
             TimeSpan zero = TimeSpan.Zero;
             if (TimeSpan.TryParse(match.Groups["duration"].Value, out zero))
             {
                 TimeSpan span3 = totalDuration.Add(zero);
                 this.lastProgressArgs = new ConvertProgressEventArgs(TimeSpan.Zero, span3);
             }
         }
         Match match2 = ProgressRegex.Match(line);
         if (match2.Success)
         {
             TimeSpan result = TimeSpan.Zero;
             if (TimeSpan.TryParse(match2.Groups["progress"].Value, out result))
             {
                 if (this.progressEventCount == 0)
                 {
                     totalDuration = this.CorrectDuration(totalDuration);
                 }
                 this.lastProgressArgs = new ConvertProgressEventArgs(result, (totalDuration != TimeSpan.Zero) ? totalDuration : result);
                 this.ProgressCallback(this.lastProgressArgs);
                 this.progressEventCount++;
             }
         }
     }
 }
Ejemplo n.º 2
0
 internal void OnConvertProgress(ConvertProgressEventArgs args)
 {
     if (this.ConvertProgress != null)
     {
         this.ConvertProgress(this, args);
     }
 }
Ejemplo n.º 3
0
 internal void Reset()
 {
     this.progressEventCount = 0;
     this.lastProgressArgs   = null;
 }