mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
More cleanup and UI work
This commit is contained in:
@@ -79,7 +79,7 @@ namespace FeedCenter
|
||||
_currentCategory = category;
|
||||
|
||||
// Get the current feed list to match the category
|
||||
_feedList = _currentCategory == null ? _database.Feeds : _database.Feeds.Where(feed => feed.Category.Id == _currentCategory.Id);
|
||||
_feedList = _currentCategory == null ? _database.Feeds : _database.Feeds.Where(feed => feed.CategoryId == _currentCategory.Id);
|
||||
|
||||
// Refresh the feed index
|
||||
_feedIndex = -1;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace FeedCenter
|
||||
// Create and configure the new feed
|
||||
var feed = Feed.Create();
|
||||
feed.Source = feedUrl;
|
||||
feed.Category = _database.DefaultCategory;
|
||||
feed.CategoryId = _database.DefaultCategory.Id;
|
||||
|
||||
// Try to detect the feed type
|
||||
var feedTypeResult = feed.DetectFeedType();
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace FeedCenter
|
||||
LoadWindowSettings();
|
||||
|
||||
// Set the foreground color to something that can be seen
|
||||
LinkTextList.Foreground = (System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5)
|
||||
LinkTextList.Foreground = System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5
|
||||
? Brushes.White
|
||||
: Brushes.Black;
|
||||
HeaderLabel.Foreground = LinkTextList.Foreground;
|
||||
@@ -153,7 +153,7 @@ namespace FeedCenter
|
||||
|
||||
_feedList = _currentCategory == null
|
||||
? _database.Feeds.ToList()
|
||||
: _database.Feeds.Where(feed => feed.Category.Id == _currentCategory.Id).ToList();
|
||||
: _database.Feeds.Where(feed => feed.CategoryId == _currentCategory.Id).ToList();
|
||||
|
||||
UpdateToolbarButtonState();
|
||||
|
||||
@@ -178,9 +178,9 @@ namespace FeedCenter
|
||||
_feedIndex = newIndex;
|
||||
|
||||
// Re-get the current feed
|
||||
_currentFeed = (_feedIndex == -1
|
||||
_currentFeed = _feedIndex == -1
|
||||
? null
|
||||
: _feedList.OrderBy(feed => feed.Name).AsEnumerable().ElementAt(_feedIndex));
|
||||
: _feedList.OrderBy(feed => feed.Name).AsEnumerable().ElementAt(_feedIndex);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -215,7 +215,7 @@ namespace FeedCenter
|
||||
// Get the current feed list to match the category
|
||||
_feedList = _currentCategory == null
|
||||
? _database.Feeds
|
||||
: _database.Feeds.Where(feed => feed.Category.Id == _currentCategory.Id);
|
||||
: _database.Feeds.Where(feed => feed.CategoryId == _currentCategory.Id);
|
||||
|
||||
UpdateToolbarButtonState();
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace FeedCenter
|
||||
var found = false;
|
||||
|
||||
// Remember our starting position
|
||||
var startIndex = (_feedIndex == -1 ? 0 : _feedIndex);
|
||||
var startIndex = _feedIndex == -1 ? 0 : _feedIndex;
|
||||
|
||||
// Increment the index and adjust if we've gone around the end
|
||||
_feedIndex = (_feedIndex + 1) % feedCount;
|
||||
@@ -319,7 +319,7 @@ namespace FeedCenter
|
||||
var found = false;
|
||||
|
||||
// Remember our starting position
|
||||
var startIndex = (_feedIndex == -1 ? 0 : _feedIndex);
|
||||
var startIndex = _feedIndex == -1 ? 0 : _feedIndex;
|
||||
|
||||
// Decrement the feed index
|
||||
_feedIndex--;
|
||||
@@ -392,7 +392,7 @@ namespace FeedCenter
|
||||
}
|
||||
|
||||
// Set the header to the feed title
|
||||
FeedLabel.Text = (_currentFeed.Name.Length > 0 ? _currentFeed.Name : _currentFeed.Title);
|
||||
FeedLabel.Text = _currentFeed.Name.Length > 0 ? _currentFeed.Name : _currentFeed.Title;
|
||||
FeedButton.Visibility = _feedList.Count() > 1 ? Visibility.Visible : Visibility.Hidden;
|
||||
|
||||
// Clear the current list
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace FeedCenter
|
||||
private void HandleDeleteCurrentFeedMenuItemClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Confirm this delete since it is for real
|
||||
if (MessageBox.Show(this, Properties.Resources.ConfirmDelete, string.Empty, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
|
||||
if (MessageBox.Show(this, Properties.Resources.ConfirmDeleteFeed, string.Empty, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
|
||||
return;
|
||||
|
||||
// Get the current feed
|
||||
|
||||
Reference in New Issue
Block a user