private void Button2_Click(object sender, System.EventArgs e) { List <ProcessedEpisode> possibleEpisodes = new List <ProcessedEpisode>(); foreach (ProcessedEpisode testEp in mOriginalEps) { if (TVSettings.Instance.PreviouslySeenEpisodes.Contains(testEp.EpisodeId)) { continue; } if (episodesToAddToSeen.Contains(testEp)) { continue; } possibleEpisodes.Add(testEp); } possibleEpisodes.AddRange(episodesToRemoveFromSeen); NewSeenEpisode nse = new NewSeenEpisode(possibleEpisodes); DialogResult dialogResult = nse.ShowDialog(); if (dialogResult == DialogResult.OK) { episodesToAddToSeen.Add(nse.ChosenEpisode); ListViewItem lvi = new ListViewItem { Text = nse.ChosenEpisode.AppropriateEpNum.ToString() }; lvi.SubItems.Add(nse.ChosenEpisode.Name); lvi.Tag = nse.ChosenEpisode; lvSeenEpisodes.Items.Add(lvi); } }
private void Button2_Click(object sender, System.EventArgs e) { List <ProcessedEpisode> possibleEpisodes = new List <ProcessedEpisode>(); if (mOriginalEps != null) { possibleEpisodes.AddRange(mOriginalEps.Where(testEp => !testEp.PreviouslySeen).Where(testEp => !episodesToAddToSeen.Contains(testEp))); } possibleEpisodes.AddRange(episodesToRemoveFromSeen); NewSeenEpisode nse = new NewSeenEpisode(possibleEpisodes); DialogResult dialogResult = nse.ShowDialog(this); if (dialogResult != DialogResult.OK) { return; } if (nse.ChosenEpisode is null) { return; } episodesToAddToSeen.Add(nse.ChosenEpisode); ListViewItem lvi = new ListViewItem { Text = nse.ChosenEpisode.AppropriateEpNum.ToString() }; lvi.SubItems.Add(nse.ChosenEpisode.Name); lvi.Tag = nse.ChosenEpisode; lvSeenEpisodes.Items.Add(lvi); }