/// <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);
        }
예제 #2
0
        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>();
        }
예제 #3
0
            /*public void LoadCriteria(Preset preset)
             * {
             *  LoadCriteria(preset.Criteria);
             * }*/

            public void LoadCriteria(IEnumerable <Criteria> criteria)
            {
                Criteria.Clear();
                Criteria.AddRange(criteria);
            }
예제 #4
0
 public void Clear()
 {
     Criteria.Clear();
 }