Start modernization

This commit is contained in:
2023-03-10 12:18:03 -05:00
parent a0214b98f1
commit f480a6c373
57 changed files with 661 additions and 2921 deletions

View File

@@ -40,7 +40,7 @@ namespace FeedCenter.FeedParsers
protected void HandleFeedItem(XmlNode node, ref int sequence)
{
// Build a feed item from the node
FeedItem newFeedItem = ParseFeedItem(node);
var newFeedItem = ParseFeedItem(node);
if (newFeedItem == null)
return;
@@ -50,7 +50,7 @@ namespace FeedCenter.FeedParsers
return;
// Look for an item that has the same guid
FeedItem existingFeedItem = Feed.Items.FirstOrDefault(item => item.Guid == newFeedItem.Guid && item.ID != newFeedItem.ID);
var existingFeedItem = Feed.Items.FirstOrDefault(item => item.Guid == newFeedItem.Guid && item.Id != newFeedItem.Id);
// Check to see if we already have this feed item
if (existingFeedItem == null)
@@ -102,7 +102,7 @@ namespace FeedCenter.FeedParsers
public static FeedParserBase CreateFeedParser(Feed feed, string feedText)
{
FeedType feedType = DetectFeedType(feedText);
var feedType = DetectFeedType(feedText);
switch (feedType)
{

View File

@@ -19,7 +19,7 @@ namespace FeedCenter.FeedParsers
document.LoadXml(feedText);
// Create the namespace manager
XmlNamespaceManager namespaceManager = document.GetAllNamespaces();
var namespaceManager = document.GetAllNamespaces();
// Get the root node
XmlNode rootNode = document.DocumentElement;
@@ -29,7 +29,7 @@ namespace FeedCenter.FeedParsers
return FeedReadResult.UnknownError;
// Get the channel node
XmlNode channelNode = rootNode.SelectSingleNode("default:channel", namespaceManager);
var channelNode = rootNode.SelectSingleNode("default:channel", namespaceManager);
if (channelNode == null)
return FeedReadResult.InvalidXml;
@@ -55,7 +55,7 @@ namespace FeedCenter.FeedParsers
}
// Initialize the sequence number for items
int sequence = 0;
var sequence = 0;
// Loop over all nodes in the channel node
foreach (XmlNode node in rootNode.ChildNodes)
@@ -82,7 +82,7 @@ namespace FeedCenter.FeedParsers
protected override FeedItem ParseFeedItem(XmlNode node)
{
// Create a new feed item
FeedItem feedItem = FeedItem.Create();
var feedItem = FeedItem.Create();
// Loop over all nodes in the feed node
foreach (XmlNode childNode in node.ChildNodes)

View File

@@ -20,7 +20,7 @@ namespace FeedCenter.FeedParsers
document.LoadXml(feedText);
// Create the namespace manager
XmlNamespaceManager namespaceManager = document.GetAllNamespaces();
var namespaceManager = document.GetAllNamespaces();
// Get the root node
XmlNode rootNode = document.DocumentElement;
@@ -37,7 +37,7 @@ namespace FeedCenter.FeedParsers
return FeedReadResult.InvalidXml;
// Initialize the sequence number for items
int sequence = 0;
var sequence = 0;
// Loop over all nodes in the channel node
foreach (XmlNode node in channelNode.ChildNodes)
@@ -76,7 +76,7 @@ namespace FeedCenter.FeedParsers
protected override FeedItem ParseFeedItem(XmlNode node)
{
// Create a new feed item
FeedItem feedItem = FeedItem.Create();
var feedItem = FeedItem.Create();
// Loop over all nodes in the feed node
foreach (XmlNode childNode in node.ChildNodes)
@@ -95,7 +95,7 @@ namespace FeedCenter.FeedParsers
case "guid":
feedItem.Guid = childNode.InnerText.Trim();
bool permaLink = true;
var permaLink = true;
if (childNode.Attributes != null)
{