Пример #1
0
        public void FilterDLCs(DLCList DLCList)
        {
            var dlcTypes = ComboBoxDLCType.GetSelectedItem <DLCType>();
            var words    = TextFilterDLCs.Text?.Split(" ");

            DLCList.FilterItems(item => DLCPredicateFast(item, dlcTypes, words));
        }
Пример #2
0
        public DLCControl()
        {
            InitializeComponent();
            foreach (DataGridViewColumn col in dgDLCs.Columns)
            {
                col.SortMode = DataGridViewColumnSortMode.Programmatic;
                col.Width   += 1; // workaround : show Glyph
            }

            ComboBoxDLCType.SetItems <DLCType>();
            ComboBoxDLCType.SelectedIndex         = 0;
            ComboBoxDLCType.SelectedIndexChanged += ApplyDLCFilter;
            TextFilterDLCs.TextChanged           += ApplyDLCFilter;

            IncludeAlDLCs.Click  += IncludeAllDLCs_Click;
            ExcludeAllDLCs.Click += ExcludeAllDLCs_Click;

            var buttons  = DLCActionPanel.Controls.OfType <Button>();
            var maxwidth = buttons.Max(b => b.Width);

            foreach (var b in buttons)
            {
                b.MinimumSize = new Size(maxwidth, 0);
            }

            LoadDLCs();

            dgDLCs.CellValueNeeded += DgDLCs_CellValueNeeded;
            dgDLCs.CellValuePushed += DgDLCs_CellValuePushed;
            dgDLCs.CurrentCellDirtyStateChanged += DgDLCs_CurrentCellDirtyStateChanged;
            dgDLCs.ColumnHeaderMouseClick       += DgDLCs_ColumnHeaderMouseClick;
            dgDLCs.CellContentClick             += DgDLCs_OnCellContentClick;
            dgDLCs.CellToolTipTextNeeded        += DgDLCs_OnCellToolTipTextNeeded;
            dgDLCs.DataError      += DgDLCs_DataError;
            dgDLCs.VisibleChanged += DgDLCs_VisibleChanged;
        }