private void Subscription_Added(int progid) { if (this.IsDisposed) { return; } if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate { this.Subscription_Added(progid); }); return; } Model.Subscription info = new Model.Subscription(progid); this.ListSubscribed.Items.Add(this.SubscriptionListItem(info, null)); if (this.view.CurrentView == ViewState.View.Subscriptions) { if (this.ListSubscribed.SelectedItems.Count == 0) { // Update the displayed statistics this.SetViewDefaults(); } } }
private void Subscription_Updated(int progid) { if (this.IsDisposed) { return; } if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate { this.Subscription_Updated(progid); }); return; } Model.Subscription info = new Model.Subscription(progid); ListViewItem item = this.ListSubscribed.Items[progid.ToString(CultureInfo.InvariantCulture)]; item = this.SubscriptionListItem(info, item); if (this.view.CurrentView == ViewState.View.Subscriptions) { if (item.Selected) { this.ShowSubscriptionInfo(progid); } else if (this.ListSubscribed.SelectedItems.Count == 0) { // Update the displayed statistics this.SetViewDefaults(); } } }
private void ShowSubscriptionInfo(int progid) { Model.Subscription info = new Model.Subscription(progid); List<ToolBarButton> buttons = new List<ToolBarButton>(); buttons.Add(this.ButtonUnsubscribe); buttons.Add(this.ButtonCurrentEps); if (Model.Favourite.IsFavourite(progid)) { buttons.Add(this.ButtonRemFavourite); } else { buttons.Add(this.ButtonAddFavourite); } this.SetToolbarButtons(buttons.ToArray()); this.SetSideBar(info.Name, info.Description, Model.Subscription.GetImage(progid)); }