public void AddPoint(TimePoint point) { // Under typical usage we'll always be adding points at a later timespan anyway, // but just to be sure, we check from the end of the list to keep things sorted. int insertIndex; for (insertIndex = _points.Count - 1; insertIndex >= 0; --insertIndex) { if (_points[insertIndex].Time <= point.Time) { break; } } ++insertIndex; PreInsert(insertIndex, point); _points.Insert(insertIndex, point); }
private void PreInsert(int index, TimePoint timePoint) { if (index == 0) { Start = timePoint.Time; } if (index == _points.Count) { End = timePoint.Time; } if (_minValue == null || timePoint.Value < _minValue.Value) { _minValue = timePoint.Value; } if (_maxValue == null || timePoint.Value > _maxValue.Value) { _maxValue = timePoint.Value; } _runningTotal += timePoint.Value; }
public TimePointInterval(TimePoint both) : this(both, both) { }
public TimePointInterval(TimePoint start, TimePoint end) { Start = start; End = end; }