protected DataValue ComputeStartEnd2(TimeSlice slice, bool returnEnd)
{
// get the values in the slice.
List<DataValue> values = GetValuesWithSimpleBounds(slice);
// check for empty slice.
if (values == null || values.Count == 0)
{
return GetNoDataValue(slice);
}
DataValue value = null;
// return start bound.
if ((!returnEnd && !TimeFlowsBackward) || (returnEnd && TimeFlowsBackward))
{
value = values[0];
}
// return end bound.
else
{
value = values[values.Count - 1];
}
if (returnEnd)
{
value.SourceTimestamp = GetTimestamp(slice);
value.ServerTimestamp = GetTimestamp(slice);
if (StatusCode.IsNotBad(value.StatusCode))
{
value.StatusCode = value.StatusCode.SetAggregateBits(AggregateBits.Calculated);
}
}
return value;
}