public void FilterDLCs(DLCList DLCList) { var dlcTypes = ComboBoxDLCType.GetSelectedItem <DLCType>(); var words = TextFilterDLCs.Text?.Split(" "); DLCList.FilterItems(item => DLCPredicateFast(item, dlcTypes, words)); }
// sort void DgDLCs_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { if (DLCList == null) { return; } if (e.ColumnIndex == prevSortCol_) { sortAssending_ = !sortAssending_; } else { sortAssending_ = true; foreach (DataGridViewColumn col in dgDLCs.Columns) { col.HeaderCell.SortGlyphDirection = SortOrder.None; } } var sortOrder = sortAssending_ ? SortOrder.Ascending : SortOrder.Descending; dgDLCs.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = sortOrder; prevSortCol_ = e.ColumnIndex; if (e.ColumnIndex == CInclude.Index) { DLCList.SortItemsBy(item => item.IsIncluded, sortAssending_); } else if (e.ColumnIndex == CName.Index) { DLCList.SortItemsBy(item => item.Text, sortAssending_); } else if (e.ColumnIndex == CDLCType.Index) { DLCList.SortItemsBy(item => item.DLCType, sortAssending_); } dgDLCs.Rows.Clear(); DLCList.FilterItems(); DgDLCs_Refresh(); } catch (Exception ex) { Log.Exception(ex); } }
public void FilterDLCs() => DLCList?.FilterItems();