Removed unnecessary code.

This commit is contained in:
Michael Bucari-Tovo 2021-08-10 00:05:18 -06:00
parent 6f184273b8
commit 235d0acede
2 changed files with 3 additions and 20 deletions

View File

@ -181,15 +181,15 @@ namespace LibationWinForms
var productIds = searchResults.Docs.Select(d => d.ProductId).ToList(); var productIds = searchResults.Docs.Select(d => d.ProductId).ToList();
// https://stackoverflow.com/a/18942430 // https://stackoverflow.com/a/18942430
var currencyManager = (CurrencyManager)BindingContext[_dataGridView.DataSource]; var bindingContext = BindingContext[_dataGridView.DataSource];
currencyManager.SuspendBinding(); bindingContext.SuspendBinding();
{ {
for (var r = _dataGridView.RowCount - 1; r >= 0; r--) for (var r = _dataGridView.RowCount - 1; r >= 0; r--)
_dataGridView.Rows[r].Visible = productIds.Contains(getGridEntry(r).AudibleProductId); _dataGridView.Rows[r].Visible = productIds.Contains(getGridEntry(r).AudibleProductId);
} }
//Causes repainting of the DataGridView //Causes repainting of the DataGridView
currencyManager.ResumeBinding(); bindingContext.ResumeBinding();
VisibleCountChanged?.Invoke(this, _dataGridView.AsEnumerable().Count(r => r.Visible)); VisibleCountChanged?.Invoke(this, _dataGridView.AsEnumerable().Count(r => r.Visible));
} }

View File

@ -27,8 +27,6 @@ namespace LibationWinForms
protected override ListSortDirection SortDirectionCore => listSortDirection; protected override ListSortDirection SortDirectionCore => listSortDirection;
protected override bool SupportsSearchingCore => true;
protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction) protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
{ {
List<T> itemsList = (List<T>)Items; List<T> itemsList = (List<T>)Items;
@ -57,20 +55,5 @@ namespace LibationWinForms
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
} }
protected override int FindCore(PropertyDescriptor property, object key)
{
int count = Count;
for (int i = 0; i < count; ++i)
{
T element = this[i];
if (property.GetValue(element).Equals(key))
{
return i;
}
}
return -1;
}
} }
} }