public void RemoveFeed(NamedUrl feed) { lock ( _feedLock ) { if (ReservedFeeds.Any(x => x.Name.Equals(feed.Name, StringComparison.InvariantCultureIgnoreCase))) { return; } NamedUrl[] remList = UserFeeds.Where(x => !x.Name.Equals(feed.Name)).ToArray(); WriteFeedListToDisk(remList); cachedFeedsExpireDate = DateTime.MinValue; // Expire cache } }
public void AddFeed(NamedUrl feed) { lock ( _feedLock ) { if (ReservedFeeds.Any(x => x.Name.Equals(feed.Name, StringComparison.InvariantCultureIgnoreCase))) { return; } List <NamedUrl> newList = UserFeeds.Where(x => !x.Name.Equals(feed.Name)) .ToList(); newList.Add(feed); WriteFeedListToDisk(newList); cachedFeedsExpireDate = DateTime.MinValue; // Expire cache } }