/// <summary> /// Change the list filter to the currently selected (checked) FilterList item. /// This selection is stored in the property table based on the name of the filter /// associated with the current clerk. /// </summary> private void OnChangeFilterToCheckedListPropertyChoice() { string filterName = m_mediator.PropertyTable.GetStringProperty(CurrentFilterPropertyTableId, "", PropertyTable.SettingsGroup.LocalSettings); RecordFilter addf = null; RecordFilter remf = null; var nof = new NoFilters(); // Check for special cases. if (filterName == (new UncheckAll()).Name) { // we're simply unselecting all items in the list. // no need for further changes. return; } if (filterName == nof.Name) { OnChangeFilterClearAll(null); // get rid of all the ones we're allowed to. return; } else if (m_filterProvider != null) { addf = (RecordFilter)m_filterProvider.GetFilter(filterName); if (addf == null || addf is NullFilter) { // If we have no filter defined for this name, it is effectively another way to turn // filters off. Turn off all we can. OnChangeFilterClearAll(null); // get rid of all the ones we're allowed to. return; } // If we have a menu-type filter active, remove it. Otherwise don't remove anything. remf = m_activeMenuBarFilter; m_activeMenuBarFilter = addf is NullFilter ? null : addf; } OnChangeFilter(new FilterChangeEventArgs(addf, remf)); }
/// <summary> /// Change the list filter to the currently selected (checked) FilterList item. /// This selection is stored in the property table based on the name of the filter /// associated with the current clerk. /// </summary> private void OnChangeFilterToCheckedListPropertyChoice() { string filterName = m_mediator.PropertyTable.GetStringProperty(this.CurrentFilterPropertyTableId, "", PropertyTable.SettingsGroup.LocalSettings); RecordFilter addf = null; RecordFilter remf = null; NoFilters nof = new NoFilters(); // Check for special cases. if (filterName == (new Filters.UncheckAll()).Name) { // we're simply unselecting all items in the list. // no need for further changes. return; } else if (filterName == nof.Name) { remf = Filter; m_activeMenuBarFilter = null; } else if (m_filterProvider != null) { addf = (RecordFilter)m_filterProvider.GetFilter(filterName); // If we have a filter defined for this filterName, then only remove the activeMenuBarFilter. // Otherwise remove all filters. if (addf != null) remf = m_activeMenuBarFilter; else remf = Filter; m_activeMenuBarFilter = addf is NullFilter ? null : addf; } OnChangeFilter(new FilterChangeEventArgs(addf, remf)); }