Exemple #1
0
        public FilteredTracks AddFilter(TrackDanceFilter filter)
        {
            if (string.IsNullOrEmpty(filter.Name))
            {
                throw new ApplicationException("Filter name must be specified.");
            }

            var fi = new FilteredTracks(this, filter);

            _allFilters.Add(fi);
            if (!String.IsNullOrEmpty(fi.FilterGroup))
            {
                var fg = _filterGroups.SingleOrDefault((g) => g.Name.Equals(fi.FilterGroup, StringComparison.InvariantCultureIgnoreCase));
                if (fg == null)
                {
                    fg = new FilterGroup(fi.FilterGroup);
                    _filterGroups.Add(fg);
                }
                fg.Add(fi);
            }
            return(fi);
        }
Exemple #2
0
 public LibraryFilter(Library library, TrackDanceFilter defaultFilter = null)
 {
     Library       = library;
     DefaultFilter = new FilteredTracks(this, defaultFilter ?? new TrackDanceFilter(), true);
     FilterGroups  = new ReadOnlyObservableCollection <FilterGroup>(_filterGroups);
 }