コード例 #1
0
        private void comboBoxPlatform_SelectedIndexChanged(object sender, EventArgs e)
        {
            labelId.Text           = "-";
            labelGenre.Text        = "-";
            labelPublisher.Text    = "-";
            labelDeveloper.Text    = "-";
            labelDescription.Text  = "-";
            labelYearReleased.Text = "-";
            labelBoxart.Text       = "-";
            labelTitle.Text        = "-";
            labelGameplay.Text     = "-";

            Roms.Clear();
            Roms.AddRange(RomBusiness.GetAll().Where(r => r.Platform != null && r.Platform.Name == comboBoxPlatform.Text).ToList());

            labelId.Text           = Roms.Where(x => string.IsNullOrEmpty(x.Id)).Count().ToString();
            labelGenre.Text        = Roms.Where(x => x.Genre == null).Count().ToString();
            labelPublisher.Text    = Roms.Where(x => string.IsNullOrEmpty(x.Publisher)).Count().ToString();
            labelDeveloper.Text    = Roms.Where(x => string.IsNullOrEmpty(x.Developer)).Count().ToString();
            labelDescription.Text  = Roms.Where(x => string.IsNullOrEmpty(x.Description)).Count().ToString();
            labelYearReleased.Text = Roms.Where(x => string.IsNullOrEmpty(x.YearReleased)).Count().ToString();

            var boxartPictures   = RomFunctions.GetRomPicturesByPlatform(comboBoxPlatform.Text, Values.BoxartFolder);
            var titlePictures    = RomFunctions.GetRomPicturesByPlatform(comboBoxPlatform.Text, Values.TitleFolder);
            var gameplayPictures = RomFunctions.GetRomPicturesByPlatform(comboBoxPlatform.Text, Values.GameplayFolder);

            var romsList = Roms.Select(x => x.Name).ToList();

            missingBoxartPictures   = romsList.Except(boxartPictures).ToList();
            missingTitlePictures    = romsList.Except(titlePictures).ToList();
            missingGameplayPictures = romsList.Except(gameplayPictures).ToList();

            labelBoxart.Text   = missingBoxartPictures.Count().ToString();
            labelTitle.Text    = missingTitlePictures.Count().ToString();
            labelGameplay.Text = missingGameplayPictures.Count().ToString();
        }