More ReSharper suggestions

This commit is contained in:
2015-11-02 21:21:57 -05:00
parent d8d7a9b5ba
commit 87c218de3c
32 changed files with 475 additions and 584 deletions

View File

@@ -88,10 +88,6 @@ namespace FeedCenter
// Set whether we should auto-start
Current.SetStartWithWindows(Settings.Default.StartWithWindows);
// Set whether we should be the default feed reader
if (Settings.Default.RegisterAsDefaultFeedReader)
SystemConfiguration.SetDefaultFeedReader();
// Initialize the window
mainWindow.Initialize();

View File

@@ -7,7 +7,7 @@
WindowStartupLocation="CenterOwner"
Icon="/FeedCenter;component/Resources/Application.ico"
xmlns:my="clr-namespace:FeedCenter.Properties"
xmlns:LinkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
WindowStyle="ToolWindow">
<Grid>
<Grid.RowDefinitions>
@@ -16,7 +16,7 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DataGrid AutoGenerateColumns="False"
Name="feedDataGrid"
Name="FeedDataGrid"
CanUserReorderColumns="False"
GridLinesVisibility="None"
SelectionMode="Single"
@@ -53,36 +53,36 @@
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<StackPanel Orientation="Horizontal"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<LinkControl:LinkControl Name="editFeedButton"
<linkControl:LinkControl Name="EditFeedButton"
Margin="2"
Click="HandleEditFeedButtonClick"
Text="{x:Static my:Resources.EditLink}"
ToolTip="{x:Static my:Resources.EditFeedButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="deleteFeedButton"
</linkControl:LinkControl>
<linkControl:LinkControl Name="DeleteFeedButton"
Margin="2"
Click="HandleDeleteFeedButtonClick"
Text="{x:Static my:Resources.DeleteLink}"
ToolTip="{x:Static my:Resources.DeleteFeedButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="refreshCurrent"
</linkControl:LinkControl>
<linkControl:LinkControl Name="RefreshCurrent"
Margin="2"
Click="HandleRefreshCurrentButtonClick"
Text="{x:Static my:Resources.RefreshCurrent}"
ToolTip="{x:Static my:Resources.RefreshCurrent}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="openPage"
</linkControl:LinkControl>
<linkControl:LinkControl Name="OpenPage"
Margin="6,2,2,2"
Click="HandleOpenPageButtonClick"
Text="{x:Static my:Resources.OpenPage}"
ToolTip="{x:Static my:Resources.OpenPage}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="openFeed"
</linkControl:LinkControl>
<linkControl:LinkControl Name="OpenFeed"
Margin="2"
Click="HandleOpenFeedButtonClick"
Text="{x:Static my:Resources.OpenFeed}"
ToolTip="{x:Static my:Resources.OpenFeed}">
</LinkControl:LinkControl>
</linkControl:LinkControl>
</StackPanel>
</Border>
<Grid DockPanel.Dock="Right"
@@ -96,14 +96,12 @@
<Button Content="{x:Static my:Resources.OkayButton}"
Height="23"
IsDefault="True"
Name="okButton"
Width="75"
Grid.Column="1"
Click="HandleOkayButtonClick" />
<Button Content="{x:Static my:Resources.CancelButton}"
Height="23"
IsCancel="True"
Name="cancelButton"
Width="75"
Margin="6,0,0,0"
Grid.Column="2" />

View File

