/// <summary> /// Advances the enumerator to the next element of the collection. /// </summary> /// <returns> /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. /// </returns> /// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception> public bool MoveNext() { _currentBucket++; //Is all bucket out if (_currentBucket == _contourBucket.ContourBuckets.Count) { return(false); } _current.Start = _workCalendar.AddDuration(_current.End, 0, false); long bucketDuration = _contourBucket.ContourBuckets[_currentBucket].GetBucketDuration(_assignmentDuration); _current.End = _workCalendar.AddDuration(_current.Start, bucketDuration, true); return(true); }
public void CalendarTest() { WorkCalendarFactory calFactory = new WorkCalendarFactory(); WorkCalendarBase calendar = calFactory.Create <DefaultCalendar>(null); long start = CalendarHelper.Tick2Milis(new DateTime(2008, 01, 01).Ticks); start += CalendarHelper.MilisPerHour(); long duration = CalendarHelper.MilisPerHour() * 1; long result = calendar.AddDuration(start, duration, false); duration = calendar.SubstractDates(result, start, false); }