private void ButtonSubscribe_Click()
{
int progid;
switch (this.view.CurrentView)
{
case ViewState.View.ProgEpisodes:
progid = (int)this.view.CurrentViewData;
break;
case ViewState.View.Favourites:
progid = Convert.ToInt32(this.ListFavourites.SelectedItems[0].Name, CultureInfo.InvariantCulture);
break;
default:
throw new InvalidOperationException("Subscribe not valid in " + this.view.CurrentView.ToString() + " view");
}
if (Model.Subscription.Add(progid))
{
this.view.SetView(ViewState.MainTab.Subscriptions, ViewState.View.Subscriptions, null);
}
else
{
MessageBox.Show("This programme only has one episode, which is already in the download list.", Application.ProductName, MessageBoxButtons.OK);
}
}