Ejemplo n.º 1
0
        /// <summary>
        /// Checks current filters on a <see cref="TrackItemData"/> instance.
        /// </summary>
        /// <param name="trackItem"><see cref="TrackItemData"/></param>
        /// <param name="checkInvalidNumber">Checks invalid track number.</param>
        /// <param name="checkEmpty">Checks empty track title.</param>
        /// <param name="checkEmptyAlbumArtist">Checks empty album artist.</param>
        /// <param name="checkSeveralAlbumArtist">Checks multiple alum artists.</param>
        /// <param name="checkEmptyAlbum">Checks empty album.</param>
        /// <param name="checkEmptyPerformer">Checks empty performer.</param>
        /// <param name="checkDuplicatePerformers">Checks duplicate performers.</param>
        /// <param name="checkEmptyGenre">Checks empty genre.</param>
        /// <param name="checkDuplicateGenres">Checks duplicate genres.</param>
        /// <param name="checkInvalidYear">Checks invalid year.</param>
        /// <param name="checkInvalidFrontCover">Checks tracks without front cover.</param>
        /// <returns><c>True</c> if all filters apply; <c>False</c> otherwise.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="trackItem"/> is <c>Null</c>.</exception>
        public bool CheckTracksFilters(TrackItemData trackItem, bool checkInvalidNumber, bool checkEmpty, bool checkEmptyAlbumArtist,
                                       bool checkSeveralAlbumArtist, bool checkEmptyAlbum, bool checkEmptyPerformer, bool checkDuplicatePerformers,
                                       bool checkEmptyGenre, bool checkDuplicateGenres, bool checkInvalidYear, bool checkInvalidFrontCover)
        {
            if (trackItem == null)
            {
                throw new ArgumentNullException(nameof(trackItem));
            }

            return(ApplyFilters(new List <TrackItemData> {
                trackItem
            },
                                checkInvalidNumber, checkEmpty, checkEmptyAlbumArtist, checkSeveralAlbumArtist,
                                checkEmptyAlbum, checkEmptyPerformer, checkDuplicatePerformers, checkEmptyGenre,
                                checkDuplicateGenres, checkInvalidYear, checkInvalidFrontCover
                                ).Any());
        }
Ejemplo n.º 2
0
        private void MatchTrackToViewSource(TrackItemData trackItem)
        {
            bool itemMatchFilter = _libraryViewData.CheckTracksFilters(trackItem,
                                                                       InvalidNumberTracksCheckBox.IsChecked == true,
                                                                       EmptyTracksCheckBox.IsChecked == true,
                                                                       EmptyAlbumArtistTracksCheckBox.IsChecked == true,
                                                                       SeveralAlbumArtistTracksCheckBox.IsChecked == true,
                                                                       EmptyAlbumTracksCheckBox.IsChecked == true,
                                                                       EmptyPerformerTracksCheckBox.IsChecked == true,
                                                                       DuplicatePerformersTracksCheckBox.IsChecked == true,
                                                                       EmptyGenreTracksCheckBox.IsChecked == true,
                                                                       DuplicateGenresTracksCheckBox.IsChecked == true,
                                                                       InvalidYearTracksCheckBox.IsChecked == true,
                                                                       InvalidFrontCoverTracksCheckBox.IsChecked == true);

            if (!itemMatchFilter)
            {
                TracksView.Items.Remove(trackItem);
            }
        }