@@ -26,8 +26,8 @@ namespace FeedCenter
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
// Bind to the list
feedDataGrid.ItemsSource = _collectionViewSource.View;
feedDataGrid.SelectedIndex = 0;
FeedDataGrid.ItemsSource = _collectionViewSource.View;
FeedDataGrid.SelectedIndex = 0;
// Set the window owner
Owner = owner;
@@ -55,10 +55,10 @@ namespace FeedCenter
private void EditSelectedFeed()
{
if (feedDataGrid.SelectedItem == null)
if (FeedDataGrid.SelectedItem == null)
return;
var feed = (Feed) feedDataGrid.SelectedItem;
var feed = (Feed) FeedDataGrid.SelectedItem;
var feedWindow = new FeedWindow();
@@ -67,7 +67,7 @@ namespace FeedCenter
private void DeleteSelectedFeed()
{
var feed = (Feed) feedDataGrid.SelectedItem;
var feed = (Feed) FeedDataGrid.SelectedItem;
_database.Feeds.Remove(feed);
@@ -76,22 +76,22 @@ namespace FeedCenter
private void SetFeedButtonStates()
{
editFeedButton.IsEnabled = (feedDataGrid.SelectedItem != null);
deleteFeedButton.IsEnabled = (feedDataGrid.SelectedItem != null);
refreshCurrent.IsEnabled = (feedDataGrid.SelectedItem != null);
openPage.IsEnabled = (feedDataGrid.SelectedItem != null);
openFeed.IsEnabled = (feedDataGrid.SelectedItem != null);
EditFeedButton.IsEnabled = (FeedDataGrid.SelectedItem != null);
DeleteFeedButton.IsEnabled = (FeedDataGrid.SelectedItem != null);
RefreshCurrent.IsEnabled = (FeedDataGrid.SelectedItem != null);
OpenPage.IsEnabled = (FeedDataGrid.SelectedItem != null);
OpenFeed.IsEnabled = (FeedDataGrid.SelectedItem != null);
}
private void HandleOpenPageButtonClick(object sender, RoutedEventArgs e)
{
var feed = (Feed) feedDataGrid.SelectedItem;
var feed = (Feed) FeedDataGrid.SelectedItem;
BrowserCommon.OpenLink(feed.Link);
}
private void HandleOpenFeedButtonClick(object sender, RoutedEventArgs e)
{
var feed = (Feed) feedDataGrid.SelectedItem;
var feed = (Feed) FeedDataGrid.SelectedItem;
BrowserCommon.OpenLink(feed.Source);
}
@@ -109,7 +109,7 @@ namespace FeedCenter
{
Mouse.OverrideCursor = Cursors.Wait;
var feed = (Feed) feedDataGrid.SelectedItem;
var feed = (Feed) FeedDataGrid.SelectedItem;
feed.Read(_database, true);
_collectionViewSource.View.Refresh();

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace FeedCenter
@@ -51,19 +50,19 @@ namespace FeedCenter
return title;
}
public void ProcessActions(IEnumerable<FeedAction> feedActions)
{
foreach (FeedAction feedAction in feedActions)
{
switch (feedAction.Field)
{
case 1:
//public void ProcessActions(IEnumerable<FeedAction> feedActions)
//{
// foreach (FeedAction feedAction in feedActions)
// {
// switch (feedAction.Field)
// {
// case 1:
Title = Regex.Replace(Title, feedAction.Search, feedAction.Replace);
break;
}
}
}
// Title = Regex.Replace(Title, feedAction.Search, feedAction.Replace);
// break;
// }
// }
//}
#endregion
}

View File

@@ -1,14 +1,14 @@
<Windows:SnappingWindow x:Class="FeedCenter.MainWindow"
<windows:SnappingWindow x:Class="FeedCenter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:Windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
xmlns:Toolbar="clr-namespace:Common.Wpf.Toolbar;assembly=Common.Wpf"
xmlns:SplitButton="clr-namespace:Common.Wpf.Toolbar.SplitButton;assembly=Common.Wpf"
xmlns:Markup="clr-namespace:Common.Wpf.MarkupExtensions;assembly=Common.Wpf.MarkupExtensions"
xmlns:LinkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:HtmlTextBlock="clr-namespace:Common.Wpf.HtmlTextBlock;assembly=Common.Wpf"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
xmlns:toolbar="clr-namespace:Common.Wpf.Toolbar;assembly=Common.Wpf"
xmlns:splitButton="clr-namespace:Common.Wpf.Toolbar.SplitButton;assembly=Common.Wpf"
xmlns:markup="clr-namespace:Common.Wpf.MarkupExtensions;assembly=Common.Wpf.MarkupExtensions"
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:htmlTextBlock="clr-namespace:Common.Wpf.HtmlTextBlock;assembly=Common.Wpf"
xmlns:system="clr-namespace:System;assembly=mscorlib"
Title="MainWindow"
Height="360"
Width="252"
@@ -21,7 +21,7 @@
ShowInTaskbar="False">
<Window.Resources>
<Style TargetType="{x:Type ToolBar}">
<Setter Property="Control.Template">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToolBar}">
<ToolBarPanel IsItemsHost="True"
@@ -34,45 +34,45 @@
</Window.Resources>
<Border BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
BorderThickness="1"
Name="windowBorder"
Name="WindowBorder"
Padding="0"
Background="{x:Static SystemColors.DesktopBrush}">
<Grid Name="mainGrid">
<Grid Name="MainGrid">
<Grid.RowDefinitions>
<!-- ReSharper disable UnusedMember.Global -->
<RowDefinition Height="Auto"
Name="headerRow" />
Name="HeaderRow" />
<RowDefinition Height="Auto"
Name="newVersionRow" />
Name="NewVersionRow" />
<RowDefinition Height="Auto"
Name="feedRow" />
Name="FeedRow" />
<RowDefinition Height="Auto"
Name="topToolbarRow" />
Name="TopToolbarRow" />
<RowDefinition Height="*"
Name="feedListRow" />
Name="FeedListRow" />
<RowDefinition Height="Auto"
Name="progressRow" />
Name="ProgressRow" />
<RowDefinition Height="Auto"
Name="bottomToolbarRow" />
Name="BottomToolbarRow" />
<RowDefinition Height="Auto"
Name="feedErrorsRow" />
Name="FeedErrorsRow" />
<!-- ReSharper restore UnusedMember.Global -->
</Grid.RowDefinitions>
<Grid Height="21"
Name="headerGrid"
Grid.Row="{Markup:GridRow RowName=headerRow}">
Grid.Row="{markup:GridRow RowName=HeaderRow}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="21" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static Properties:Resources.ApplicationDisplayName}"
Name="headerLabel"
<Label Content="{x:Static properties:Resources.ApplicationDisplayName}"
Name="HeaderLabel"
Padding="3,0"
FontWeight="Bold"
Foreground="White"
MouseLeftButtonDown="HandleHeaderLabelMouseLeftButtonDown"
VerticalContentAlignment="Center"
Grid.Column="0" />
<Button Name="closeButton"
Width="13"
<Button Width="13"
Height="13"
Click="HandleCloseButtonClick"
FontFamily="Marlett"
@@ -80,25 +80,24 @@
FontSize="8"
Grid.Column="1"></Button>
</Grid>
<LinkControl:LinkControl Name="newVersionLink"
<linkControl:LinkControl Name="NewVersionLink"
Height="21"
Grid.Row="{Markup:GridRow newVersionRow}"
Text="{x:Static Properties:Resources.NewVersionLink}"
Grid.Row="{markup:GridRow NewVersionRow}"
Text="{x:Static properties:Resources.NewVersionLink}"
Background="AntiqueWhite"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Visibility="Collapsed"
Click="HandleNewVersionLinkClick">
</LinkControl:LinkControl>
</linkControl:LinkControl>
<Grid Height="21"
Name="feedGrid"
Grid.Row="{Markup:GridRow RowName=feedRow}">
Grid.Row="{markup:GridRow RowName=FeedRow}">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="21" />
</Grid.ColumnDefinitions>
<TextBlock Text="*Feed Name"
Name="feedLabel"
Name="FeedLabel"
Padding="3,0"
FontWeight="Bold"
Foreground="White"
@@ -109,7 +108,7 @@
TextTrimming="CharacterEllipsis"
MouseDown="HandleFeedLabelMouseDown"
Grid.Column="0" />
<Button Name="feedButton"
<Button Name="FeedButton"
Width="13"
Height="13"
Click="HandleFeedButtonClick"
@@ -118,24 +117,24 @@
FontSize="8"
Grid.Column="1" />
</Grid>
<ListBox Name="linkTextList"
<ListBox Name="LinkTextList"
BorderThickness="0"
Background="{x:Static SystemColors.DesktopBrush}"
MouseUp="HandleLinkTextListMouseUp"
Foreground="White"
Grid.Row="{Markup:GridRow RowName=feedListRow}"
Grid.Row="{markup:GridRow RowName=FeedListRow}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBoxItem Content="Test item" />
<ListBox.ItemTemplate>
<DataTemplate>
<HtmlTextBlock:HtmlTextBlock Html="{Binding}"
<htmlTextBlock:HtmlTextBlock Html="{Binding}"
TextWrapping="Wrap"
Margin="0,1" />
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Control.Template">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
@@ -154,7 +153,7 @@
<ControlTemplate.Triggers>
<Trigger Property="Selector.IsMouseOver">
<Trigger.Value>
<System:Boolean>True</System:Boolean>
<system:Boolean>True</system:Boolean>
</Trigger.Value>
<Setter Property="Panel.Background"
TargetName="Bd">
@@ -177,110 +176,108 @@
</Setter.Value>
</Setter>
<EventSetter Event="MouseDoubleClick"
Handler="HandleLinkTextListListItemMouseDoubleClick" />
Handler="HandleItemMouseDoubleClick" />
<EventSetter Event="MouseUp"
Handler="HandleLinkTextListListItemMouseUp" />
Handler="HandleItemMouseUp" />
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
<ProgressBar Name="feedReadProgress"
<ProgressBar Name="FeedReadProgress"
Height="15"
Visibility="Collapsed"
Grid.Row="{Markup:GridRow RowName=progressRow}" />
<ToolBarTray Name="navigationToolbarTray"
Grid.Row="{markup:GridRow RowName=ProgressRow}" />
<ToolBarTray Name="NavigationToolbarTray"
Background="Transparent"
Orientation="Horizontal"
Grid.Row="{Markup:GridRow RowName=bottomToolbarRow}">
<ToolBar Name="navigationToolbar"
ToolBarTray.IsLocked="True"
Grid.Row="{markup:GridRow RowName=BottomToolbarRow}">
<ToolBar ToolBarTray.IsLocked="True"
Background="Transparent"
ToolBar.OverflowMode="Never">
<Toolbar:ImageButton Height="20"
<toolbar:ImageButton Height="20"
Width="20"
Name="previousToolbarButton"
Name="PreviousToolbarButton"
Click="HandlePreviousToolbarButtonClick"
ToolTip="{x:Static Properties:Resources.previousToolbarButton}"
ToolTip="{x:Static properties:Resources.previousToolbarButton}"
ImageSource="Resources/Left.ico" />
<Toolbar:ImageButton Height="20"
<toolbar:ImageButton Height="20"
Width="20"
Name="nextToolbarButton"
Name="NextToolbarButton"
Click="HandleNextToolbarButtonClick"
ToolTip="{x:Static Properties:Resources.nextToolbarButton}"
ToolTip="{x:Static properties:Resources.nextToolbarButton}"
ImageSource="Resources/Right.ico" />
<SplitButton:SplitButton Name="refreshToolbarButton"
<splitButton:SplitButton Name="RefreshToolbarButton"
Image="Resources/Rss-Download.ico"
ToolTip="{x:Static Properties:Resources.refreshAllToolbarButton}"
ToolTip="{x:Static properties:Resources.refreshAllToolbarButton}"
Height="20"
MinWidth="35"
Margin="5,0,0,0"
Click="HandleRefreshToolbarButtonClick">
<SplitButton:SplitButton.DropDownContextMenu>
<splitButton:SplitButton.DropDownContextMenu>
<ContextMenu MenuItem.Click="HandleRefreshMenuItemClick">
<MenuItem Name="menuRefreshAll"
Header="{x:Static Properties:Resources.refreshAllToolbarButton}" />
<MenuItem Name="menuRefresh"
Header="{x:Static Properties:Resources.refreshToolbarButton}" />
<MenuItem Name="MenuRefreshAll"
Header="{x:Static properties:Resources.refreshAllToolbarButton}" />
<MenuItem Name="MenuRefresh"
Header="{x:Static properties:Resources.refreshToolbarButton}" />
</ContextMenu>
</SplitButton:SplitButton.DropDownContextMenu>
</SplitButton:SplitButton>
<SplitButton:SplitButton Name="openAllToolbarButton"
</splitButton:SplitButton.DropDownContextMenu>
</splitButton:SplitButton>
<splitButton:SplitButton Name="OpenAllToolbarButton"
Image="Resources/News.ico"
ToolTip="{x:Static Properties:Resources.openAllMultipleToolbarButton}"
ToolTip="{x:Static properties:Resources.openAllMultipleToolbarButton}"
Height="20"
MinWidth="35"
Margin="5,0,0,0"
Click="HandleOpenAllToolbarButtonClick">
<SplitButton:SplitButton.DropDownContextMenu>
<splitButton:SplitButton.DropDownContextMenu>
<ContextMenu MenuItem.Click="HandleOpenAllMenuItemClick">
<MenuItem Name="menuOpenAllMultiplePages"
Header="{x:Static Properties:Resources.openAllMultipleToolbarButton}" />
<MenuItem Name="menuOpenAllSinglePage"
Header="{x:Static Properties:Resources.openAllSingleToolbarButton}" />
<MenuItem Name="MenuOpenAllMultiplePages"
Header="{x:Static properties:Resources.openAllMultipleToolbarButton}" />
<MenuItem Name="MenuOpenAllSinglePage"
Header="{x:Static properties:Resources.openAllSingleToolbarButton}" />
</ContextMenu>
</SplitButton:SplitButton.DropDownContextMenu>
</SplitButton:SplitButton>
<Toolbar:ImageButton Height="20"
</splitButton:SplitButton.DropDownContextMenu>
</splitButton:SplitButton>
<toolbar:ImageButton Height="20"
Width="20"
Margin="5,0,0,0"
Name="markReadToolbarButton"
Name="MarkReadToolbarButton"
Click="HandleMarkReadToolbarButtonClick"
ToolTip="{x:Static Properties:Resources.markReadToolbarButton}"
ToolTip="{x:Static properties:Resources.markReadToolbarButton}"
ImageSource="Resources/Comments-edit.ico" />
<SplitButton:SplitButton Height="20"
<splitButton:SplitButton Height="20"
MinWidth="35"
Margin="5,0,0,0"
Name="optionsToolbarButton"
Click="HandleOptionsToolbarButtonClick"
ToolTip="{x:Static Properties:Resources.optionsToolbarButton}"
ToolTip="{x:Static properties:Resources.optionsToolbarButton}"
Image="Resources/Compile.ico">
<SplitButton:SplitButton.DropDownContextMenu>
<splitButton:SplitButton.DropDownContextMenu>
<ContextMenu>
<MenuItem Header="{x:Static Properties:Resources.lockWindowCheckBox}"
<MenuItem Header="{x:Static properties:Resources.lockWindowCheckBox}"
IsCheckable="True"
IsChecked="{Binding Source={x:Static Properties:Settings.Default}, Path=WindowLocked}" />
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=WindowLocked}" />
<Separator />
<MenuItem Header="{x:Static Properties:Resources.CurrentFeed}">
<MenuItem Header="{x:Static Properties:Resources.EditMenu}"
<MenuItem Header="{x:Static properties:Resources.CurrentFeed}">
<MenuItem Header="{x:Static properties:Resources.EditMenu}"
Click="HandleEditCurrentFeedMenuItemClick" />
<MenuItem Header="{x:Static Properties:Resources.DeleteMenu}"
<MenuItem Header="{x:Static properties:Resources.DeleteMenu}"
Click="HandleDeleteCurrentFeedMenuItemClick" />
</MenuItem>
</ContextMenu>
</SplitButton:SplitButton.DropDownContextMenu>
</SplitButton:SplitButton>
</splitButton:SplitButton.DropDownContextMenu>
</splitButton:SplitButton>
</ToolBar>
</ToolBarTray>
<LinkControl:LinkControl Name="feedErrorsLink"
<linkControl:LinkControl Name="FeedErrorsLink"
Height="21"
Grid.Row="{Markup:GridRow feedErrorsRow}"
Text="{x:Static Properties:Resources.FeedErrorsLink}"
ToolTip="{x:Static Properties:Resources.showErrorsToolbarButton}"
Grid.Row="{markup:GridRow FeedErrorsRow}"
Text="{x:Static properties:Resources.FeedErrorsLink}"
ToolTip="{x:Static properties:Resources.showErrorsToolbarButton}"
Background="AntiqueWhite"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Visibility="Collapsed"
Click="HandleShowErrorsButtonClick">
</LinkControl:LinkControl>
</linkControl:LinkControl>
</Grid>
</Border>
</Windows:SnappingWindow>
</windows:SnappingWindow>

View File

