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);
}