Start adding Miniflux support plus other cleanup

- Modernize old async code
- Update to .NET 10
- Adjust namespace
- Bypass update check when debugging
This commit is contained in:
2025-11-13 10:33:56 -05:00
parent cdd22c6632
commit 6bae35a255
56 changed files with 560 additions and 326 deletions

View File

@@ -1,24 +1,29 @@
using System.Collections.Generic;
using FeedCenter.Feeds;
namespace FeedCenter.Options
namespace FeedCenter.Options;
public class AccountTypeItem
{
public class AccountTypeItem
{
public AccountType AccountType { get; set; }
public string Name { get; set; }
public AccountType AccountType { get; set; }
public string Name { get; set; }
public static List<AccountTypeItem> AccountTypes =>
[
new()
{
Name = Properties.Resources.AccountTypeFever,
AccountType = AccountType.Fever
},
//new()
//{
// Name = Properties.Resources.AccountTypeGoogleReader,
// AccountType = AccountType.GoogleReader
//}
];
}
public static List<AccountTypeItem> AccountTypes =>
[
new()
{
Name = Properties.Resources.AccountTypeFever,
AccountType = AccountType.Fever
},
//new()
//{
// Name = Properties.Resources.AccountTypeGoogleReader,
// AccountType = AccountType.GoogleReader
//}
new()
{
Name = Properties.Resources.AccountTypeMiniflux,
AccountType = AccountType.Miniflux
}
];
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using FeedCenter.Feeds;
namespace FeedCenter.Options;

View File

@@ -4,10 +4,11 @@
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:feedCenter="clr-namespace:FeedCenter"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d:DataContext="{d:DesignInstance Type=feedCenter:Account}"
d:DataContext="{d:DesignInstance Type=feeds:Account}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
mc:Ignorable="d"
Title="AccountWindow"
Height="350"

View File

@@ -1,6 +1,7 @@
using ChrisKaczor.Wpf.Validation;
using FeedCenter.Feeds;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
@@ -33,46 +34,46 @@ public partial class AccountWindow
return ShowDialog();
}
private void HandleOkayButtonClick(object sender, RoutedEventArgs e)
private async void HandleOkayButtonClick(object sender, RoutedEventArgs e)
{
var transaction = _entities.BeginTransaction();
if (!this.IsValid(OptionsTabControl))
try
{
transaction.Rollback();
return;
}
var transaction = _entities.BeginTransaction();
if (_isNew)
{
_entities.Accounts.Add(_account);
}
transaction.Commit();
var accountId = _account.Id;
AccountReadProgressBar.Value = 0;
AccountReadProgressBar.Maximum = _account.GetProgressSteps(_entities) + 1;
AccountReadProgress.Visibility = Visibility.Visible;
ButtonPanel.Visibility = Visibility.Collapsed;
var dispatcher = Dispatcher.CurrentDispatcher;
Task.Run(() =>
{
var entities = new FeedCenterEntities();
var account = entities.Accounts.First(a => a.Id == accountId);
var accountReadInput = new AccountReadInput(entities, null, true, () => dispatcher.Invoke(() => AccountReadProgressBar.Value++));
account.Read(accountReadInput);
dispatcher.Invoke(() =>
if (!this.IsValid(OptionsTabControl))
{
DialogResult = true;
transaction.Rollback();
return;
}
Close();
});
});
if (_isNew)
{
_entities.Accounts.Add(_account);
}
await transaction.CommitAsync();
var accountId = _account.Id;
var accountReadInput = new AccountReadInput(_entities, null, true, () => AccountReadProgressBar.Value++);
AccountReadProgressBar.Value = 0;
AccountReadProgressBar.Maximum = await _account.GetProgressSteps(_account, accountReadInput);
AccountReadProgress.Visibility = Visibility.Visible;
ButtonPanel.Visibility = Visibility.Collapsed;
//var entities = new FeedCenterEntities();
var account = _entities.Accounts.First(a => a.Id == accountId);
await account.Read(accountReadInput);
DialogResult = true;
Close();
}
catch (Exception exception)
{
MainWindow.HandleException(exception);
}
}
}

View File

@@ -7,6 +7,7 @@
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:controls="clr-namespace:ChrisKaczor.Wpf.Controls;assembly=ChrisKaczor.Wpf.Controls.Link"
xmlns:feedCenter="clr-namespace:FeedCenter"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
mc:Ignorable="d"
d:DesignHeight="311"
d:DesignWidth="425">
@@ -46,7 +47,7 @@
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
AllowDrop="True"
Background="{x:Null}"
d:DataContext="{d:DesignInstance feedCenter:Account }">
d:DataContext="{d:DesignInstance feeds:Account }">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}"
Header="{x:Static properties:Resources.AccountNameColumnHeader}"

View File

@@ -4,6 +4,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using FeedCenter.Feeds;
namespace FeedCenter.Options;

