/// <summary> /// Handles the IStorageProvider's OnTvShowRemoved event. /// </summary> /// <param name="sender"> /// The sender of the event. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void OnTvShowRemoved(object sender, TvShowEventArgs e) { if (TvShowRemoved != null) { TvShowRemoved(sender, e); } }
/// <summary> /// Handles a TV show being removed. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The arguments of the event.</param> private void TvShowRemoved(object sender, TvShowEventArgs e) { if (tvShows.Contains(e.TvShow)) { tvShows.Remove(e.TvShow); } }
/// <summary> /// Handles the controller's ShowChanged event. /// </summary> /// <param name="sender"> /// The sender of the event. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void ShowChanged(object sender, TvShowEventArgs e) { if (InvokeRequired) { Invoke(new Action(() => ShowChanged(sender, e))); } else { tvShowsList.Refresh(); } }
/// <summary> /// Handles the controller's ShowChanged event. /// </summary> /// <param name="sender"> /// The sender of the evetn. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void ShowChanged(object sender, TvShowEventArgs e) { if (this.InvokeRequired) { this.Invoke(new Action(() => this.ShowChanged(sender, e))); } else { this.tvShowsList.Refresh(); } }
/// <summary> /// Handles the TVShow's OnTvShowRemoved event. /// </summary> /// <param name="sender"> /// The sender of the event. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void OnTvShowRemoved(object sender, TvShowEventArgs e) { this.Shows.Remove(e.TvShow); }
/// <summary> /// Handles the TVShow's OnTvShowChanged event. /// </summary> /// <param name="sender"> /// The sender of the event. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void OnTvShowChanged(object sender, TvShowEventArgs e) { int index = this.Shows.IndexOf(e.TvShow); if (index != -1) { this.Shows[index] = e.TvShow; if (e.TvShow.Equals(this.SelectedShow)) { this.SelectedShow = e.TvShow; } } else { this.Shows.Add(e.TvShow); } if (this.ShowChanged != null) { this.ShowChanged(sender, e); } }
/// <summary> /// Handles the TVShow's OnTvShowAdded event. /// </summary> /// <param name="sender"> /// The sender of the event. /// </param> /// <param name="e"> /// The arguments of the event. /// </param> private void OnTvShowAdded(object sender, TvShowEventArgs e) { this.Shows.Add(e.TvShow); }
/// <summary> /// Handles a TV show being added. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The arguments of the event.</param> private void TvShowAdded(object sender, TvShowEventArgs e) { tvShows.Add(e.TvShow); }