static int ViewPointCompare(AVViewPoint A, AVViewPoint B) { // these next two lines provide a value for // views which provide no index. int a = A.InsertionIndex.HasValue ? A.InsertionIndex.Value: 0; int b = B.InsertionIndex.HasValue ? B.InsertionIndex.Value: 0; // Use string comparison for values with equal indexes. if (a == b) { return(A.Title.CompareTo(B.Title)); } // Standard comparison. return(a - b); }
static int ViewPointCompare_Reverse(AVViewPoint A, AVViewPoint B) { return(ViewPointCompare(A, B) * -1); }