public FilterConfigurator(IFilterableCollection filterableCollection, FilterablePropertyDescriptionCollection availableFilterableProperties, FilterParams selectedFilter) { DefaultStyleKey = typeof(FilterConfigurator); _filterableCollection = filterableCollection; _beginningSelectedFilter = selectedFilter; Filters.Clear(); if (_filterableCollection != null && _filterableCollection.AllFilters != null) { foreach (var filterParams in filterableCollection.AllFilters) { Filters.Add(filterParams); } } FilterableArguments = availableFilterableProperties; SelectedFilterConfiguration = selectedFilter; if (selectedFilter != null) { SelectedExpression = selectedFilter.Conditions.Root; } //Set the default owner to the app main window (if possible) if (Application.Current != null && Application.Current.MainWindow != this) { Owner = Application.Current.MainWindow; } }
/// <inheritdoc /> public void ApplyFilter([NotNull] IFilterableCollection <T> coll) { if (coll == null) { throw new ArgumentNullException(nameof(coll)); } coll.ApplyFilter(this); }
public CollectionFilterVisitor(IFilterableCollection <T> i_FilterableCollection) { m_FilterableCollection = i_FilterableCollection; m_CollectionToFilter = i_FilterableCollection.Collection; m_SavedCollection = new List <T>(); // save the original collection to be able to restore it foreach (T item in m_CollectionToFilter) { m_SavedCollection.Add(item); } }
/// <inheritdoc /> public void ApplyFilter(IFilterableCollection <T> coll) { coll.ApplyFilter(this); }