/// <summary> /// Adds the specified operation to this group. If the group's type (and/or) is different than the groupType /// parameter, a new group is spawned and added to this one, /// </summary> /// <param name="groupType"></param> /// <param name="operationToAdd"></param> public void InjectCriteriaAndReformatGroupIfNecessary(SearchOperationGroupType groupType, SearchOperation operationToAdd) { if (GroupType == groupType) { Criteria.Add(operationToAdd); // easy return; } // ok, so the group type is different // we create a new group var sog = new SearchOperationGroup(); sog.GroupType = GroupType; // copy over the current criteria sog.Criteria.AddRange(Criteria); // clear the criteria from this group Criteria.Clear(); // set the new type GroupType = GroupType; // add the old criteria, grouped Criteria.Add(sog); // and add the new operatoin Criteria.Add(operationToAdd); }
private void OnClear() { Criteria.Clear(); OrderByProperty = null; OrderByDescending = false; MaxTracks = null; Criteria.Add(new CriteriaGroupViewModel(new List <CriteriaViewModel> { new CriteriaViewModel() }) { IsLastGroup = true }); Results = new List <Track>(); }
/*public void LoadCriteria(Preset preset) * { * LoadCriteria(preset.Criteria); * }*/ public void LoadCriteria(IEnumerable <Criteria> criteria) { Criteria.Clear(); Criteria.AddRange(criteria); }
public void Clear() { Criteria.Clear(); }