Ejemplo n.º 1
0
        public static List <PodcastShow> GetPodcastFeed(string url)
        {
            var count = 0;
            List <PodcastShow> podcastlista = new List <PodcastShow>();

            using (XmlReader reader = XmlReader.Create(url))
            {
                SyndicationFeed feed = SyndicationFeed.Load(reader);
                foreach (SyndicationItem item in feed.Items)
                {
                    PodcastShow nypodd = new PodcastShow();

                    count++;
                    nypodd.Title      += item.Title.Text;                  //funkar
                    nypodd.Url        += item.Links[0].Uri.OriginalString; //funkar
                    nypodd.Description = item.Summary.Text;
                    nypodd.Category    = nypodd.getCategory();             //funkar men tar med <p> taggar
                    podcastlista.Add(nypodd);
                }


                return(podcastlista);
            }
        }
Ejemplo n.º 2
0
        protected override UITableViewCell GetOrCreateCellFor(UITableView tableView, NSIndexPath indexPath, object item)
        {
            // Get the cell
            var cell = item switch
            {
                Track _ => tableView.DequeueReusableCell(TrackListCell.Key, indexPath),
                Playlist _ => tableView.DequeueReusableCell(PlaylistListCell.Key, indexPath),
                User _ => tableView.DequeueReusableCell(UserListCell.Key, indexPath),
                PodcastShow _ => tableView.DequeueReusableCell(PodcastShowListCell.Key, indexPath),
                _ => null
            };

            // No Cell
            if (cell == null)
            {
                return(GetOrCreateCellFor(tableView, indexPath, item));
            }

            // Set the background color and return
            cell.BackgroundColor = ColorHelper.Background0.ToPlatformColor();
            cell.SelectionStyle  = UITableViewCellSelectionStyle.None;
            return(cell);
        }
    }
Ejemplo n.º 3
0
 private void addNyPodcastToList(PodcastShow newPodcast)
 {
     Podcasts.Add(newPodcast);
 }
Ejemplo n.º 4
0
        public void nyPodcast(string category, string url)
        {
            PodcastShow newPodcast = new PodcastShow(url, category);

            addNyPodcastToList(newPodcast);
        }