protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { // wait for any background action to finish if (GUIBackgroundTask.Instance.IsBusy) return; switch (controlId) { // Facade case (50): if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { if (SelectedType == TraktItemType.movie) { CheckAndPlayMovie(true); } else if (TraktSettings.EnableJumpToForTVShows || SelectedType == TraktItemType.episode) { CheckAndPlayEpisode(true); } else if (SelectedType == TraktItemType.show) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) return; var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) return; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.ShowSeasons, listItem.Show.ToJSON()); } else if (SelectedType == TraktItemType.season) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) return; var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) return; // create loading parameter for episode listing var loadingParam = new SeasonLoadingParameter { Season = listItem.Season, Show = listItem.Show }; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.SeasonEpisodes, loadingParam.ToJSON()); } else if (SelectedType == TraktItemType.person) { var selectedItem = Facade.SelectedListItem; if (selectedItem == null) return; var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) return; // if we already have the person summary, parse it along to the window GUIPersonSummary.CurrentPerson = listItem.Person; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.PersonSummary); } } break; // Layout Button case (2): CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout, PreviousSelectedIndex); break; default: break; } base.OnClicked(controlId, control, actionType); }
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { // wait for any background action to finish if (GUIBackgroundTask.Instance.IsBusy) { return; } switch (controlId) { // Facade case (50): if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) { return; } var selectedSeason = selectedItem.TVTag as TraktSeasonSummary; if (selectedSeason == null) { return; } // don't bother loading seasons view if there is no episodes to display if (selectedSeason.EpisodeCount > 0) { // create loading parameter for episode listing var loadingParam = new SeasonLoadingParameter { Season = selectedSeason, Show = Show }; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.SeasonEpisodes, loadingParam.ToJSON()); } } break; // Layout Button case (2): CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout, PreviousSelectedIndex); break; default: break; } base.OnClicked(controlId, control, actionType); }
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { // wait for any background action to finish if (GUIBackgroundTask.Instance.IsBusy) { return; } switch (controlId) { // Facade case (50): if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { if (SelectedType == TraktItemType.movie) { CheckAndPlayMovie(true); } else if (TraktSettings.EnableJumpToForTVShows || SelectedType == TraktItemType.episode) { CheckAndPlayEpisode(true); } else if (SelectedType == TraktItemType.show) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) { return; } var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) { return; } GUIWindowManager.ActivateWindow((int)TraktGUIWindows.ShowSeasons, listItem.Show.ToJSON()); } else if (SelectedType == TraktItemType.season) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) { return; } var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) { return; } // create loading parameter for episode listing var loadingParam = new SeasonLoadingParameter { Season = listItem.Season, Show = listItem.Show }; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.SeasonEpisodes, loadingParam.ToJSON()); } else if (SelectedType == TraktItemType.person) { var selectedItem = Facade.SelectedListItem; if (selectedItem == null) { return; } var listItem = selectedItem.TVTag as TraktListItem; if (listItem == null) { return; } // if we already have the person summary, parse it along to the window GUIPersonSummary.CurrentPerson = listItem.Person; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.PersonSummary); } } break; // Layout Button case (2): CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout, PreviousSelectedIndex); break; default: break; } base.OnClicked(controlId, control, actionType); }
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { // wait for any background action to finish if (GUIBackgroundTask.Instance.IsBusy) return; switch (controlId) { // Facade case (50): if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { var selectedItem = this.Facade.SelectedListItem; if (selectedItem == null) return; var selectedSeason = selectedItem.TVTag as TraktShowSeason; if (selectedSeason == null) return; // create loading parameter for episode listing var loadingParam = new SeasonLoadingParameter { Season = selectedSeason, Show = Show }; GUIWindowManager.ActivateWindow((int)TraktGUIWindows.SeasonEpisodes, loadingParam.ToJSON()); } break; // Layout Button case (2): CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout); break; default: break; } base.OnClicked(controlId, control, actionType); }