コード例 #1
0
        public FilterConditionGroupViewModel(FilterViewModel parentFilter)
        {
            this.parentFilter = parentFilter;

            Conditions = new ObservableCollection<FilterConditionViewModel>();

            IsEnabled = true;
        }
コード例 #2
0
 public FilterViewModel GetDuplicate()
 {
     FilterViewModel newFilter = new FilterViewModel();
     newFilter.DisplayName = this.DisplayName + " (copy)";
     newFilter.ConditionGroups = new ObservableCollection<FilterConditionGroupViewModel>(ConditionGroups.Select(cg => cg.GetDuplicate(newFilter)));
     return newFilter;
 }
コード例 #3
0
 public static FilterViewModel CreateNew()
 {
     FilterViewModel newFilter = new FilterViewModel();
     newFilter.DisplayName = DateTime.Now.ToString();
     FilterConditionGroupViewModel newGroup = new FilterConditionGroupViewModel(newFilter);
     newGroup.Conditions.Add(new FilterConditionViewModel(newGroup));
     newFilter.ConditionGroups.Add(newGroup);
     return newFilter;
 }
コード例 #4
0
 public FilterConditionGroupViewModel GetDuplicate(FilterViewModel newParent)
 {
     FilterConditionGroupViewModel newGroup = new FilterConditionGroupViewModel(newParent);
     newGroup.Conditions = new ObservableCollection<FilterConditionViewModel>(this.Conditions.Select(c => c.GetDuplicate(newGroup)));
     newGroup.IsExclude = this.IsExclude;
     newGroup.IsEnabled = this.IsEnabled;
     return newGroup;
 }