private void ButtonUnsubscribe_Click()
{
int progid = 0;
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;
case ViewState.View.Subscriptions:
progid = Convert.ToInt32(this.ListSubscribed.SelectedItems[0].Name, CultureInfo.InvariantCulture);
break;
}
if (Interaction.MsgBox("Are you sure you would like to stop having new episodes of this programme downloaded automatically?", MsgBoxStyle.Question | MsgBoxStyle.YesNo) == MsgBoxResult.Yes)
{
Model.Subscription.Remove(progid);
}
}