Beispiel #1
0
        /// <summary>
        /// get number of unread feed-items (including subgroups)
        /// </summary>
        /// <returns>returns number of unread feeditems</returns>
        public int GetNoOfUnreadFeedItems()
        {
            int result = 0;

            if (FeedGroups != null)
            {
                if (FeedGroups.Count() > 0)
                {
                    foreach (FeedGroup fGroup in FeedGroups)
                    {
                        result += fGroup.GetNoOfUnreadFeedItems();
                    }
                }
            }

            if (FeedList != null)
            {
                if (FeedList.Count() > 0)
                {
                    foreach (Feed feed in FeedList)
                    {
                        result += feed.GetNoOfUnreadItems();
                    }
                }
            }

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// method for adding a new group to the list
        /// </summary>
        /// <param name="name">name of the new feed</param>
        /// <param name="url">url of the group (optional)</param>
        public void AddGroup(string name, bool isNSFW, string url = "")
        {
            if (FeedGroups == null)
            {
                FeedGroups = new List <FeedGroup>();
            }

            FeedGroups.Add(new FeedGroup(name, isNSFW, url));
        }
Beispiel #3
0
        /// <summary>
        /// tells whether sub-Groups exist or not
        /// </summary>
        public bool IsLeaf()
        {
            bool result = true;

            if (FeedGroups != null)
            {
                if (FeedGroups.Count() > 0)
                {
                    result = false;
                }
            }
            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// method for adding a new group and a feed to this group at the same time
        /// </summary>
        /// <param name="newFeed">the feed to be added to the group</param>
        /// <param name="groupName">name of the new group</param>
        /// <param name="groupurl">URL of the new group (optional)</param>
        public void AddFeedAndGroup(Feed newFeed, string groupName, bool isNSFW, string groupUrl = "")
        {
            if (FeedList == null)
            {
                FeedList = new List <Feed>();
            }

            if (FeedGroups == null)
            {
                FeedGroups = new List <FeedGroup>();
            }

            FeedGroup newGroup = new FeedGroup(groupName, isNSFW, groupUrl);

            newGroup.AddFeed(newFeed);

            FeedGroups.Add(newGroup);
        }