Ejemplo n.º 1
0
        public void FilterDLCs(DLCList DLCList)
        {
            var dlcTypes = ComboBoxDLCType.GetSelectedItem <DLCType>();
            var words    = TextFilterDLCs.Text?.Split(" ");

            DLCList.FilterItems(item => DLCPredicateFast(item, dlcTypes, words));
        }
Ejemplo n.º 2
0
        // 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);
            }
        }
Ejemplo n.º 3
0
 public void FilterDLCs() => DLCList?.FilterItems();