void CorrectSortIndex for int sortByIndexColumns Count if sortByIndexC

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void CorrectSortIndex() {
for (int i = 0; i < sortByIndexColumns.Count - 1; i++) {
if (sortByIndexColumns[i].SortIndex == sortByIndexColumns[i + 1].SortIndex) {
List<ISortingSettingsAccessor> sameIndexColumns = new List<ISortingSettingsAccessor>();
sameIndexColumns.Add(sortByIndexColumns[i]);
sortByIndexColumns.RemoveAt(i);
for (int j = i; j < sortByIndexColumns.Count; j++) {
if (sameIndexColumns[0].SortIndex != sortByIndexColumns[i].SortIndex) {
SortSameIndexes(sameIndexColumns, i);
break;
} else {
sameIndexColumns.Add(sortByIndexColumns[i]);
sortByIndexColumns.RemoveAt(i);
}
}
if (sameIndexColumns.Count > 0) {
SortSameIndexes(sameIndexColumns, i);
}
}
}
}
void SortSameIndexes(IList<ISortingSettingsAccessor> sameIndexColumns, int position) {
}