示例#1
0
        private void RemoveFeed(int obj)
        {
            var seledted = Podcasts[obj];

            _db.Podcasts.Delete(seledted.Name);
            Podcasts.UpdateWith(_db.Podcasts.GetAll());
        }
示例#2
0
        private async void AddFeed()
        {
            var  dialog = new Views.AddURLDialog();
            bool result = await _app.ShowDialog("Add URL...", dialog, DialogButtons.OkCancel);

            if (result)
            {
                try
                {
                    var feed = await DownloadFeed(dialog.Url);

                    _db.Podcasts.Save(new PodcastUri
                    {
                        Name = feed.Title.Text,
                        Uri  = dialog.Url
                    });
                    Podcasts.UpdateWith(_db.Podcasts.GetAll());
                    Feed.UpdateWith(ParseFeed(feed));
                }
                catch (Exception ex)
                {
                    await _app.ShowMessageBox("Error", "Can't download or parse given url", DialogButtons.Ok);

                    _app.Log.Exception(ex);
                }
            }
        }