protected int CompareTimestamps(DataValue value1, DataValue value2)
{
if (value1 == null)
{
return (value2 == null)?0:-1;
}
if (value2 == null)
{
return +1;
}
if (UseServerTimestamp)
{
int result = value1.ServerTimestamp.CompareTo(value2.ServerTimestamp);
if (result == 0)
{
return value1.ServerPicoseconds.CompareTo(value2.ServerPicoseconds);
}
return result;
}
else
{
int result = value1.SourceTimestamp.CompareTo(value2.SourceTimestamp);
if (result == 0)
{
return value1.SourcePicoseconds.CompareTo(value2.SourcePicoseconds);
}
return result;
}
}