Some cleanup

This commit is contained in:
2023-04-07 22:10:03 -04:00
parent 49842a1663
commit 96d327270f
14 changed files with 64 additions and 97 deletions

View File

@@ -26,7 +26,7 @@ namespace FeedCenter
var endPosition = commandLine.IndexOf(" ", startPosition, StringComparison.Ordinal);
// Extract the feed URL
var feedUrl = commandLine.Substring(startPosition, endPosition - startPosition);
var feedUrl = commandLine[startPosition..endPosition];
// Add the HTTP protocol by default
feedUrl = "http://" + feedUrl;

View File

@@ -63,7 +63,7 @@ namespace FeedCenter
}
// Read the feed for the first time
var feedReadResult = feed.Read(_database);
var feedReadResult = feed.Read();
// See if we read the feed okay
if (feedReadResult == FeedReadResult.Success)

View File

@@ -159,7 +159,7 @@ namespace FeedCenter
foreach (var feed in feedsToRead)
{
// Read the feed
database.SaveChanges(() => feed.Read(database, workerInput.ForceRead));
database.SaveChanges(() => feed.Read(workerInput.ForceRead));
// Increment progress
currentProgress += 1;

View File

@@ -131,9 +131,8 @@ namespace FeedCenter
break;
case Dock.Left:
case Dock.Right:
throw new NotSupportedException();
default:
throw new ArgumentOutOfRangeException(nameof(Settings.Default.ToolbarLocation));
throw new NotSupportedException();
}
break;
@@ -153,8 +152,8 @@ namespace FeedCenter
_database.Refresh();
_feedList = _currentCategory == null
? _database.Feeds
: _database.Feeds.Where(feed => feed.Category.Id == _currentCategory.Id);
? _database.Feeds.ToList()
: _database.Feeds.Where(feed => feed.Category.Id == _currentCategory.Id).ToList();
UpdateToolbarButtonState();