Edit
This commit is contained in:
parent
89059510fd
commit
3535156ea5
@ -22,12 +22,9 @@ namespace LibationWinForms
|
|||||||
internal class FilterableSortableBindingList : SortableBindingList<GridEntry>, IBindingListView
|
internal class FilterableSortableBindingList : SortableBindingList<GridEntry>, IBindingListView
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Items that were removed from the list due to filtering
|
/// Items that were removed from the base list due to filtering
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<GridEntry> FilterRemoved = new();
|
private readonly List<GridEntry> FilterRemoved = new();
|
||||||
/// <summary>
|
|
||||||
/// Tracks all items in the list, both filtered and not.
|
|
||||||
/// </summary>
|
|
||||||
private string FilterString;
|
private string FilterString;
|
||||||
private Action Sort;
|
private Action Sort;
|
||||||
public FilterableSortableBindingList(IEnumerable<GridEntry> enumeration) : base(enumeration)
|
public FilterableSortableBindingList(IEnumerable<GridEntry> enumeration) : base(enumeration)
|
||||||
@ -44,8 +41,7 @@ namespace LibationWinForms
|
|||||||
#region Unused - Advanced Filtering
|
#region Unused - Advanced Filtering
|
||||||
public bool SupportsAdvancedSorting => false;
|
public bool SupportsAdvancedSorting => false;
|
||||||
|
|
||||||
|
//This ApplySort overload if only called is SupportsAdvancedSorting is true.
|
||||||
//This ApplySort overload is only called is SupportsAdvancedSorting is true.
|
|
||||||
//Otherwise BindingList.ApplySort() is used
|
//Otherwise BindingList.ApplySort() is used
|
||||||
public void ApplySort(ListSortDescriptionCollection sorts) => throw new NotImplementedException();
|
public void ApplySort(ListSortDescriptionCollection sorts) => throw new NotImplementedException();
|
||||||
|
|
||||||
@ -58,6 +54,7 @@ namespace LibationWinForms
|
|||||||
base.Remove(entry);
|
base.Remove(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <returns>All items in the list, including those filtered out.</returns>
|
||||||
public List<GridEntry> AllItems() => Items.Concat(FilterRemoved).ToList();
|
public List<GridEntry> AllItems() => Items.Concat(FilterRemoved).ToList();
|
||||||
|
|
||||||
private void ApplyFilter(string filterString)
|
private void ApplyFilter(string filterString)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user