@@ -81,8 +81,8 @@ namespace FeedCenter
LoadWindowSettings();
// Set the foreground color to something that can be seen
linkTextList.Foreground = (System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5) ? Brushes.White : Brushes.Black;
headerLabel.Foreground = linkTextList.Foreground;
LinkTextList.Foreground = (System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5) ? Brushes.White : Brushes.Black;
HeaderLabel.Foreground = LinkTextList.Foreground;
// Create the background worker that does the actual reading
_feedReadWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
@@ -112,7 +112,7 @@ namespace FeedCenter
// Show the link if updates are available
if (UpdateCheck.UpdateAvailable)
newVersionLink.Visibility = Visibility.Visible;
NewVersionLink.Visibility = Visibility.Visible;
Tracer.WriteLine("MainForm creation finished");
}
@@ -192,11 +192,11 @@ namespace FeedCenter
switch (Settings.Default.ToolbarLocation)
{
case Dock.Top:
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(topToolbarRow));
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(TopToolbarRow));
break;
case Dock.Bottom:
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(bottomToolbarRow));
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(BottomToolbarRow));
break;
}
}
@@ -229,10 +229,10 @@ namespace FeedCenter
switch (Settings.Default.ToolbarLocation)
{
case Dock.Top:
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(topToolbarRow));
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(TopToolbarRow));
break;
case Dock.Bottom:
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(bottomToolbarRow));
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(BottomToolbarRow));
break;
}
@@ -249,7 +249,7 @@ namespace FeedCenter
Settings.Default.WindowSize = new Size(Width, Height);
// Save the dock on the navigation tray
Settings.Default.ToolbarLocation = Grid.GetRow(navigationToolbarTray) == mainGrid.GetRowIndex(topToolbarRow) ? Dock.Top : Dock.Bottom;
Settings.Default.ToolbarLocation = Grid.GetRow(NavigationToolbarTray) == MainGrid.GetRowIndex(TopToolbarRow) ? Dock.Top : Dock.Bottom;
// Save settings
Settings.Default.Save();
@@ -261,7 +261,7 @@ namespace FeedCenter
ResizeMode = Settings.Default.WindowLocked ? ResizeMode.NoResize : ResizeMode.CanResize;
// Show or hide the border
windowBorder.BorderBrush = Settings.Default.WindowLocked ? SystemColors.ActiveBorderBrush : Brushes.Transparent;
WindowBorder.BorderBrush = Settings.Default.WindowLocked ? SystemColors.ActiveBorderBrush : Brushes.Transparent;
// Update the borders
UpdateBorder();
@@ -324,7 +324,7 @@ namespace FeedCenter
StopTimer();
// Move to the next feed if the scroll interval has expired and the mouse isn't hovering
if (linkTextList.IsMouseOver)
if (LinkTextList.IsMouseOver)
_lastFeedDisplay = DateTime.Now;
else if (DateTime.Now - _lastFeedDisplay >= Settings.Default.FeedScrollInterval)
NextFeed();
@@ -347,14 +347,14 @@ namespace FeedCenter
var feedCount = _database.Feeds.Count();
// Set button states
previousToolbarButton.IsEnabled = (feedCount > 1);
nextToolbarButton.IsEnabled = (feedCount > 1);
refreshToolbarButton.IsEnabled = (feedCount > 0);
feedButton.IsEnabled = (feedCount > 0);
openAllToolbarButton.IsEnabled = (feedCount > 0);
markReadToolbarButton.IsEnabled = (feedCount > 0);
feedLabel.Visibility = (feedCount == 0 ? Visibility.Hidden : Visibility.Visible);
feedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
PreviousToolbarButton.IsEnabled = (feedCount > 1);
NextToolbarButton.IsEnabled = (feedCount > 1);
RefreshToolbarButton.IsEnabled = (feedCount > 0);
FeedButton.IsEnabled = (feedCount > 0);
OpenAllToolbarButton.IsEnabled = (feedCount > 0);
MarkReadToolbarButton.IsEnabled = (feedCount > 0);
FeedLabel.Visibility = (feedCount == 0 ? Visibility.Hidden : Visibility.Visible);
FeedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
}
private void InitializeFeed()
@@ -365,7 +365,7 @@ namespace FeedCenter
var feedCount = _database.Feeds.Count();
// Clear the link list
linkTextList.Items.Clear();
LinkTextList.Items.Clear();
// Reset the feed index
_feedIndex = -1;
@@ -518,10 +518,10 @@ namespace FeedCenter
switch (multipleOpenAction)
{
case MultipleOpenAction.IndividualPages:
openAllToolbarButton.ToolTip = Properties.Resources.openAllMultipleToolbarButton;
OpenAllToolbarButton.ToolTip = Properties.Resources.openAllMultipleToolbarButton;
break;
case MultipleOpenAction.SinglePage:
openAllToolbarButton.ToolTip = Properties.Resources.openAllSingleToolbarButton;
OpenAllToolbarButton.ToolTip = Properties.Resources.openAllSingleToolbarButton;
break;
}
}
@@ -531,19 +531,19 @@ namespace FeedCenter
// Just clear the display if we have no feed
if (_currentFeed == null)
{
feedLabel.Text = string.Empty;
feedButton.Visibility = Visibility.Hidden;
linkTextList.Items.Clear();
FeedLabel.Text = string.Empty;
FeedButton.Visibility = Visibility.Hidden;
LinkTextList.Items.Clear();
return;
}
// Set the header to the feed title
feedLabel.Text = (_currentFeed.Name.Length > 0 ? _currentFeed.Name : _currentFeed.Title);
feedButton.Visibility = _database.Feeds.Count() > 1 ? Visibility.Visible : Visibility.Hidden;
FeedLabel.Text = (_currentFeed.Name.Length > 0 ? _currentFeed.Name : _currentFeed.Title);
FeedButton.Visibility = _database.Feeds.Count() > 1 ? Visibility.Visible : Visibility.Hidden;
// Clear the current list
linkTextList.Items.Clear();
LinkTextList.Items.Clear();
// Sort the items by sequence
var sortedItems = _currentFeed.Items.Where(item => !item.BeenRead).OrderBy(item => item.Sequence);
@@ -552,7 +552,7 @@ namespace FeedCenter
foreach (var feedItem in sortedItems)
{
// Add the list item
linkTextList.Items.Add(feedItem);
LinkTextList.Items.Add(feedItem);
}
UpdateOpenAllButton();
@@ -561,14 +561,14 @@ namespace FeedCenter
private void MarkAllItemsAsRead()
{
// Loop over all items and mark them as read
foreach (FeedItem feedItem in linkTextList.Items)
foreach (FeedItem feedItem in LinkTextList.Items)
feedItem.BeenRead = true;
// Save the changes
_database.SaveChanges();
// Clear the list
linkTextList.Items.Clear();
LinkTextList.Items.Clear();
}
#endregion
@@ -586,13 +586,13 @@ namespace FeedCenter
// Reset the progress bar if we need it
if (value)
{
feedReadProgress.Value = 0;
feedReadProgress.Maximum = feedCount + 2;
feedReadProgress.Visibility = Visibility.Visible;
FeedReadProgress.Value = 0;
FeedReadProgress.Maximum = feedCount + 2;
FeedReadProgress.Visibility = Visibility.Visible;
}
else
{
feedReadProgress.Visibility = Visibility.Collapsed;
FeedReadProgress.Visibility = Visibility.Collapsed;
}
}
@@ -639,7 +639,7 @@ namespace FeedCenter
private void HandleFeedReadWorkerProgressChanged(object sender, ProgressChangedEventArgs e)
{
// Set progress
feedReadProgress.Value = e.ProgressPercentage;
FeedReadProgress.Value = e.ProgressPercentage;
}
private void HandleFeedReadWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
@@ -661,7 +661,7 @@ namespace FeedCenter
// Check for update
if (UpdateCheck.UpdateAvailable)
newVersionLink.Visibility = Visibility.Visible;
NewVersionLink.Visibility = Visibility.Visible;
UpdateErrorLink();
}
@@ -671,10 +671,10 @@ namespace FeedCenter
var feedErrorCount = _database.Feeds.Count(f => f.LastReadResult != FeedReadResult.Success);
// Set the visibility of the error link
feedErrorsLink.Visibility = feedErrorCount == 0 ? Visibility.Collapsed : Visibility.Visible;
FeedErrorsLink.Visibility = feedErrorCount == 0 ? Visibility.Collapsed : Visibility.Visible;
// Set the text to match the number of errors
feedErrorsLink.Text = feedErrorCount == 1
FeedErrorsLink.Text = feedErrorCount == 1
? Properties.Resources.FeedErrorLink
: string.Format(Properties.Resources.FeedErrorsLink, feedErrorCount);
}
@@ -923,7 +923,7 @@ namespace FeedCenter
}
}
private void HandleLinkTextListListItemMouseUp(object sender, MouseButtonEventArgs e)
private void HandleItemMouseUp(object sender, MouseButtonEventArgs e)
{
// Only handle the middle button
if (e.ChangedButton != MouseButton.Middle)
@@ -937,14 +937,14 @@ namespace FeedCenter
feedItem.New = false;
// Remove the item from the list
linkTextList.Items.Remove(feedItem);
LinkTextList.Items.Remove(feedItem);
// Save the changes
_database.SaveChanges();
}
private void HandleLinkTextListListItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
private void HandleItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
// Get the feed item
var feedItem = (FeedItem) ((ListBoxItem) sender).DataContext;
@@ -957,7 +957,7 @@ namespace FeedCenter
feedItem.New = false;
// Remove the item from the list
linkTextList.Items.Remove(feedItem);
LinkTextList.Items.Remove(feedItem);
// Save the changes
_database.SaveChanges();
@@ -1067,7 +1067,7 @@ namespace FeedCenter
if (rectangle.Bottom != screen.WorkingArea.Bottom)
borderThickness.Bottom = 1;
windowBorder.BorderThickness = borderThickness;
WindowBorder.BorderThickness = borderThickness;
}
private DelayedMethod _windowStateDelay;
@@ -1125,7 +1125,7 @@ namespace FeedCenter
private void OpenAllFeedItemsIndividually()
{
// Create a new list of feed items
var feedItems = (from FeedItem feedItem in linkTextList.Items select feedItem).ToList();
var feedItems = (from FeedItem feedItem in LinkTextList.Items select feedItem).ToList();
// Get the browser
var browser = BrowserCommon.FindBrowser(Settings.Default.Browser);
@@ -1146,7 +1146,7 @@ namespace FeedCenter
feedItem.BeenRead = true;
// Remove the item
linkTextList.Items.Remove(feedItem);
LinkTextList.Items.Remove(feedItem);
}
// Wait a little bit
@@ -1209,9 +1209,9 @@ namespace FeedCenter
{
var menuItem = (MenuItem) e.Source;
if (Equals(menuItem, menuRefresh))
if (Equals(menuItem, MenuRefresh))
ReadCurrentFeed(true);
else if (Equals(menuItem, menuRefreshAll))
else if (Equals(menuItem, MenuRefreshAll))
ReadFeeds(true);
}
@@ -1224,9 +1224,9 @@ namespace FeedCenter
{
var menuItem = (MenuItem) e.Source;
if (Equals(menuItem, menuOpenAllSinglePage))
if (Equals(menuItem, MenuOpenAllSinglePage))
OpenAllFeedItemsOnSinglePage();
else if (Equals(menuItem, menuOpenAllMultiplePages))
else if (Equals(menuItem, MenuOpenAllMultiplePages))
OpenAllFeedItemsIndividually();
}

