示例#1
0
        /// <summary>
        /// Removes feedItems for a given feed from the list of feedItems.
        /// </summary>
        /// <param name="feed">The feed for which the articles should be removed</param>
        private void RemoveFeedItems(Feed feed)
        {
            var counter = 0;

            foreach (var article in feed.Items)
            {
                while (counter < FeedItems.Count && FeedItems[counter].Link != article.Link)
                {
                    counter++;
                }

                if (counter == FeedItems.Count)
                {
                    break;
                }
                else
                {
                    FeedItems.RemoveAt(counter);
                    if (counter > 0)
                    {
                        counter--;
                    }
                }
            }

            // ReSharper Disable All
            OnPropertyChanged("HasFeedItems");
            // ReSharper Restore All
        }