private void Sort(bool blnPerformLayout = true) { if (_objSortPausedSender != null) { return; } if (_eSortType == SortOrder.None || _sortColumn == null) { // sort by index _lstPermutation.Sort(); } else { Comparison <T> comparison = _sortColumn.CreateSorter(); _lstPermutation.Sort((i1, i2) => comparison(_lstItems[i1], _lstItems[i2])); if (_eSortType == SortOrder.Descending) { _lstPermutation.Reverse(); } } if (blnPerformLayout) { this.DoThreadSafe(x => x.PerformLayout()); } }
private void Sort(bool performLayout = true) { if (_sortPausedSender != null) { return; } if (_sortType == SortOrder.None || _sortColumn == null) { // sort by index _permutation.Sort(); } else { Comparison <T> comparison = _sortColumn.CreateSorter(); _permutation.Sort((i1, i2) => comparison(_items[i1], _items[i2])); if (_sortType == SortOrder.Descending) { _permutation.Reverse(); } } if (performLayout) { PerformLayout(); } }