NtDataObjectDtComparer

This class is an implementation of the System.Collections.Generic.IComparer<T> interface that is used to support sorting of collections (like lists) of NtDataObjects.
NtDataObjectDtComparer compares two NtDataObjects with respect to their time stamp (member dt).

Class Hierarchy:

System.Object

NtDataObjectDtComparer

Methods and Properties:

Modifier / Return Value Name and Parameters Description
public int Compare ( NtDataObject a, NtDataObject b ) Compares the two NtDataObjects a and b with respect to their time stamps (member dt). Returns 1 if a is later than b and -1 if a is earlier than b. If both are at the same time, the dtEnd member is evaluated as well. And if even this is the same then the objId is being used. This method ensures a clear sort order in all cases so that running a sort procedure always returns the same order of objects independently of any random effects in the sort order algorithm. In other words: Whenever a collection (like a list) is once sorted, you can run the sort operation again and again without changing the order of the collection even if some members are equal in terms of time stamps. This is important e.g. if you want to check the equality of two collections: sort them and then simply compare them element by element.