View File

@@ -9,6 +9,7 @@
xmlns:controls="clr-namespace:ChrisKaczor.Wpf.Controls;assembly=ChrisKaczor.Wpf.Controls.Link"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
WindowStartupLocation="CenterOwner"
Icon="/FeedCenter;component/Resources/Application.ico"
FocusManager.FocusedElement="{Binding ElementName=FeedLinkFilterText}">
@@ -99,9 +100,9 @@
mah:TextBoxHelper.Watermark="{x:Static my:Resources.openLabel}"
IsEnabled="{Binding ElementName=OpenCheckBox, Path=IsChecked}">
<ComboBoxItem Content="{x:Static my:Resources.openAllMultipleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.IndividualPages}" />
Tag="{x:Static feeds:MultipleOpenAction.IndividualPages}" />
<ComboBoxItem Content="{x:Static my:Resources.openAllSingleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.SinglePage}" />
Tag="{x:Static feeds:MultipleOpenAction.SinglePage}" />
</ComboBox>
</Grid>
<StackPanel Grid.Column="0"

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using FeedCenter.Feeds;
namespace FeedCenter.Options;

View File

@@ -9,7 +9,8 @@
xmlns:controls="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.ControlBox"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:options="clr-namespace:FeedCenter.Options"
d:DataContext="{d:DesignInstance Type=feedCenter:Category}"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
d:DataContext="{d:DesignInstance Type=feeds:Category}"
Title="CategoryWindow"
Width="300"
ResizeMode="NoResize"

View File

@@ -1,5 +1,6 @@
using ChrisKaczor.Wpf.Validation;
using System.Windows;
using FeedCenter.Feeds;
namespace FeedCenter.Options;

View File

@@ -1,6 +1,3 @@
namespace FeedCenter.Options
{
public class CheckedFeedListItem : CheckedListItem<Feed>
{
}
}
namespace FeedCenter.Options;
public class CheckedFeedListItem : CheckedListItem<Feeds.Feed>;

View File

@@ -4,10 +4,11 @@
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:feedCenter="clr-namespace:FeedCenter"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d:DataContext="{d:DesignInstance Type=feedCenter:Feed}"
d:DataContext="{d:DesignInstance Type=feeds:Feed}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
mc:Ignorable="d"
Title="FeedWindow"
Height="350"
@@ -90,9 +91,9 @@
mah:TextBoxHelper.UseFloatingWatermark="True"
mah:TextBoxHelper.Watermark="{x:Static properties:Resources.openLabel}">
<ComboBoxItem Content="{x:Static properties:Resources.openAllSingleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.SinglePage}" />
Tag="{x:Static feeds:MultipleOpenAction.SinglePage}" />
<ComboBoxItem Content="{x:Static properties:Resources.openAllMultipleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.IndividualPages}" />
Tag="{x:Static feeds:MultipleOpenAction.IndividualPages}" />
</ComboBox>
<ComboBox Name="UserAgentComboBox"
mah:TextBoxHelper.UseFloatingWatermark="True"

View File

@@ -14,7 +14,7 @@ public partial class FeedWindow
InitializeComponent();
}
public bool? Display(Feed feed, Window owner)
public bool? Display(Feeds.Feed feed, Window owner)
{
CategoryComboBox.ItemsSource = _entities.Categories;

View File

@@ -7,6 +7,7 @@
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:controls="clr-namespace:ChrisKaczor.Wpf.Controls;assembly=ChrisKaczor.Wpf.Controls.Link"
xmlns:feedCenter="clr-namespace:FeedCenter"
xmlns:feeds="clr-namespace:FeedCenter.Feeds"
mc:Ignorable="d"
d:DesignHeight="311"
d:DesignWidth="425">
@@ -45,7 +46,7 @@
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
AllowDrop="True"
Background="{x:Null}"
d:DataContext="{d:DesignInstance feedCenter:Category }">
d:DataContext="{d:DesignInstance feeds:Category }">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}"
Header="{x:Static properties:Resources.CategoryNameColumnHeader}"
@@ -80,7 +81,7 @@
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
Background="{x:Null}"
SelectionChanged="HandleFeedDataGridSelectionChanged"
d:DataContext="{d:DesignInstance feedCenter:Feed }">
d:DataContext="{d:DesignInstance feeds:Feed }">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}"
Header="{x:Static properties:Resources.FeedNameColumnHeader}"

View File

@@ -7,6 +7,7 @@ using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Xml;
using FeedCenter.Feeds;
namespace FeedCenter.Options;

View File

@@ -12,7 +12,7 @@ public class UserAgentItem
{
new UserAgentItem
{
Caption = Properties.Resources.ApplicationUserAgentCaption,
Caption = Resources.ApplicationUserAgentCaption,
UserAgent = string.Empty
},
new UserAgentItem