View File

@@ -1,24 +1,24 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.AboutOptionsPanel"
<options:OptionsPanelBase x:Class="FeedCenter.Options.AboutOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Options="clr-namespace:FeedCenter.Options"
xmlns:options="clr-namespace:FeedCenter.Options"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Grid>
<TextBlock Text="Label"
Name="applicationNameLabel"
VerticalAlignment="Top"
FontWeight="Bold" />
Name="ApplicationNameLabel"
VerticalAlignment="Top"
FontWeight="Bold" />
<TextBlock Text="Label"
Margin="0,22,0,0"
Name="versionLabel"
VerticalAlignment="Top" />
Margin="0,22,0,0"
Name="VersionLabel"
VerticalAlignment="Top" />
<TextBlock Text="Label"
Margin="0,44,0,0"
Name="companyLabel"
VerticalAlignment="Top" />
Margin="0,44,0,0"
Name="CompanyLabel"
VerticalAlignment="Top" />
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -14,12 +14,12 @@ namespace FeedCenter.Options
{
base.LoadPanel(database);
applicationNameLabel.Text = Properties.Resources.ApplicationDisplayName;
ApplicationNameLabel.Text = Properties.Resources.ApplicationDisplayName;
string version = UpdateCheck.LocalVersion.ToString();
versionLabel.Text = string.Format(Properties.Resources.Version, version);
VersionLabel.Text = string.Format(Properties.Resources.Version, version);
companyLabel.Text = ((AssemblyCompanyAttribute) Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
CompanyLabel.Text = ((AssemblyCompanyAttribute) Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
}
public override bool ValidatePanel()
@@ -31,9 +31,6 @@ namespace FeedCenter.Options
{
}
public override string CategoryName
{
get { return Properties.Resources.optionCategoryAbout; }
}
public override string CategoryName => Properties.Resources.optionCategoryAbout;
}
}

View File

@@ -5,12 +5,11 @@
Height="300"
Width="500"
xmlns:my="clr-namespace:FeedCenter.Properties"
xmlns:Options="clr-namespace:FeedCenter.Options"
xmlns:LinkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:feedCenter="clr-namespace:FeedCenter"
WindowStartupLocation="CenterOwner"
Icon="/FeedCenter;component/Resources/Application.ico"
FocusManager.FocusedElement="{Binding ElementName=feedLinkFilterText}">
FocusManager.FocusedElement="{Binding ElementName=FeedLinkFilterText}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -23,17 +22,18 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="{x:Static my:Resources.FeedLinkFilterLabel}"
Name="feedLinkFilterLabel"
Margin="6"
Padding="0"
VerticalContentAlignment="Center"
Target="{Binding ElementName=feedLinkFilterText}" />
<TextBox Grid.Column="1"
Name="feedLinkFilterText"
Target="{Binding ElementName=FeedLinkFilterText}" />
<TextBox Grid.Row="0"
Grid.Column="1"
Name="FeedLinkFilterText"
Margin="6"
TextChanged="HandleFilterTextChanged" />
<Border Grid.Row="1"
Grid.ColumnSpan="2"
Grid.Column="0"
Margin="6"
BorderThickness="1"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
@@ -42,8 +42,8 @@
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto">
<ItemsControl Name="filteredFeedsList">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl Name="FilteredFeedsList">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Margin="2"
@@ -61,27 +61,28 @@
<TextBlock Margin="2"
Text="{x:Static my:Resources.SelectLabel}">
</TextBlock>
<LinkControl:LinkControl Margin="2"
<linkControl:LinkControl Margin="2"
Click="HandleSelectAll"
Text="{x:Static my:Resources.SelectAllLabel}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Margin="2"
</linkControl:LinkControl>
<linkControl:LinkControl Margin="2"
Click="HandleSelectNone"
Text="{x:Static my:Resources.SelectNoneLabel}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Margin="2"
</linkControl:LinkControl>
<linkControl:LinkControl Margin="2"
Click="HandleSelectInvert"
Text="{x:Static my:Resources.SelectInvertLabel}">
</LinkControl:LinkControl>
</linkControl:LinkControl>
</StackPanel>
</Border>
</Grid>
</Border>
<Grid Grid.Row="2"
Grid.Column="0"
MouseRightButtonUp="HandleGridMouseRightButtonUp"
ToolTip="{x:Static my:Resources.EnableHint}">
<Label Content="{x:Static my:Resources.openLabel}"
Name="openLabel"
Name="OpenLabel"
Padding="4,0,0,0"
Margin="6,8,6,6"
ToolTip="{x:Static my:Resources.DisableHint}"
@@ -91,7 +92,7 @@
Grid.Row="2"
MouseRightButtonUp="HandleGridMouseRightButtonUp"
ToolTip="{x:Static my:Resources.EnableHint}">
<ComboBox Name="openComboBox"
<ComboBox Name="OpenComboBox"
VerticalContentAlignment="Center"
SelectedIndex="0"
Margin="6"
@@ -108,7 +109,6 @@
HorizontalAlignment="Right"
IsDefault="True"
Margin="0,6,87,6"
Name="okButton"
VerticalAlignment="Bottom"
Width="75"
Grid.Column="1"
@@ -120,7 +120,6 @@
HorizontalAlignment="Right"
IsCancel="True"
Margin="0,6,6,6"
Name="cancelButton"
VerticalAlignment="Bottom"
Width="75"
Grid.Row="3" />

View File

@@ -18,7 +18,7 @@ namespace FeedCenter.Options
InitializeComponent();
}
public bool? Display(Window window, FeedCenterEntities database)
public void Display(Window window, FeedCenterEntities database)
{
_checkedListBoxItems = new List<CheckedListItem<Feed>>();
@@ -29,11 +29,11 @@ namespace FeedCenter.Options
_collectionViewSource.SortDescriptions.Add(new SortDescription("Item.Name", ListSortDirection.Ascending));
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
filteredFeedsList.ItemsSource = _collectionViewSource.View;
FilteredFeedsList.ItemsSource = _collectionViewSource.View;
Owner = window;
return ShowDialog();
ShowDialog();
}
void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
@@ -42,7 +42,7 @@ namespace FeedCenter.Options
var feed = checkedListBoxItem.Item;
e.Accepted = feed.Link.Contains(feedLinkFilterText.Text);
e.Accepted = feed.Link.Contains(FeedLinkFilterText.Text);
}
private void HandleFilterTextChanged(object sender, TextChangedEventArgs e)
@@ -54,8 +54,8 @@ namespace FeedCenter.Options
{
foreach (var item in _checkedListBoxItems.Where(i => i.IsChecked))
{
if (openComboBox.IsEnabled)
item.Item.MultipleOpenAction = (MultipleOpenAction) ((ComboBoxItem) openComboBox.SelectedItem).Tag;
if (OpenComboBox.IsEnabled)
item.Item.MultipleOpenAction = (MultipleOpenAction) ((ComboBoxItem) OpenComboBox.SelectedItem).Tag;
}
DialogResult = true;
@@ -94,8 +94,8 @@ namespace FeedCenter.Options
private void HandleGridMouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
openLabel.IsEnabled = !openLabel.IsEnabled;
openComboBox.IsEnabled = !openComboBox.IsEnabled;
OpenLabel.IsEnabled = !OpenLabel.IsEnabled;
OpenComboBox.IsEnabled = !OpenComboBox.IsEnabled;
}
}
}

View File

@@ -1,45 +1,45 @@
<Window x:Class="FeedCenter.Options.CategoryWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:properties="clr-namespace:FeedCenter.Properties"
Title="CategoryWindow"
Height="119"
Width="339"
WindowStartupLocation="CenterOwner"
Icon="/FeedCenter;component/Resources/Application.ico"
FocusManager.FocusedElement="{Binding ElementName=nameTextBox}" >
<Grid Name="mainGrid">
FocusManager.FocusedElement="{Binding ElementName=NameTextBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="367*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static Properties:Resources.feedCategoryLabel}"
HorizontalAlignment="Left" Name="urlLabel"
Target="{Binding ElementName=nameTextBox}"
<Label Content="{x:Static properties:Resources.feedCategoryLabel}"
HorizontalAlignment="Left"
Target="{Binding ElementName=NameTextBox}"
VerticalAlignment="Top"
VerticalContentAlignment="Center"
Margin="12,12,0,0" />
Margin="12,12,0,0" />
<TextBox Margin="7,14,12,0"
Name="nameTextBox"
Name="NameTextBox"
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
VerticalAlignment="Top"
Grid.Column="1" />
<Button Content="{x:Static Properties:Resources.OkayButton}"
<Button Content="{x:Static properties:Resources.OkayButton}"
Height="23"
HorizontalAlignment="Right"
Name="okButton"
VerticalAlignment="Bottom"
Width="75"
IsDefault="True"
Margin="0,0,93,12"
Click="HandleOkayButtonClick" Grid.Column="1" />
<Button Content="{x:Static Properties:Resources.CancelButton}"
Click="HandleOkayButtonClick"
Grid.Column="1" />
<Button Content="{x:Static properties:Resources.CancelButton}"
Height="23"
HorizontalAlignment="Right"
Name="cancelButton"
VerticalAlignment="Bottom"
Width="75"
IsCancel="True"
Margin="0,0,12,12" Grid.Column="1" />
Margin="0,0,12,12"
Grid.Column="1" />
</Grid>
</Window>

View File

