示例#1
0
        public void Remove(DocumentFilterEntryViewModel entryViewModel)
        {
            if (entryViewModel == null)
            {
                throw new ArgumentNullException(nameof(entryViewModel));
            }

            this.AdjustFilterEntries(entryViewModel, (entries, e) => entries.Remove(e));
            this.ApplyCurrentFilters();
        }
示例#2
0
 private static bool Exists(DocumentFilterViewModel filterViewModel, DocumentFilterEntryViewModel searchEntryViewModel)
 {
     foreach (var entryViewModel in filterViewModel.Entries)
     {
         if (entryViewModel == searchEntryViewModel)
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
 private void AdjustFilterEntries(DocumentFilterEntryViewModel entryViewModel, Action <ObservableCollection <DocumentFilterEntryViewModel>, DocumentFilterEntryViewModel> operation)
 {
     foreach (var filterViewModel in this.Filters)
     {
         var exists = Exists(filterViewModel, entryViewModel);
         if (exists)
         {
             operation(filterViewModel.SelectedEntries, entryViewModel);
             break;
         }
     }
 }