Ejemplo n.º 1
0
        private object UpdateFeeds(object state)
        {
            checkForCancellation();

            InnerTubeFeed feed = ((InnerTubeFeed)state).Clone();
            ObservableCollection <InnerTubeVideo> newVideos = InnerTubeService.ConvertYouTubeXmlToObjects(new Uri(feed.FeedUrl), this.settings);

            //pull just videos we don't have yet
            var newVids = from a in newVideos
                          from b in
                          (from n in newVideos
                           select n.Id).Except(from o in feed.FeedVideos
                                               select o.Id)
                          where a.Id == b
                          select a;

            foreach (var n in newVids)
            {
                feed.FeedVideos.Add(n);
            }

            string status = "updated feed: " + feed.FeedName;

            WriteStatus(status);
            return(feed);
        }
Ejemplo n.º 2
0
        public InnerTubeFeed Clone()
        {
            InnerTubeFeed copy = (InnerTubeFeed)((ICloneable)this).Clone();
            ObservableCollection <InnerTubeVideo> feedVideoCopy = new ObservableCollection <InnerTubeVideo>();

            if (this.FeedVideos != null)
            {
                foreach (var v in this.FeedVideos)
                {
                    feedVideoCopy.Add(v.Clone());
                }

                copy.FeedVideos = feedVideoCopy;
                return(copy);
            }
            else
            {
                copy.FeedVideos = new ObservableCollection <InnerTubeVideo>();
                return(copy);
            }
        }
Ejemplo n.º 3
0
 public static void Delete(System.Collections.ObjectModel.ObservableCollection <InnerTubeFeed> feedList, InnerTubeFeed deleteFeed)
 {
     feedList.Remove(deleteFeed);
 }