@@ -1,10 +1,10 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.DisplayOptionsPanel"
<options:OptionsPanelBase x:Class="FeedCenter.Options.DisplayOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Options="clr-namespace:FeedCenter.Options"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:properties="clr-namespace:FeedCenter.Properties"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
@@ -13,52 +13,55 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Content="{x:Static Properties:Resources.lockWindowCheckBox}"
<CheckBox Content="{x:Static properties:Resources.lockWindowCheckBox}"
Height="16"
HorizontalAlignment="Left"
Name="lockWindowCheckBox"
Name="LockWindowCheckBox"
VerticalAlignment="Top"
Width="300"
Grid.ColumnSpan="2" />
<CheckBox Content="{x:Static Properties:Resources.displayEmptyFeedsCheckBox}"
<CheckBox Content="{x:Static properties:Resources.displayEmptyFeedsCheckBox}"
Height="16"
HorizontalAlignment="Left"
Margin="0,22,0,0"
Name="displayEmptyFeedsCheckBox"
Name="DisplayEmptyFeedsCheckBox"
VerticalAlignment="Top"
Width="300"
Grid.ColumnSpan="2" />
<Label Content="{x:Static Properties:Resources.toolbarLocationLabel}"
Name="toolbarLocationLabel"
Grid.ColumnSpan="2"
Grid.Column="0" />
<Label Grid.Column="0"
Content="{x:Static properties:Resources.toolbarLocationLabel}"
VerticalAlignment="Top"
Margin="0,50,0,0"
Padding="0,5,5,5"
Target="{Binding ElementName=toolbarLocationComboBox}"
Target="{Binding ElementName=ToolbarLocationComboBox}"
Width="97" />
<ComboBox Margin="8,53,0,0"
Name="toolbarLocationComboBox"
VerticalAlignment="Top" Grid.Column="1">
<ComboBoxItem Content="{x:Static Properties:Resources.Top}"
Name="ToolbarLocationComboBox"
VerticalAlignment="Top"
Grid.Column="1">
<ComboBoxItem Content="{x:Static properties:Resources.Top}"
Tag="{x:Static Dock.Top}" />
<ComboBoxItem Content="{x:Static Properties:Resources.Bottom}"
<ComboBoxItem Content="{x:Static properties:Resources.Bottom}"
Tag="{x:Static Dock.Bottom}" />
</ComboBox>
<Label Content="{x:Static Properties:Resources.multipleLineDisplayLabel}"
Name="multipleLineDisplayLabel"
<Label Grid.Column="0"
Content="{x:Static properties:Resources.multipleLineDisplayLabel}"
VerticalAlignment="Top"
Margin="0,82,0,0"
Padding="0,5,5,5"
Target="{Binding ElementName=multipleLineDisplayComboBox}"
Target="{Binding ElementName=MultipleLineDisplayComboBox}"
Width="97" />
<ComboBox Margin="8,86,0,0"
Name="multipleLineDisplayComboBox"
VerticalAlignment="Top" Grid.Column="1">
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplayNormal}"
Tag="{x:Static Options:MultipleLineDisplay.Normal}" />
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplaySingleLine}"
Tag="{x:Static Options:MultipleLineDisplay.SingleLine}" />
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplayFirstLine}"
Tag="{x:Static Options:MultipleLineDisplay.FirstLine}" />
Name="MultipleLineDisplayComboBox"
VerticalAlignment="Top"
Grid.Column="1">
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplayNormal}"
Tag="{x:Static options:MultipleLineDisplay.Normal}" />
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplaySingleLine}"
Tag="{x:Static options:MultipleLineDisplay.SingleLine}" />
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplayFirstLine}"
Tag="{x:Static options:MultipleLineDisplay.FirstLine}" />
</ComboBox>
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -15,10 +15,10 @@ namespace FeedCenter.Options
{
base.LoadPanel(database);
lockWindowCheckBox.IsChecked = Settings.Default.WindowLocked;
displayEmptyFeedsCheckBox.IsChecked = Settings.Default.DisplayEmptyFeeds;
toolbarLocationComboBox.SelectedItem = toolbarLocationComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (Dock) comboBoxItem.Tag == Settings.Default.ToolbarLocation);
multipleLineDisplayComboBox.SelectedItem = multipleLineDisplayComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (MultipleLineDisplay) comboBoxItem.Tag == Settings.Default.MultipleLineDisplay);
LockWindowCheckBox.IsChecked = Settings.Default.WindowLocked;
DisplayEmptyFeedsCheckBox.IsChecked = Settings.Default.DisplayEmptyFeeds;
ToolbarLocationComboBox.SelectedItem = ToolbarLocationComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (Dock) comboBoxItem.Tag == Settings.Default.ToolbarLocation);
MultipleLineDisplayComboBox.SelectedItem = MultipleLineDisplayComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (MultipleLineDisplay) comboBoxItem.Tag == Settings.Default.MultipleLineDisplay);
}
public override bool ValidatePanel()
@@ -28,22 +28,19 @@ namespace FeedCenter.Options
public override void SavePanel()
{
if (lockWindowCheckBox.IsChecked.HasValue && Settings.Default.WindowLocked != lockWindowCheckBox.IsChecked.Value)
Settings.Default.WindowLocked = lockWindowCheckBox.IsChecked.Value;
if (LockWindowCheckBox.IsChecked.HasValue && Settings.Default.WindowLocked != LockWindowCheckBox.IsChecked.Value)
Settings.Default.WindowLocked = LockWindowCheckBox.IsChecked.Value;
if (displayEmptyFeedsCheckBox.IsChecked.HasValue && Settings.Default.DisplayEmptyFeeds != displayEmptyFeedsCheckBox.IsChecked.Value)
Settings.Default.DisplayEmptyFeeds = displayEmptyFeedsCheckBox.IsChecked.Value;
if (DisplayEmptyFeedsCheckBox.IsChecked.HasValue && Settings.Default.DisplayEmptyFeeds != DisplayEmptyFeedsCheckBox.IsChecked.Value)
Settings.Default.DisplayEmptyFeeds = DisplayEmptyFeedsCheckBox.IsChecked.Value;
var dock = (Dock) ((ComboBoxItem) toolbarLocationComboBox.SelectedItem).Tag;
var dock = (Dock) ((ComboBoxItem) ToolbarLocationComboBox.SelectedItem).Tag;
Settings.Default.ToolbarLocation = dock;
var multipleLineDisplay = (MultipleLineDisplay) ((ComboBoxItem) multipleLineDisplayComboBox.SelectedItem).Tag;
var multipleLineDisplay = (MultipleLineDisplay) ((ComboBoxItem) MultipleLineDisplayComboBox.SelectedItem).Tag;
Settings.Default.MultipleLineDisplay = multipleLineDisplay;
}
public override string CategoryName
{
get { return Properties.Resources.optionCategoryDisplay; }
}
public override string CategoryName => Properties.Resources.optionCategoryDisplay;
}
}

View File

@@ -1,20 +1,19 @@
<Window x:Class="FeedCenter.Options.FeedWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:feedCenter="clr-namespace:FeedCenter"
Title="FeedWindow"
Height="300"
Width="450"
WindowStartupLocation="CenterOwner"
Icon="/FeedCenter;component/Resources/Application.ico"
FocusManager.FocusedElement="{Binding ElementName=urlTextBox}">
<Grid Name="mainGrid">
<TabControl Name="optionsTabControl"
FocusManager.FocusedElement="{Binding ElementName=UrlTextBox}">
<Grid>
<TabControl Name="OptionsTabControl"
Margin="12,12,12,41">
<TabItem Header="{x:Static Properties:Resources.generalTab}"
Name="generalTab">
<Grid Name="generalGrid">
<TabItem Header="{x:Static properties:Resources.generalTab}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -26,37 +25,37 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static Properties:Resources.feedUrlLabel}"
Name="urlLabel"
<Label Content="{x:Static properties:Resources.feedUrlLabel}"
VerticalContentAlignment="Center"
Target="{Binding ElementName=urlTextBox}"
Target="{Binding ElementName=UrlTextBox}"
Margin="6"
Padding="0" />
<TextBox Name="urlTextBox"
<TextBox Name="UrlTextBox"
Grid.Row="0"
Grid.Column="1"
Text="{Binding Path=Source, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
Margin="6" />
<Label Content="{x:Static Properties:Resources.feedNameLabel}"
Name="nameLabel"
<Label Content="{x:Static properties:Resources.feedNameLabel}"
VerticalContentAlignment="Center"
Target="{Binding ElementName=nameTextBox}"
Target="{Binding ElementName=NameTextBox}"
Grid.Row="1"
Grid.Column="0"
Margin="6"
Padding="0" />
<TextBox Name="nameTextBox"
<TextBox Name="NameTextBox"
Grid.Column="1"
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
Grid.Row="1"
Margin="6" />
<Label Content="{x:Static Properties:Resources.feedCategoryLabel}"
Name="feedCategoryLabel"
Target="{Binding ElementName=categoryComboBox}"
<Label Content="{x:Static properties:Resources.feedCategoryLabel}"
Target="{Binding ElementName=CategoryComboBox}"
VerticalContentAlignment="Center"
Grid.Row="2"
Grid.Column="0"
Margin="6"
Padding="0" />
<ComboBox Grid.Column="1"
Name="categoryComboBox"
Name="CategoryComboBox"
DisplayMemberPath="Name"
SelectedValuePath="ID"
SelectedValue="{Binding Path=Category.ID}"
@@ -64,22 +63,22 @@
Margin="6" />
<CheckBox Grid.ColumnSpan="2"
Name="readIntervalCheckBox"
Grid.Column="0"
Name="ReadIntervalCheckBox"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Enabled, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
Grid.Row="3"
Margin="6">
<DockPanel>
<Label Content="{x:Static Properties:Resources.feedReadIntervalPrefix}"
<Label Content="{x:Static properties:Resources.feedReadIntervalPrefix}"
HorizontalAlignment="Left"
Margin="0,0,5,0"
VerticalAlignment="Center"
Padding="0" />
<TextBox Width="50"
Name="readIntervalTextBox"
Text="{Binding Path=CheckInterval, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
IsEnabled="{Binding ElementName=readIntervalCheckBox, Path=IsChecked}" />
<Label Content="{x:Static Properties:Resources.feedReadIntervalSuffix}"
IsEnabled="{Binding ElementName=ReadIntervalCheckBox, Path=IsChecked}" />
<Label Content="{x:Static properties:Resources.feedReadIntervalSuffix}"
HorizontalAlignment="Left"
Margin="5,0,0,0"
VerticalAlignment="Center"
@@ -88,8 +87,7 @@
</CheckBox>
</Grid>
</TabItem>
<TabItem Header="{x:Static Properties:Resources.readingTab}"
Name="readingTab">
<TabItem Header="{x:Static properties:Resources.readingTab}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -99,29 +97,28 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="{x:Static Properties:Resources.openLabel}"
Name="openLabel"
Target="{Binding ElementName=openComboBox}"
<Label Content="{x:Static properties:Resources.openLabel}"
Target="{Binding ElementName=OpenComboBox}"
Padding="0"
VerticalContentAlignment="Center"
Margin="6" />
<ComboBox Name="openComboBox"
<ComboBox Name="OpenComboBox"
VerticalContentAlignment="Center"
SelectedValue="{Binding Path=MultipleOpenAction, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
SelectedValuePath="Tag"
Grid.Row="0"
Grid.Column="1"
Margin="6">
<ComboBoxItem Content="{x:Static Properties:Resources.openAllSingleToolbarButton}"
<ComboBoxItem Content="{x:Static properties:Resources.openAllSingleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.SinglePage}" />
<ComboBoxItem Content="{x:Static Properties:Resources.openAllMultipleToolbarButton}"
<ComboBoxItem Content="{x:Static properties:Resources.openAllMultipleToolbarButton}"
Tag="{x:Static feedCenter:MultipleOpenAction.IndividualPages}" />
</ComboBox>
</Grid>
</TabItem>
<TabItem Header="{x:Static Properties:Resources.authenticationTab}"
Name="authenticationTab">
<Grid Name="authenticationGrid">
<TabItem Header="{x:Static properties:Resources.authenticationTab}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -132,61 +129,58 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Content="{x:Static Properties:Resources.requiresAuthenticationCheckBox}"
Name="requiresAuthenticationCheckBox"
<CheckBox Content="{x:Static properties:Resources.requiresAuthenticationCheckBox}"
Name="RequiresAuthenticationCheckBox"
Grid.ColumnSpan="2"
Grid.Row="0"
Grid.Column="0"
IsChecked="{Binding Path=Authenticate, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
Margin="6" />
<Label Content="{x:Static Properties:Resources.authenticationUserNameLabel}"
Name="authenticationUserNameLabel"
Target="{Binding ElementName=authenticationUserNameTextBox}"
<Label Content="{x:Static properties:Resources.authenticationUserNameLabel}"
Target="{Binding ElementName=AuthenticationUserNameTextBox}"
VerticalContentAlignment="Center"
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
Grid.Row="1"
Grid.Column="0"
Margin="6"
Padding="20,0,0,0" />
<TextBox Name="authenticationUserNameTextBox"
<TextBox Name="AuthenticationUserNameTextBox"
Text="{Binding Path=UserName, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
Grid.Column="1"
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
Grid.Row="1"
Margin="6" />
<Label Content="{x:Static Properties:Resources.authenticationPasswordLabel}"
Name="authenticationPasswordLabel"
Target="{Binding ElementName=authenticationPasswordTextBox}"
<Label Content="{x:Static properties:Resources.authenticationPasswordLabel}"
Target="{Binding ElementName=AuthenticationPasswordTextBox}"
VerticalContentAlignment="Center"
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
Grid.Row="2"
Grid.Column="0"
Margin="6"
Padding="20,0,0,0" />
<TextBox Name="authenticationPasswordTextBox"
<TextBox Name="AuthenticationPasswordTextBox"
Text="{Binding Path=Password, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
Grid.Column="1"
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
Grid.Row="2"
Margin="6" />
</Grid>
</TabItem>
</TabControl>
<Button Content="{x:Static Properties:Resources.OkayButton}"
<Button Content="{x:Static properties:Resources.OkayButton}"
Height="23"
HorizontalAlignment="Right"
Name="okButton"
VerticalAlignment="Bottom"
Width="75"
IsDefault="True"
Margin="0,0,93,12"
Click="HandleOkayButtonClick" />
<Button Content="{x:Static Properties:Resources.CancelButton}"
<Button Content="{x:Static properties:Resources.CancelButton}"
Height="23"
HorizontalAlignment="Right"
Name="cancelButton"
VerticalAlignment="Bottom"
Width="75"
IsCancel="True"
Margin="0,0,12,12" />
</Grid>
</Window>

