コード例 #1
0
 public TimeSpan ToTimeSpan()
 {
     if (this.ivalidated)
     {
         this.timeSpan   = GaugePeriod.PeriodToTimeSpan(this.duration, this.periodType);
         this.ivalidated = false;
     }
     return(this.timeSpan);
 }
コード例 #2
0
 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);
 }