/// <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); }
/// <summary> /// method for adding a feed to an existing group /// </summary> /// <param name="newFeed">the feed to be added to the group</param> /// <param name="groupName">name of the(sub-)group</param> /// <returns>returns false if group couldn't be found</returns> public bool AddFeed(Feed newFeed, string groupName) { bool result = false; FeedGroup searchGroup = null; //try to find the group we're looking for searchGroup = FindGroup(groupName); //if search was successfull -> add the new feed if (searchGroup != null) { searchGroup.AddFeed(newFeed); result = true; } return(result); }