public TimeSpan ToTimeSpan()
 {
     if (this.ivalidated)
     {
         this.timeSpan   = GaugePeriod.PeriodToTimeSpan(this.duration, this.periodType);
         this.ivalidated = false;
     }
     return(this.timeSpan);
 }
 public TimeSpan ToTimeSpan()
 {
     if (this.IsTimeBased && !this.IsEmpty)
     {
         if (this.IsInfinity)
         {
             return(TimeSpan.MaxValue);
         }
         if (this.ivalidated)
         {
             this.timeSpan   = GaugePeriod.PeriodToTimeSpan(this.count, GaugeDuration.MapToPeriodType(this.durationType));
             this.ivalidated = false;
         }
         return(this.timeSpan);
     }
     return(TimeSpan.Zero);
 }