コード例 #1
0
 public void DeleteCustomFilter(FilterItem filterItem)
 {
     try
     {
         CustomFilters.Remove(filterItem);
         SaveCustomFilters();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #2
0
 public void DuplicateFilter(FilterItem filterItem)
 {
     try
     {
         var newItem = filterItem.Clone("Copy of " + filterItem.Name, null);
         CustomFilters.Add(newItem);
         SaveCustomFilters();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #3
0
 public void CreateCustomFilter(string module)
 {
     try
     {
         if (module != string.Empty && this.settings.Module != module)
         {
             return;
         }
         FilterItem filterItem      = CreateFilterItem(string.Empty, null, null);
         var        filterViewModel = CreateCustomFilterViewModel(filterItem, true);
         ShowFilter(filterItem, filterViewModel, () => AddNewCustomFilter(filterItem));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #4
0
 public void ModifyCustomFilterCriteria(FilterItem existing, CriteriaOperator criteria)
 {
     try
     {
         if (!ReferenceEquals(existing.FilterCriteria, null) && !ReferenceEquals(criteria, null) && existing.FilterCriteria.ToString() == criteria.ToString())
         {
             return;
         }
         existing.FilterCriteria = criteria;
         SaveCustomFilters();
         if (existing == SelectedItem)
         {
             OnSelectedItemChanged();
         }
         UpdateFilters();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #5
0
 void ShowFilter(FilterItem filterItem, CustomFilterViewModel filterViewModel, Action onSave)
 {
     try
     {
         if (FilterDialogService.ShowDialog(MessageButton.OKCancel, "Crear Filtro Persnalizado", "CustomFilterView", filterViewModel) != MessageResult.OK)
         {
             return;
         }
         filterItem.FilterCriteria = filterViewModel.FilterCriteria;
         filterItem.Name           = filterViewModel.FilterName;
         ActiveFilterItem          = filterItem;
         if (filterViewModel.Save)
         {
             onSave();
             UpdateFilters();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #6
0
 public void ModifyCustomFilter(FilterItem existing)
 {
     try
     {
         FilterItem clone           = existing.Clone();
         var        filterViewModel = CreateCustomFilterViewModel(clone, true);
         ShowFilter(clone, filterViewModel, () =>
         {
             existing.FilterCriteria = clone.FilterCriteria;
             existing.Name           = clone.Name;
             SaveCustomFilters();
             if (existing == SelectedItem)
             {
                 OnSelectedItemChanged();
             }
         });
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #7
0
 FilterItem CreateFilterItem(string name, CriteriaOperator filterCriteria, string imageUri)
 {
     return(FilterItem.Create(GetEntityCount(filterCriteria), name, filterCriteria, imageUri, this));
 }
コード例 #8
0
 public FilterItem Clone(string name, string imageUri)
 {
     return(FilterItem.Create(EntitiesCount, name, FilterCriteria, imageUri, FilterTreeViewModel));
 }
コード例 #9
0
 public FilterItem Clone()
 {
     return(FilterItem.Create(EntitiesCount, Name, FilterCriteria, ImageUri, FilterTreeViewModel));
 }