View File

@@ -20,7 +20,7 @@ namespace FeedCenter.Options
database.Categories.Load();
// Bind the category combo box
categoryComboBox.ItemsSource = database.Categories.Local;
CategoryComboBox.ItemsSource = database.Categories.Local;
// Set the data context
DataContext = feed;
@@ -56,7 +56,7 @@ namespace FeedCenter.Options
var firstErrorElement = bindingExpressions.First(b => b.BindingExpression.HasError).FrameworkElement;
// Loop over each tab item
foreach (TabItem tabItem in optionsTabControl.Items)
foreach (TabItem tabItem in OptionsTabControl.Items)
{
// Cast the content as visual
var content = (Visual) tabItem.Content;

View File

@@ -1,11 +1,11 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.FeedsOptionsPanel"
<options:OptionsPanelBase x:Class="FeedCenter.Options.FeedsOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Options="clr-namespace:FeedCenter.Options"
xmlns:LinkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
xmlns:properties="clr-namespace:FeedCenter.Properties"
mc:Ignorable="d"
d:DesignHeight="311"
d:DesignWidth="425">
@@ -19,7 +19,7 @@
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<DataGrid Name="feedListBox"
<DataGrid Name="FeedListBox"
SelectionMode="Extended"
Grid.Column="2"
Grid.Row="0"
@@ -31,11 +31,11 @@
Background="{x:Null}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}"
Header="{x:Static Properties:Resources.FeedNameColumnHeader}"
Header="{x:Static properties:Resources.FeedNameColumnHeader}"
SortDirection="Ascending"
Width="*" />
<DataGridTextColumn Binding="{Binding LastUpdated, StringFormat=d}"
Header="{x:Static Properties:Resources.LastUpdatedColumnHeader}"
Header="{x:Static properties:Resources.LastUpdatedColumnHeader}"
Width="Auto" />
</DataGrid.Columns>
<DataGrid.ItemContainerStyle>
@@ -53,7 +53,7 @@
</Style>
</DataGrid.CellStyle>
</DataGrid>
<DataGrid Name="categoryListBox"
<DataGrid Name="CategoryListBox"
SelectionChanged="HandleCategoryListBoxSelectionChanged"
Grid.Row="0"
SelectionMode="Extended"
@@ -67,7 +67,7 @@
Background="{x:Null}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}"
Header="{x:Static Properties:Resources.CategoryNameColumnHeader}"
Header="{x:Static properties:Resources.CategoryNameColumnHeader}"
SortDirection="Ascending"
Width="*" />
</DataGrid.Columns>
@@ -94,68 +94,66 @@
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<StackPanel Orientation="Horizontal"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<LinkControl:LinkControl Name="addFeedButton"
<linkControl:LinkControl Name="AddFeedButton"
Margin="2"
Click="HandleAddFeedButtonClick"
Text="{x:Static Properties:Resources.AddLink}"
ToolTip="{x:Static Properties:Resources.AddFeedButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="editFeedButton"
Text="{x:Static properties:Resources.AddLink}"
ToolTip="{x:Static properties:Resources.AddFeedButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Name="EditFeedButton"
Margin="2"
Click="HandleEditFeedButtonClick"
Text="{x:Static Properties:Resources.EditLink}"
ToolTip="{x:Static Properties:Resources.EditFeedButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="deleteFeedButton"
Text="{x:Static properties:Resources.EditLink}"
ToolTip="{x:Static properties:Resources.EditFeedButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Name="DeleteFeedButton"
Margin="2"
Click="HandleDeleteFeedButtonClick"
Text="{x:Static Properties:Resources.DeleteLink}"
ToolTip="{x:Static Properties:Resources.DeleteFeedButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="importButton"
Margin="6,2,2,2"
Text="{x:Static properties:Resources.DeleteLink}"
ToolTip="{x:Static properties:Resources.DeleteFeedButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Margin="6,2,2,2"
Click="HandleImportButtonClick"
Text="{x:Static Properties:Resources.ImportLink}"
ToolTip="{x:Static Properties:Resources.ImportFeedsButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="exportButton"
Margin="2"
Text="{x:Static properties:Resources.ImportLink}"
ToolTip="{x:Static properties:Resources.ImportFeedsButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Margin="2"
Click="HandleExportButtonClick"
Text="{x:Static Properties:Resources.ExportLink}"
ToolTip="{x:Static Properties:Resources.ExportFeedsButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="multipleEditButton"
Margin="6,2,2,2"
Text="{x:Static properties:Resources.ExportLink}"
ToolTip="{x:Static properties:Resources.ExportFeedsButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Margin="6,2,2,2"
Click="HandleMultipleEditClick"
Text="{x:Static Properties:Resources.MultipleEditLink}"
ToolTip="{x:Static Properties:Resources.MultipleEditButton}">
</LinkControl:LinkControl>
Text="{x:Static properties:Resources.MultipleEditLink}"
ToolTip="{x:Static properties:Resources.MultipleEditButton}">
</linkControl:LinkControl>
</StackPanel>
</Border>
<Border Grid.Row="1"
Grid.Column="0"
BorderThickness="1,0,1,1"
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<StackPanel Orientation="Horizontal"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<LinkControl:LinkControl Name="addCategoryButton"
<linkControl:LinkControl Name="AddCategoryButton"
Margin="2"
Click="HandleAddCategoryButtonClick"
Text="{x:Static Properties:Resources.AddLink}"
ToolTip="{x:Static Properties:Resources.AddCategoryButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="editCategoryButton"
Text="{x:Static properties:Resources.AddLink}"
ToolTip="{x:Static properties:Resources.AddCategoryButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Name="EditCategoryButton"
Margin="2"
Click="HandleEditCategoryButtonClick"
Text="{x:Static Properties:Resources.EditLink}"
ToolTip="{x:Static Properties:Resources.EditCategoryButton}">
</LinkControl:LinkControl>
<LinkControl:LinkControl Name="deleteCategoryButton"
Text="{x:Static properties:Resources.EditLink}"
ToolTip="{x:Static properties:Resources.EditCategoryButton}">
</linkControl:LinkControl>
<linkControl:LinkControl Name="DeleteCategoryButton"
Margin="2"
Click="HandleDeleteCategoryButtonClick"
Text="{x:Static Properties:Resources.DeleteLink}"
ToolTip="{x:Static Properties:Resources.DeleteCategoryButton}">
</LinkControl:LinkControl>
Text="{x:Static properties:Resources.DeleteLink}"
ToolTip="{x:Static properties:Resources.DeleteCategoryButton}">
</linkControl:LinkControl>
</StackPanel>
</Border>
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -31,8 +31,8 @@ namespace FeedCenter.Options
collectionViewSource.SortDescriptions.Add(new SortDescription("SortKey", ListSortDirection.Ascending));
collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
categoryListBox.ItemsSource = collectionViewSource.View;
categoryListBox.SelectedIndex = 0;
CategoryListBox.ItemsSource = collectionViewSource.View;
CategoryListBox.SelectedIndex = 0;
}
public override bool ValidatePanel()
@@ -43,10 +43,7 @@ namespace FeedCenter.Options
public override void SavePanel()
{ }
public override string CategoryName
{
get { return Properties.Resources.optionCategoryFeeds; }
}
public override string CategoryName => Properties.Resources.optionCategoryFeeds;
#endregion
@@ -54,16 +51,16 @@ namespace FeedCenter.Options
private void SetFeedButtonStates()
{
addFeedButton.IsEnabled = true;
editFeedButton.IsEnabled = (feedListBox.SelectedItem != null);
deleteFeedButton.IsEnabled = (feedListBox.SelectedItem != null);
AddFeedButton.IsEnabled = true;
EditFeedButton.IsEnabled = (FeedListBox.SelectedItem != null);
DeleteFeedButton.IsEnabled = (FeedListBox.SelectedItem != null);
}
private void AddFeed()
{
var feed = Feed.Create(Database);
var category = (Category) categoryListBox.SelectedItem;
var category = (Category) CategoryListBox.SelectedItem;
feed.Category = category;
@@ -75,7 +72,7 @@ namespace FeedCenter.Options
{
Database.Feeds.Add(feed);
feedListBox.SelectedItem = feed;
FeedListBox.SelectedItem = feed;
SetFeedButtonStates();
}
@@ -83,10 +80,10 @@ namespace FeedCenter.Options
private void EditSelectedFeed()
{
if (feedListBox.SelectedItem == null)
if (FeedListBox.SelectedItem == null)
return;
var feed = (Feed) feedListBox.SelectedItem;
var feed = (Feed) FeedListBox.SelectedItem;
var feedWindow = new FeedWindow();
@@ -95,7 +92,7 @@ namespace FeedCenter.Options
private void DeleteSelectedFeed()
{
var feed = (Feed) feedListBox.SelectedItem;
var feed = (Feed) FeedListBox.SelectedItem;
Database.Feeds.Remove(feed);
@@ -291,9 +288,9 @@ namespace FeedCenter.Options
private void SetCategoryButtonStates()
{
addCategoryButton.IsEnabled = true;
editCategoryButton.IsEnabled = (categoryListBox.SelectedItem != null);
deleteCategoryButton.IsEnabled = (categoryListBox.SelectedItem != null);
AddCategoryButton.IsEnabled = true;
EditCategoryButton.IsEnabled = (CategoryListBox.SelectedItem != null);
DeleteCategoryButton.IsEnabled = (CategoryListBox.SelectedItem != null);
}
private void AddCategory()
@@ -308,7 +305,7 @@ namespace FeedCenter.Options
{
Database.Categories.Add(category);
categoryListBox.SelectedItem = category;
CategoryListBox.SelectedItem = category;
SetCategoryButtonStates();
}
@@ -316,10 +313,10 @@ namespace FeedCenter.Options
private void EditSelectedCategory()
{
if (categoryListBox.SelectedItem == null)
if (CategoryListBox.SelectedItem == null)
return;
var category = (Category) categoryListBox.SelectedItem;
var category = (Category) CategoryListBox.SelectedItem;
var categoryWindow = new CategoryWindow();
@@ -328,7 +325,7 @@ namespace FeedCenter.Options
private void DeleteSelectedCategory()
{
var category = (Category) categoryListBox.SelectedItem;
var category = (Category) CategoryListBox.SelectedItem;
Database.Categories.Remove(category);
@@ -366,20 +363,20 @@ namespace FeedCenter.Options
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
feedListBox.ItemsSource = _collectionViewSource.View;
FeedListBox.ItemsSource = _collectionViewSource.View;
}
_collectionViewSource.View.Refresh();
if (feedListBox.Items.Count > 0)
feedListBox.SelectedIndex = 0;
if (FeedListBox.Items.Count > 0)
FeedListBox.SelectedIndex = 0;
SetFeedButtonStates();
}
private void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
{
var selectedCategory = (Category) categoryListBox.SelectedItem;
var selectedCategory = (Category) CategoryListBox.SelectedItem;
var feed = (Feed) e.Item;
@@ -404,9 +401,9 @@ namespace FeedCenter.Options
{
if (e.LeftButton == MouseButtonState.Pressed)
{
var selectedItems = feedListBox.SelectedItems.Cast<Feed>().ToList();
var selectedItems = FeedListBox.SelectedItems.Cast<Feed>().ToList();
DragDrop.DoDragDrop(feedListBox, selectedItems, DragDropEffects.Move);
DragDrop.DoDragDrop(FeedListBox, selectedItems, DragDropEffects.Move);
}
}

View File

@@ -1,21 +1,22 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.GeneralOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Options="clr-namespace:FeedCenter.Options" xmlns:Properties="clr-namespace:FeedCenter.Properties" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<options:OptionsPanelBase x:Class="FeedCenter.Options.GeneralOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:properties="clr-namespace:FeedCenter.Properties"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Content="{x:Static Properties:Resources.startWithWindowsCheckBox}"
Name="startWithWindowsCheckBox"
VerticalAlignment="Top" VerticalContentAlignment="Center" Grid.ColumnSpan="2" />
<CheckBox Content="{x:Static Properties:Resources.registerAsDefaultFeedReaderCheckBox}"
HorizontalAlignment="Left"
Margin="0,22,0,0"
Name="registerAsDefaultFeedReaderCheckBox"
VerticalAlignment="Top" VerticalContentAlignment="Center" Grid.ColumnSpan="2" />
<CheckBox Content="{x:Static properties:Resources.startWithWindowsCheckBox}"
Name="StartWithWindowsCheckBox"
VerticalAlignment="Top"
VerticalContentAlignment="Center"
Grid.ColumnSpan="2" />
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -16,8 +16,7 @@ namespace FeedCenter.Options
var settings = Properties.Settings.Default;
startWithWindowsCheckBox.IsChecked = settings.StartWithWindows;
registerAsDefaultFeedReaderCheckBox.IsChecked = settings.RegisterAsDefaultFeedReader;
StartWithWindowsCheckBox.IsChecked = settings.StartWithWindows;
}
public override bool ValidatePanel()
@@ -29,21 +28,12 @@ namespace FeedCenter.Options
{
var settings = Properties.Settings.Default;
if (startWithWindowsCheckBox.IsChecked.HasValue && settings.StartWithWindows != startWithWindowsCheckBox.IsChecked.Value)
settings.StartWithWindows = startWithWindowsCheckBox.IsChecked.Value;
if (registerAsDefaultFeedReaderCheckBox.IsChecked.HasValue && settings.RegisterAsDefaultFeedReader != registerAsDefaultFeedReaderCheckBox.IsChecked.Value)
settings.RegisterAsDefaultFeedReader = registerAsDefaultFeedReaderCheckBox.IsChecked.Value;
if (StartWithWindowsCheckBox.IsChecked.HasValue && settings.StartWithWindows != StartWithWindowsCheckBox.IsChecked.Value)
settings.StartWithWindows = StartWithWindowsCheckBox.IsChecked.Value;
Application.Current.SetStartWithWindows(settings.StartWithWindows);
if (settings.RegisterAsDefaultFeedReader)
SystemConfiguration.SetDefaultFeedReader();
}
public override string CategoryName
{
get { return Properties.Resources.optionCategoryGeneral; }
}
public override string CategoryName => Properties.Resources.optionCategoryGeneral;
}
}

View File

@@ -5,7 +5,7 @@ namespace FeedCenter.Options
{
public class OptionsPanelBase : UserControl
{
protected FeedCenterEntities Database { get; set; }
protected FeedCenterEntities Database { get; private set; }
public virtual void LoadPanel(FeedCenterEntities database)
{
@@ -22,9 +22,6 @@ namespace FeedCenter.Options
throw new NotImplementedException();
}
public virtual string CategoryName
{
get { return null; }
}
public virtual string CategoryName => null;
}
}

View File

@@ -1,8 +1,8 @@
<Window x:Class="FeedCenter.Options.OptionsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
Title="{x:Static Properties:Resources.OptionsWindow}"
xmlns:properties="clr-namespace:FeedCenter.Properties"
Title="{x:Static properties:Resources.OptionsWindow}"
Height="360"
Width="720"
ResizeMode="CanResize"
@@ -10,25 +10,23 @@
Icon="/FeedCenter;component/Resources/Application.ico">
<Grid>
<ListBox HorizontalAlignment="Left"
Name="categoryListBox"
Name="CategoryListBox"
Width="126"
SelectionChanged="HandleSelectedCategoryChanged"
Margin="12,12,0,41" />
<ContentControl Margin="144,12,12,41"
Name="contentControl"
Name="ContentControl"
IsTabStop="False" />
<Button Content="{x:Static Properties:Resources.OkayButton}"
<Button Content="{x:Static properties:Resources.OkayButton}"
Height="23"
HorizontalAlignment="Right"
Margin="0,0,93,12"
Name="okButton"
VerticalAlignment="Bottom"
Width="75"
IsDefault="True"
Click="HandleOkayButtonClick" />
<Button Content="{x:Static Properties:Resources.CancelButton}"
<Button Content="{x:Static properties:Resources.CancelButton}"
Margin="0,0,12,12"
Name="cancelButton"
Height="23"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"

View File

@@ -50,26 +50,26 @@ namespace FeedCenter.Options
optionsPanel.LoadPanel(_database);
// Add the panel to the category ist
categoryListBox.Items.Add(new CategoryListItem(optionsPanel));
CategoryListBox.Items.Add(new CategoryListItem(optionsPanel));
// Set the panel into the right side
contentControl.Content = optionsPanel;
ContentControl.Content = optionsPanel;
}
// Select the first item
categoryListBox.SelectedItem = categoryListBox.Items[0];
CategoryListBox.SelectedItem = CategoryListBox.Items[0];
}
private void SelectCategory(OptionsPanelBase panel)
{
// Set the content
contentControl.Content = panel;
ContentControl.Content = panel;
}
private void HandleSelectedCategoryChanged(object sender, SelectionChangedEventArgs e)
{
// Select the right category
SelectCategory(((CategoryListItem) categoryListBox.SelectedItem).Panel);
SelectCategory(((CategoryListItem) CategoryListBox.SelectedItem).Panel);
}
#endregion
@@ -78,7 +78,7 @@ namespace FeedCenter.Options
private class CategoryListItem
{
public OptionsPanelBase Panel { get; private set; }
public OptionsPanelBase Panel { get; }
public CategoryListItem(OptionsPanelBase panel)
{

View File

@@ -1,8 +1,8 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.ReadingOptionsPanel"
<options:OptionsPanelBase x:Class="FeedCenter.Options.ReadingOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Options="clr-namespace:FeedCenter.Options"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:properties="clr-namespace:FeedCenter.Properties"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
@@ -17,18 +17,18 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static Properties:Resources.browserLabel}"
Name="browserLabel"
Target="{Binding ElementName=browserComboBox}"
<Label Content="{x:Static properties:Resources.browserLabel}"
Target="{Binding ElementName=BrowserComboBox}"
Grid.Column="0"
Padding="0"
VerticalContentAlignment="Center"
Margin="0,0,5,0" />
<ComboBox Name="browserComboBox"
<ComboBox Name="BrowserComboBox"
Grid.Row="0"
Grid.Column="1"
VerticalContentAlignment="Center">
<ComboBoxItem Content="{x:Static Properties:Resources.DefaultBrowserCaption}"
<ComboBoxItem Content="{x:Static properties:Resources.DefaultBrowserCaption}"
Tag="" />
</ComboBox>
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -18,7 +18,7 @@ namespace FeedCenter.Options
var settings = Properties.Settings.Default;
LoadBrowserComboBox(browserComboBox, settings.Browser);
LoadBrowserComboBox(BrowserComboBox, settings.Browser);
}
public override bool ValidatePanel()
@@ -30,7 +30,7 @@ namespace FeedCenter.Options
{
var settings = Properties.Settings.Default;
var browser = (string) ((ComboBoxItem) browserComboBox.SelectedItem).Tag;
var browser = (string) ((ComboBoxItem) BrowserComboBox.SelectedItem).Tag;
settings.Browser = browser;
@@ -38,10 +38,7 @@ namespace FeedCenter.Options
this.UpdateAllSources(expressions);
}
public override string CategoryName
{
get { return Properties.Resources.optionCategoryReading; }
}
public override string CategoryName => Properties.Resources.optionCategoryReading;
private static void LoadBrowserComboBox(ComboBox comboBox, string selected)
{

View File

@@ -1,20 +1,23 @@
<Options:OptionsPanelBase x:Class="FeedCenter.Options.UpdateOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Options="clr-namespace:FeedCenter.Options" xmlns:Properties="clr-namespace:FeedCenter.Properties" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<options:OptionsPanelBase x:Class="FeedCenter.Options.UpdateOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:options="clr-namespace:FeedCenter.Options"
xmlns:properties="clr-namespace:FeedCenter.Properties"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Grid>
<CheckBox Content="{x:Static Properties:Resources.checkVersionOnStartupCheckBox}"
Name="checkVersionOnStartupCheckBox"
<CheckBox Content="{x:Static properties:Resources.checkVersionOnStartupCheckBox}"
Name="CheckVersionOnStartupCheckBox"
VerticalAlignment="Top" />
<Button Content="{x:Static Properties:Resources.checkVersionNowButton}"
<Button Content="{x:Static properties:Resources.checkVersionNowButton}"
Height="23"
HorizontalAlignment="Left"
Margin="0,22,0,0"
Name="checkVersionNowButton"
VerticalAlignment="Top"
Width="75"
Click="HandleCheckVersionNowButtonClick" />
</Grid>
</Options:OptionsPanelBase>
</options:OptionsPanelBase>

View File

@@ -13,7 +13,7 @@ namespace FeedCenter.Options
{
base.LoadPanel(database);
checkVersionOnStartupCheckBox.IsChecked = Properties.Settings.Default.CheckVersionAtStartup;
CheckVersionOnStartupCheckBox.IsChecked = Properties.Settings.Default.CheckVersionAtStartup;
}
public override bool ValidatePanel()
@@ -23,14 +23,11 @@ namespace FeedCenter.Options
public override void SavePanel()
{
if (checkVersionOnStartupCheckBox.IsChecked.HasValue && Properties.Settings.Default.CheckVersionAtStartup != checkVersionOnStartupCheckBox.IsChecked.Value)
Properties.Settings.Default.CheckVersionAtStartup = checkVersionOnStartupCheckBox.IsChecked.Value;
if (CheckVersionOnStartupCheckBox.IsChecked.HasValue && Properties.Settings.Default.CheckVersionAtStartup != CheckVersionOnStartupCheckBox.IsChecked.Value)
Properties.Settings.Default.CheckVersionAtStartup = CheckVersionOnStartupCheckBox.IsChecked.Value;
}
public override string CategoryName
{
get { return Properties.Resources.optionCategoryUpdate; }
}
public override string CategoryName => Properties.Resources.optionCategoryUpdate;
private void HandleCheckVersionNowButtonClick(object sender, System.Windows.RoutedEventArgs e)
{

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -12,7 +12,7 @@ namespace FeedCenter.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -221,19 +221,6 @@ namespace FeedCenter.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(Common.Settings.GenericSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool RegisterAsDefaultFeedReader {
get {
return ((bool)(this["RegisterAsDefaultFeedReader"]));
}
set {
this["RegisterAsDefaultFeedReader"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(Common.Settings.GenericSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

View File

@@ -53,9 +53,6 @@
<Setting Name="OpenAllSleepInterval" Provider="Common.Settings.GenericSettingsProvider" Type="System.Int32" Scope="User">
<Value Profile="(Default)">500</Value>
</Setting>
<Setting Name="RegisterAsDefaultFeedReader" Provider="Common.Settings.GenericSettingsProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Browser" Provider="Common.Settings.GenericSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Properties="clr-namespace:FeedCenter.Properties"
xmlns:properties="clr-namespace:FeedCenter.Properties"
mc:Ignorable="d"
Title="Splash"
WindowStartupLocation="CenterScreen"
@@ -21,9 +21,8 @@
BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
Padding="3">
<DockPanel LastChildFill="True">
<Label Content="{x:Static Properties:Resources.ApplicationDisplayName}"
<Label Content="{x:Static properties:Resources.ApplicationDisplayName}"
Padding="0"
Name="lblApplicationName"
VerticalAlignment="Top"
FontSize="20"
FontWeight="Bold"
@@ -32,18 +31,18 @@
DockPanel.Dock="Top" />
<Label Content="*Version"
Padding="0,3,0,0"
Name="lblVersion"
Name="VersionLabel"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
DockPanel.Dock="Top" />
<ProgressBar Name="progressBar"
<ProgressBar Name="ProgressBar"
VerticalAlignment="Bottom"
Height="16"
DockPanel.Dock="Bottom"
Margin="5,0,5,5" />
<Label Content="*Status"
Height="35"
Name="lblStatus"
Name="StatusLabel"
DockPanel.Dock="Bottom"
VerticalContentAlignment="Bottom"
Margin="5,0,5,0"

View File

@@ -52,16 +52,16 @@ namespace FeedCenter
string version = UpdateCheck.LocalVersion.ToString();
// Show the version
lblVersion.Content = string.Format(Properties.Resources.Version, version);
VersionLabel.Content = string.Format(Properties.Resources.Version, version);
// Set the starting caption
lblStatus.Content = Properties.Resources.SplashStarting;
StatusLabel.Content = Properties.Resources.SplashStarting;
// Build the progress steps
LoadProgressSteps();
// Set the progress bar to the number of steps
progressBar.Maximum = _progressSteps.Count;
ProgressBar.Maximum = _progressSteps.Count;
// Create the worker with progress and cancel
_backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
@@ -97,14 +97,14 @@ namespace FeedCenter
}
// Update the progress bar
progressBar.Value += e.ProgressPercentage;
ProgressBar.Value += e.ProgressPercentage;
// Get the message
var message = (string) e.UserState;
// Update the status label if one was supplied
if (!string.IsNullOrEmpty(message))
lblStatus.Content = message;
StatusLabel.Content = message;
}
private void HandleBackgroundWorkerDoWork(object sender, DoWorkEventArgs e)
@@ -160,7 +160,7 @@ namespace FeedCenter
}
// Move the progress bar to the max just in case
progressBar.Value = progressBar.Maximum;
ProgressBar.Value = ProgressBar.Maximum;
// Close the window
Close();

View File

@@ -1,5 +1,4 @@
using Microsoft.Win32;
using System;
using System;
using System.IO;
using System.Reflection;
using FeedCenter.Properties;
@@ -8,52 +7,6 @@ namespace FeedCenter
{
public static class SystemConfiguration
{
public static void SetDefaultFeedReader()
{
// Get the location of the assembly
var assemblyLocation = Assembly.GetEntryAssembly().Location;
// Open the registry key (creating if needed)
using (var registryKey = Registry.CurrentUser.CreateSubKey("Software\\Classes\\feed", RegistryKeyPermissionCheck.ReadWriteSubTree))
{
if (registryKey == null)
return;
// Write the handler settings
registryKey.SetValue(string.Empty, "URL:Feed Handler");
registryKey.SetValue("URL Protocol", string.Empty);
// Open the icon subkey (creating if needed)
using (var subKey = registryKey.CreateSubKey("DefaultIcon", RegistryKeyPermissionCheck.ReadWriteSubTree))
{
if (subKey != null)
{
// Write the assembly location
subKey.SetValue(string.Empty, assemblyLocation);
// Close the subkey
subKey.Close();
}
}
// Open the subkey for the command (creating if needed)
using (var subKey = registryKey.CreateSubKey("shell\\open\\command", RegistryKeyPermissionCheck.ReadWriteSubTree))
{
if (subKey != null)
{
// Write the assembly location and parameter
subKey.SetValue(string.Empty, $"\"{assemblyLocation}\" %1");
// Close the subkey
subKey.Close();
}
}
// Close the registry key
registryKey.Close();
}
}
private static bool UseDebugPath => Environment.CommandLine.IndexOf("/debugPath", StringComparison.InvariantCultureIgnoreCase) != -1;
public static string DataDirectory => UseDebugPath ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) : UserSettingsPath;

View File

@@ -48,9 +48,6 @@
<setting name="OpenAllSleepInterval" serializeAs="String">
<value>500</value>
</setting>
<setting name="RegisterAsDefaultFeedReader" serializeAs="String">
<value>False</value>
</setting>
<setting name="Browser" serializeAs="String">
<value />
</setting>