void btnUseThisExisting_Click(object sender, RoutedEventArgs e) { try { // prompt to select season Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, EpisodeType.Episode, 1, txtSeriesID.Text.Trim(), 1, 1, AnimeName, Anime, null); bool?result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = txtSeriesID.Text.Trim(); this.DialogResult = true; this.Cursor = Cursors.Arrow; this.Close(); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
private void CommandBinding_UseThis(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) { return; } try { if (obj.GetType() == typeof(TraktTVShowResponseVM)) { this.Cursor = Cursors.Wait; TraktTVShowResponseVM searchResult = obj as TraktTVShowResponseVM; // prompt to select season Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, searchResult.TraktID, 1, searchResult.title); bool?result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = searchResult.TraktID; this.DialogResult = true; this.Cursor = Cursors.Arrow; this.Close(); } //LinkAniDBToTrakt(searchResult.TraktID, 1); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
void btnSwitchTraktSeason_Click(object sender, RoutedEventArgs e) { try { AniDB_AnimeVM anime = this.DataContext as AniDB_AnimeVM; if (anime == null) return; Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(anime.AnimeID, anime.FormattedTitle, AniDB_AnimeCrossRefs.CrossRef_AniDB_Trakt.TraktID, AniDB_AnimeCrossRefs.CrossRef_AniDB_Trakt.TraktSeasonNumber, AniDB_AnimeCrossRefs.TraktShow.Title); bool? result = frm.ShowDialog(); if (result.Value) { // update info RefreshData(); } this.Cursor = Cursors.Arrow; } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
private void CommandBinding_EditTraktLink(object sender, ExecutedRoutedEventArgs e) { object obj = e.Parameter; if (obj == null) return; try { if (obj.GetType() == typeof(CrossRef_AniDB_TraktVMV2)) { CrossRef_AniDB_TraktVMV2 link = obj as CrossRef_AniDB_TraktVMV2; AniDB_AnimeVM anime = this.DataContext as AniDB_AnimeVM; if (anime == null) return; Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(anime.AnimeID, anime.FormattedTitle, (EpisodeType)link.AniDBStartEpisodeType, link.AniDBStartEpisodeNumber, link.TraktID, link.TraktSeasonNumber, link.TraktStartEpisodeNumber, link.TraktTitle, anime, link.CrossRef_AniDB_TraktV2ID); bool? result = frm.ShowDialog(); if (result.Value) { // update info RefreshData(); } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
private void CommandBinding_UseThis(object sender, ExecutedRoutedEventArgs e) { Window parentWindow = Window.GetWindow(this); object obj = e.Parameter; if (obj == null) return; try { if (obj.GetType() == typeof(TraktTVShowResponseVM)) { this.Cursor = Cursors.Wait; TraktTVShowResponseVM searchResult = obj as TraktTVShowResponseVM; // prompt to select season Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, EpisodeType.Episode, 1, searchResult.TraktID, 1, 1, AnimeName, Anime, null); bool? result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = searchResult.TraktID; this.DialogResult = true; this.Cursor = Cursors.Arrow; this.Close(); } } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }
void btnUseThisExisting_Click(object sender, RoutedEventArgs e) { try { // prompt to select season Window wdw = Window.GetWindow(this); this.Cursor = Cursors.Wait; SelectTraktSeasonForm frm = new SelectTraktSeasonForm(); frm.Owner = wdw; frm.Init(AnimeID, AnimeName, EpisodeType.Episode, 1, txtSeriesID.Text.Trim(), 1, 1, AnimeName, Anime, null); bool? result = frm.ShowDialog(); if (result.Value) { SelectedTraktID = txtSeriesID.Text.Trim(); this.DialogResult = true; this.Cursor = Cursors.Arrow; this.Close(); } } catch (Exception ex) { Utils.ShowErrorMessage(ex); } finally { this.Cursor = Cursors.Arrow; } }