mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
More ReSharper suggestions
This commit is contained in:
@@ -88,10 +88,6 @@ namespace FeedCenter
|
|||||||
// Set whether we should auto-start
|
// Set whether we should auto-start
|
||||||
Current.SetStartWithWindows(Settings.Default.StartWithWindows);
|
Current.SetStartWithWindows(Settings.Default.StartWithWindows);
|
||||||
|
|
||||||
// Set whether we should be the default feed reader
|
|
||||||
if (Settings.Default.RegisterAsDefaultFeedReader)
|
|
||||||
SystemConfiguration.SetDefaultFeedReader();
|
|
||||||
|
|
||||||
// Initialize the window
|
// Initialize the window
|
||||||
mainWindow.Initialize();
|
mainWindow.Initialize();
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/FeedCenter;component/Resources/Application.ico"
|
Icon="/FeedCenter;component/Resources/Application.ico"
|
||||||
xmlns:my="clr-namespace:FeedCenter.Properties"
|
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">
|
WindowStyle="ToolWindow">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<DataGrid AutoGenerateColumns="False"
|
<DataGrid AutoGenerateColumns="False"
|
||||||
Name="feedDataGrid"
|
Name="FeedDataGrid"
|
||||||
CanUserReorderColumns="False"
|
CanUserReorderColumns="False"
|
||||||
GridLinesVisibility="None"
|
GridLinesVisibility="None"
|
||||||
SelectionMode="Single"
|
SelectionMode="Single"
|
||||||
@@ -53,36 +53,36 @@
|
|||||||
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
||||||
<LinkControl:LinkControl Name="editFeedButton"
|
<linkControl:LinkControl Name="EditFeedButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleEditFeedButtonClick"
|
Click="HandleEditFeedButtonClick"
|
||||||
Text="{x:Static my:Resources.EditLink}"
|
Text="{x:Static my:Resources.EditLink}"
|
||||||
ToolTip="{x:Static my:Resources.EditFeedButton}">
|
ToolTip="{x:Static my:Resources.EditFeedButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="deleteFeedButton"
|
<linkControl:LinkControl Name="DeleteFeedButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleDeleteFeedButtonClick"
|
Click="HandleDeleteFeedButtonClick"
|
||||||
Text="{x:Static my:Resources.DeleteLink}"
|
Text="{x:Static my:Resources.DeleteLink}"
|
||||||
ToolTip="{x:Static my:Resources.DeleteFeedButton}">
|
ToolTip="{x:Static my:Resources.DeleteFeedButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="refreshCurrent"
|
<linkControl:LinkControl Name="RefreshCurrent"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleRefreshCurrentButtonClick"
|
Click="HandleRefreshCurrentButtonClick"
|
||||||
Text="{x:Static my:Resources.RefreshCurrent}"
|
Text="{x:Static my:Resources.RefreshCurrent}"
|
||||||
ToolTip="{x:Static my:Resources.RefreshCurrent}">
|
ToolTip="{x:Static my:Resources.RefreshCurrent}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="openPage"
|
<linkControl:LinkControl Name="OpenPage"
|
||||||
Margin="6,2,2,2"
|
Margin="6,2,2,2"
|
||||||
Click="HandleOpenPageButtonClick"
|
Click="HandleOpenPageButtonClick"
|
||||||
Text="{x:Static my:Resources.OpenPage}"
|
Text="{x:Static my:Resources.OpenPage}"
|
||||||
ToolTip="{x:Static my:Resources.OpenPage}">
|
ToolTip="{x:Static my:Resources.OpenPage}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="openFeed"
|
<linkControl:LinkControl Name="OpenFeed"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleOpenFeedButtonClick"
|
Click="HandleOpenFeedButtonClick"
|
||||||
Text="{x:Static my:Resources.OpenFeed}"
|
Text="{x:Static my:Resources.OpenFeed}"
|
||||||
ToolTip="{x:Static my:Resources.OpenFeed}">
|
ToolTip="{x:Static my:Resources.OpenFeed}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<Grid DockPanel.Dock="Right"
|
<Grid DockPanel.Dock="Right"
|
||||||
@@ -96,14 +96,12 @@
|
|||||||
<Button Content="{x:Static my:Resources.OkayButton}"
|
<Button Content="{x:Static my:Resources.OkayButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Name="okButton"
|
|
||||||
Width="75"
|
Width="75"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Click="HandleOkayButtonClick" />
|
Click="HandleOkayButtonClick" />
|
||||||
<Button Content="{x:Static my:Resources.CancelButton}"
|
<Button Content="{x:Static my:Resources.CancelButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
Name="cancelButton"
|
|
||||||
Width="75"
|
Width="75"
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
Grid.Column="2" />
|
Grid.Column="2" />
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ namespace FeedCenter
|
|||||||
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
||||||
|
|
||||||
// Bind to the list
|
// Bind to the list
|
||||||
feedDataGrid.ItemsSource = _collectionViewSource.View;
|
FeedDataGrid.ItemsSource = _collectionViewSource.View;
|
||||||
feedDataGrid.SelectedIndex = 0;
|
FeedDataGrid.SelectedIndex = 0;
|
||||||
|
|
||||||
// Set the window owner
|
// Set the window owner
|
||||||
Owner = owner;
|
Owner = owner;
|
||||||
@@ -55,10 +55,10 @@ namespace FeedCenter
|
|||||||
|
|
||||||
private void EditSelectedFeed()
|
private void EditSelectedFeed()
|
||||||
{
|
{
|
||||||
if (feedDataGrid.SelectedItem == null)
|
if (FeedDataGrid.SelectedItem == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var feed = (Feed) feedDataGrid.SelectedItem;
|
var feed = (Feed) FeedDataGrid.SelectedItem;
|
||||||
|
|
||||||
var feedWindow = new FeedWindow();
|
var feedWindow = new FeedWindow();
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ namespace FeedCenter
|
|||||||
|
|
||||||
private void DeleteSelectedFeed()
|
private void DeleteSelectedFeed()
|
||||||
{
|
{
|
||||||
var feed = (Feed) feedDataGrid.SelectedItem;
|
var feed = (Feed) FeedDataGrid.SelectedItem;
|
||||||
|
|
||||||
_database.Feeds.Remove(feed);
|
_database.Feeds.Remove(feed);
|
||||||
|
|
||||||
@@ -76,22 +76,22 @@ namespace FeedCenter
|
|||||||
|
|
||||||
private void SetFeedButtonStates()
|
private void SetFeedButtonStates()
|
||||||
{
|
{
|
||||||
editFeedButton.IsEnabled = (feedDataGrid.SelectedItem != null);
|
EditFeedButton.IsEnabled = (FeedDataGrid.SelectedItem != null);
|
||||||
deleteFeedButton.IsEnabled = (feedDataGrid.SelectedItem != null);
|
DeleteFeedButton.IsEnabled = (FeedDataGrid.SelectedItem != null);
|
||||||
refreshCurrent.IsEnabled = (feedDataGrid.SelectedItem != null);
|
RefreshCurrent.IsEnabled = (FeedDataGrid.SelectedItem != null);
|
||||||
openPage.IsEnabled = (feedDataGrid.SelectedItem != null);
|
OpenPage.IsEnabled = (FeedDataGrid.SelectedItem != null);
|
||||||
openFeed.IsEnabled = (feedDataGrid.SelectedItem != null);
|
OpenFeed.IsEnabled = (FeedDataGrid.SelectedItem != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleOpenPageButtonClick(object sender, RoutedEventArgs e)
|
private void HandleOpenPageButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var feed = (Feed) feedDataGrid.SelectedItem;
|
var feed = (Feed) FeedDataGrid.SelectedItem;
|
||||||
BrowserCommon.OpenLink(feed.Link);
|
BrowserCommon.OpenLink(feed.Link);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleOpenFeedButtonClick(object sender, RoutedEventArgs e)
|
private void HandleOpenFeedButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var feed = (Feed) feedDataGrid.SelectedItem;
|
var feed = (Feed) FeedDataGrid.SelectedItem;
|
||||||
BrowserCommon.OpenLink(feed.Source);
|
BrowserCommon.OpenLink(feed.Source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ namespace FeedCenter
|
|||||||
{
|
{
|
||||||
Mouse.OverrideCursor = Cursors.Wait;
|
Mouse.OverrideCursor = Cursors.Wait;
|
||||||
|
|
||||||
var feed = (Feed) feedDataGrid.SelectedItem;
|
var feed = (Feed) FeedDataGrid.SelectedItem;
|
||||||
feed.Read(_database, true);
|
feed.Read(_database, true);
|
||||||
|
|
||||||
_collectionViewSource.View.Refresh();
|
_collectionViewSource.View.Refresh();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace FeedCenter
|
namespace FeedCenter
|
||||||
@@ -51,19 +50,19 @@ namespace FeedCenter
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessActions(IEnumerable<FeedAction> feedActions)
|
//public void ProcessActions(IEnumerable<FeedAction> feedActions)
|
||||||
{
|
//{
|
||||||
foreach (FeedAction feedAction in feedActions)
|
// foreach (FeedAction feedAction in feedActions)
|
||||||
{
|
// {
|
||||||
switch (feedAction.Field)
|
// switch (feedAction.Field)
|
||||||
{
|
// {
|
||||||
case 1:
|
// case 1:
|
||||||
|
|
||||||
Title = Regex.Replace(Title, feedAction.Search, feedAction.Replace);
|
// Title = Regex.Replace(Title, feedAction.Search, feedAction.Replace);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
xmlns:Windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
|
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
|
||||||
xmlns:Toolbar="clr-namespace:Common.Wpf.Toolbar;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:splitButton="clr-namespace:Common.Wpf.Toolbar.SplitButton;assembly=Common.Wpf"
|
||||||
xmlns:Markup="clr-namespace:Common.Wpf.MarkupExtensions;assembly=Common.Wpf.MarkupExtensions"
|
xmlns:markup="clr-namespace:Common.Wpf.MarkupExtensions;assembly=Common.Wpf.MarkupExtensions"
|
||||||
xmlns:LinkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
|
xmlns:linkControl="clr-namespace:Common.Wpf.LinkControl;assembly=Common.Wpf"
|
||||||
xmlns:HtmlTextBlock="clr-namespace:Common.Wpf.HtmlTextBlock;assembly=Common.Wpf"
|
xmlns:htmlTextBlock="clr-namespace:Common.Wpf.HtmlTextBlock;assembly=Common.Wpf"
|
||||||
xmlns:System="clr-namespace:System;assembly=mscorlib"
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||||
Title="MainWindow"
|
Title="MainWindow"
|
||||||
Height="360"
|
Height="360"
|
||||||
Width="252"
|
Width="252"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
ShowInTaskbar="False">
|
ShowInTaskbar="False">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="{x:Type ToolBar}">
|
<Style TargetType="{x:Type ToolBar}">
|
||||||
<Setter Property="Control.Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="{x:Type ToolBar}">
|
<ControlTemplate TargetType="{x:Type ToolBar}">
|
||||||
<ToolBarPanel IsItemsHost="True"
|
<ToolBarPanel IsItemsHost="True"
|
||||||
@@ -34,45 +34,45 @@
|
|||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Border BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
|
<Border BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Name="windowBorder"
|
Name="WindowBorder"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Background="{x:Static SystemColors.DesktopBrush}">
|
Background="{x:Static SystemColors.DesktopBrush}">
|
||||||
<Grid Name="mainGrid">
|
<Grid Name="MainGrid">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<!-- ReSharper disable UnusedMember.Global -->
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="headerRow" />
|
Name="HeaderRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="newVersionRow" />
|
Name="NewVersionRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="feedRow" />
|
Name="FeedRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="topToolbarRow" />
|
Name="TopToolbarRow" />
|
||||||
<RowDefinition Height="*"
|
<RowDefinition Height="*"
|
||||||
Name="feedListRow" />
|
Name="FeedListRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="progressRow" />
|
Name="ProgressRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="bottomToolbarRow" />
|
Name="BottomToolbarRow" />
|
||||||
<RowDefinition Height="Auto"
|
<RowDefinition Height="Auto"
|
||||||
Name="feedErrorsRow" />
|
Name="FeedErrorsRow" />
|
||||||
|
<!-- ReSharper restore UnusedMember.Global -->
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Height="21"
|
<Grid Height="21"
|
||||||
Name="headerGrid"
|
Grid.Row="{markup:GridRow RowName=HeaderRow}">
|
||||||
Grid.Row="{Markup:GridRow RowName=headerRow}">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="21" />
|
<ColumnDefinition Width="21" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{x:Static Properties:Resources.ApplicationDisplayName}"
|
<Label Content="{x:Static properties:Resources.ApplicationDisplayName}"
|
||||||
Name="headerLabel"
|
Name="HeaderLabel"
|
||||||
Padding="3,0"
|
Padding="3,0"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
MouseLeftButtonDown="HandleHeaderLabelMouseLeftButtonDown"
|
MouseLeftButtonDown="HandleHeaderLabelMouseLeftButtonDown"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Grid.Column="0" />
|
Grid.Column="0" />
|
||||||
<Button Name="closeButton"
|
<Button Width="13"
|
||||||
Width="13"
|
|
||||||
Height="13"
|
Height="13"
|
||||||
Click="HandleCloseButtonClick"
|
Click="HandleCloseButtonClick"
|
||||||
FontFamily="Marlett"
|
FontFamily="Marlett"
|
||||||
@@ -80,25 +80,24 @@
|
|||||||
FontSize="8"
|
FontSize="8"
|
||||||
Grid.Column="1"></Button>
|
Grid.Column="1"></Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<LinkControl:LinkControl Name="newVersionLink"
|
<linkControl:LinkControl Name="NewVersionLink"
|
||||||
Height="21"
|
Height="21"
|
||||||
Grid.Row="{Markup:GridRow newVersionRow}"
|
Grid.Row="{markup:GridRow NewVersionRow}"
|
||||||
Text="{x:Static Properties:Resources.NewVersionLink}"
|
Text="{x:Static properties:Resources.NewVersionLink}"
|
||||||
Background="AntiqueWhite"
|
Background="AntiqueWhite"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Click="HandleNewVersionLinkClick">
|
Click="HandleNewVersionLinkClick">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<Grid Height="21"
|
<Grid Height="21"
|
||||||
Name="feedGrid"
|
Grid.Row="{markup:GridRow RowName=FeedRow}">
|
||||||
Grid.Row="{Markup:GridRow RowName=feedRow}">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="21" />
|
<ColumnDefinition Width="21" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="*Feed Name"
|
<TextBlock Text="*Feed Name"
|
||||||
Name="feedLabel"
|
Name="FeedLabel"
|
||||||
Padding="3,0"
|
Padding="3,0"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
@@ -109,7 +108,7 @@
|
|||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
MouseDown="HandleFeedLabelMouseDown"
|
MouseDown="HandleFeedLabelMouseDown"
|
||||||
Grid.Column="0" />
|
Grid.Column="0" />
|
||||||
<Button Name="feedButton"
|
<Button Name="FeedButton"
|
||||||
Width="13"
|
Width="13"
|
||||||
Height="13"
|
Height="13"
|
||||||
Click="HandleFeedButtonClick"
|
Click="HandleFeedButtonClick"
|
||||||
@@ -118,24 +117,24 @@
|
|||||||
FontSize="8"
|
FontSize="8"
|
||||||
Grid.Column="1" />
|
Grid.Column="1" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<ListBox Name="linkTextList"
|
<ListBox Name="LinkTextList"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
Background="{x:Static SystemColors.DesktopBrush}"
|
Background="{x:Static SystemColors.DesktopBrush}"
|
||||||
MouseUp="HandleLinkTextListMouseUp"
|
MouseUp="HandleLinkTextListMouseUp"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
Grid.Row="{Markup:GridRow RowName=feedListRow}"
|
Grid.Row="{markup:GridRow RowName=FeedListRow}"
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||||
<ListBoxItem Content="Test item" />
|
<ListBoxItem Content="Test item" />
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<HtmlTextBlock:HtmlTextBlock Html="{Binding}"
|
<htmlTextBlock:HtmlTextBlock Html="{Binding}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="0,1" />
|
Margin="0,1" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemContainerStyle>
|
||||||
<Style TargetType="ListBoxItem">
|
<Style TargetType="ListBoxItem">
|
||||||
<Setter Property="Control.Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ListBoxItem">
|
<ControlTemplate TargetType="ListBoxItem">
|
||||||
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
<Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
||||||
@@ -154,7 +153,7 @@
|
|||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="Selector.IsMouseOver">
|
<Trigger Property="Selector.IsMouseOver">
|
||||||
<Trigger.Value>
|
<Trigger.Value>
|
||||||
<System:Boolean>True</System:Boolean>
|
<system:Boolean>True</system:Boolean>
|
||||||
</Trigger.Value>
|
</Trigger.Value>
|
||||||
<Setter Property="Panel.Background"
|
<Setter Property="Panel.Background"
|
||||||
TargetName="Bd">
|
TargetName="Bd">
|
||||||
@@ -177,110 +176,108 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
<EventSetter Event="MouseDoubleClick"
|
<EventSetter Event="MouseDoubleClick"
|
||||||
Handler="HandleLinkTextListListItemMouseDoubleClick" />
|
Handler="HandleItemMouseDoubleClick" />
|
||||||
<EventSetter Event="MouseUp"
|
<EventSetter Event="MouseUp"
|
||||||
Handler="HandleLinkTextListListItemMouseUp" />
|
Handler="HandleItemMouseUp" />
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</ListBox.ItemContainerStyle>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
<ProgressBar Name="feedReadProgress"
|
<ProgressBar Name="FeedReadProgress"
|
||||||
Height="15"
|
Height="15"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Grid.Row="{Markup:GridRow RowName=progressRow}" />
|
Grid.Row="{markup:GridRow RowName=ProgressRow}" />
|
||||||
<ToolBarTray Name="navigationToolbarTray"
|
<ToolBarTray Name="NavigationToolbarTray"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Grid.Row="{Markup:GridRow RowName=bottomToolbarRow}">
|
Grid.Row="{markup:GridRow RowName=BottomToolbarRow}">
|
||||||
<ToolBar Name="navigationToolbar"
|
<ToolBar ToolBarTray.IsLocked="True"
|
||||||
ToolBarTray.IsLocked="True"
|
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ToolBar.OverflowMode="Never">
|
ToolBar.OverflowMode="Never">
|
||||||
<Toolbar:ImageButton Height="20"
|
<toolbar:ImageButton Height="20"
|
||||||
Width="20"
|
Width="20"
|
||||||
Name="previousToolbarButton"
|
Name="PreviousToolbarButton"
|
||||||
Click="HandlePreviousToolbarButtonClick"
|
Click="HandlePreviousToolbarButtonClick"
|
||||||
ToolTip="{x:Static Properties:Resources.previousToolbarButton}"
|
ToolTip="{x:Static properties:Resources.previousToolbarButton}"
|
||||||
ImageSource="Resources/Left.ico" />
|
ImageSource="Resources/Left.ico" />
|
||||||
<Toolbar:ImageButton Height="20"
|
<toolbar:ImageButton Height="20"
|
||||||
Width="20"
|
Width="20"
|
||||||
Name="nextToolbarButton"
|
Name="NextToolbarButton"
|
||||||
Click="HandleNextToolbarButtonClick"
|
Click="HandleNextToolbarButtonClick"
|
||||||
ToolTip="{x:Static Properties:Resources.nextToolbarButton}"
|
ToolTip="{x:Static properties:Resources.nextToolbarButton}"
|
||||||
ImageSource="Resources/Right.ico" />
|
ImageSource="Resources/Right.ico" />
|
||||||
<SplitButton:SplitButton Name="refreshToolbarButton"
|
<splitButton:SplitButton Name="RefreshToolbarButton"
|
||||||
Image="Resources/Rss-Download.ico"
|
Image="Resources/Rss-Download.ico"
|
||||||
ToolTip="{x:Static Properties:Resources.refreshAllToolbarButton}"
|
ToolTip="{x:Static properties:Resources.refreshAllToolbarButton}"
|
||||||
Height="20"
|
Height="20"
|
||||||
MinWidth="35"
|
MinWidth="35"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
Click="HandleRefreshToolbarButtonClick">
|
Click="HandleRefreshToolbarButtonClick">
|
||||||
<SplitButton:SplitButton.DropDownContextMenu>
|
<splitButton:SplitButton.DropDownContextMenu>
|
||||||
<ContextMenu MenuItem.Click="HandleRefreshMenuItemClick">
|
<ContextMenu MenuItem.Click="HandleRefreshMenuItemClick">
|
||||||
<MenuItem Name="menuRefreshAll"
|
<MenuItem Name="MenuRefreshAll"
|
||||||
Header="{x:Static Properties:Resources.refreshAllToolbarButton}" />
|
Header="{x:Static properties:Resources.refreshAllToolbarButton}" />
|
||||||
<MenuItem Name="menuRefresh"
|
<MenuItem Name="MenuRefresh"
|
||||||
Header="{x:Static Properties:Resources.refreshToolbarButton}" />
|
Header="{x:Static properties:Resources.refreshToolbarButton}" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</SplitButton:SplitButton.DropDownContextMenu>
|
</splitButton:SplitButton.DropDownContextMenu>
|
||||||
</SplitButton:SplitButton>
|
</splitButton:SplitButton>
|
||||||
<SplitButton:SplitButton Name="openAllToolbarButton"
|
<splitButton:SplitButton Name="OpenAllToolbarButton"
|
||||||
Image="Resources/News.ico"
|
Image="Resources/News.ico"
|
||||||
ToolTip="{x:Static Properties:Resources.openAllMultipleToolbarButton}"
|
ToolTip="{x:Static properties:Resources.openAllMultipleToolbarButton}"
|
||||||
Height="20"
|
Height="20"
|
||||||
MinWidth="35"
|
MinWidth="35"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
Click="HandleOpenAllToolbarButtonClick">
|
Click="HandleOpenAllToolbarButtonClick">
|
||||||
<SplitButton:SplitButton.DropDownContextMenu>
|
<splitButton:SplitButton.DropDownContextMenu>
|
||||||
<ContextMenu MenuItem.Click="HandleOpenAllMenuItemClick">
|
<ContextMenu MenuItem.Click="HandleOpenAllMenuItemClick">
|
||||||
<MenuItem Name="menuOpenAllMultiplePages"
|
<MenuItem Name="MenuOpenAllMultiplePages"
|
||||||
Header="{x:Static Properties:Resources.openAllMultipleToolbarButton}" />
|
Header="{x:Static properties:Resources.openAllMultipleToolbarButton}" />
|
||||||
<MenuItem Name="menuOpenAllSinglePage"
|
<MenuItem Name="MenuOpenAllSinglePage"
|
||||||
Header="{x:Static Properties:Resources.openAllSingleToolbarButton}" />
|
Header="{x:Static properties:Resources.openAllSingleToolbarButton}" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</SplitButton:SplitButton.DropDownContextMenu>
|
</splitButton:SplitButton.DropDownContextMenu>
|
||||||
</SplitButton:SplitButton>
|
</splitButton:SplitButton>
|
||||||
<Toolbar:ImageButton Height="20"
|
<toolbar:ImageButton Height="20"
|
||||||
Width="20"
|
Width="20"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
Name="markReadToolbarButton"
|
Name="MarkReadToolbarButton"
|
||||||
Click="HandleMarkReadToolbarButtonClick"
|
Click="HandleMarkReadToolbarButtonClick"
|
||||||
ToolTip="{x:Static Properties:Resources.markReadToolbarButton}"
|
ToolTip="{x:Static properties:Resources.markReadToolbarButton}"
|
||||||
ImageSource="Resources/Comments-edit.ico" />
|
ImageSource="Resources/Comments-edit.ico" />
|
||||||
<SplitButton:SplitButton Height="20"
|
<splitButton:SplitButton Height="20"
|
||||||
MinWidth="35"
|
MinWidth="35"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
Name="optionsToolbarButton"
|
|
||||||
Click="HandleOptionsToolbarButtonClick"
|
Click="HandleOptionsToolbarButtonClick"
|
||||||
ToolTip="{x:Static Properties:Resources.optionsToolbarButton}"
|
ToolTip="{x:Static properties:Resources.optionsToolbarButton}"
|
||||||
Image="Resources/Compile.ico">
|
Image="Resources/Compile.ico">
|
||||||
<SplitButton:SplitButton.DropDownContextMenu>
|
<splitButton:SplitButton.DropDownContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="{x:Static Properties:Resources.lockWindowCheckBox}"
|
<MenuItem Header="{x:Static properties:Resources.lockWindowCheckBox}"
|
||||||
IsCheckable="True"
|
IsCheckable="True"
|
||||||
IsChecked="{Binding Source={x:Static Properties:Settings.Default}, Path=WindowLocked}" />
|
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=WindowLocked}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="{x:Static Properties:Resources.CurrentFeed}">
|
<MenuItem Header="{x:Static properties:Resources.CurrentFeed}">
|
||||||
<MenuItem Header="{x:Static Properties:Resources.EditMenu}"
|
<MenuItem Header="{x:Static properties:Resources.EditMenu}"
|
||||||
Click="HandleEditCurrentFeedMenuItemClick" />
|
Click="HandleEditCurrentFeedMenuItemClick" />
|
||||||
<MenuItem Header="{x:Static Properties:Resources.DeleteMenu}"
|
<MenuItem Header="{x:Static properties:Resources.DeleteMenu}"
|
||||||
Click="HandleDeleteCurrentFeedMenuItemClick" />
|
Click="HandleDeleteCurrentFeedMenuItemClick" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</SplitButton:SplitButton.DropDownContextMenu>
|
</splitButton:SplitButton.DropDownContextMenu>
|
||||||
</SplitButton:SplitButton>
|
</splitButton:SplitButton>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
<LinkControl:LinkControl Name="feedErrorsLink"
|
<linkControl:LinkControl Name="FeedErrorsLink"
|
||||||
Height="21"
|
Height="21"
|
||||||
Grid.Row="{Markup:GridRow feedErrorsRow}"
|
Grid.Row="{markup:GridRow FeedErrorsRow}"
|
||||||
Text="{x:Static Properties:Resources.FeedErrorsLink}"
|
Text="{x:Static properties:Resources.FeedErrorsLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.showErrorsToolbarButton}"
|
ToolTip="{x:Static properties:Resources.showErrorsToolbarButton}"
|
||||||
Background="AntiqueWhite"
|
Background="AntiqueWhite"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Click="HandleShowErrorsButtonClick">
|
Click="HandleShowErrorsButtonClick">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Windows:SnappingWindow>
|
</windows:SnappingWindow>
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ namespace FeedCenter
|
|||||||
LoadWindowSettings();
|
LoadWindowSettings();
|
||||||
|
|
||||||
// Set the foreground color to something that can be seen
|
// Set the foreground color to something that can be seen
|
||||||
linkTextList.Foreground = (System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5) ? Brushes.White : Brushes.Black;
|
LinkTextList.Foreground = (System.Drawing.SystemColors.Desktop.GetBrightness() < 0.5) ? Brushes.White : Brushes.Black;
|
||||||
headerLabel.Foreground = linkTextList.Foreground;
|
HeaderLabel.Foreground = LinkTextList.Foreground;
|
||||||
|
|
||||||
// Create the background worker that does the actual reading
|
// Create the background worker that does the actual reading
|
||||||
_feedReadWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
|
_feedReadWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
|
||||||
@@ -112,7 +112,7 @@ namespace FeedCenter
|
|||||||
|
|
||||||
// Show the link if updates are available
|
// Show the link if updates are available
|
||||||
if (UpdateCheck.UpdateAvailable)
|
if (UpdateCheck.UpdateAvailable)
|
||||||
newVersionLink.Visibility = Visibility.Visible;
|
NewVersionLink.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
Tracer.WriteLine("MainForm creation finished");
|
Tracer.WriteLine("MainForm creation finished");
|
||||||
}
|
}
|
||||||
@@ -192,11 +192,11 @@ namespace FeedCenter
|
|||||||
switch (Settings.Default.ToolbarLocation)
|
switch (Settings.Default.ToolbarLocation)
|
||||||
{
|
{
|
||||||
case Dock.Top:
|
case Dock.Top:
|
||||||
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(topToolbarRow));
|
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(TopToolbarRow));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Dock.Bottom:
|
case Dock.Bottom:
|
||||||
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(bottomToolbarRow));
|
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(BottomToolbarRow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,10 +229,10 @@ namespace FeedCenter
|
|||||||
switch (Settings.Default.ToolbarLocation)
|
switch (Settings.Default.ToolbarLocation)
|
||||||
{
|
{
|
||||||
case Dock.Top:
|
case Dock.Top:
|
||||||
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(topToolbarRow));
|
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(TopToolbarRow));
|
||||||
break;
|
break;
|
||||||
case Dock.Bottom:
|
case Dock.Bottom:
|
||||||
Grid.SetRow(navigationToolbarTray, mainGrid.GetRowIndex(bottomToolbarRow));
|
Grid.SetRow(NavigationToolbarTray, MainGrid.GetRowIndex(BottomToolbarRow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ namespace FeedCenter
|
|||||||
Settings.Default.WindowSize = new Size(Width, Height);
|
Settings.Default.WindowSize = new Size(Width, Height);
|
||||||
|
|
||||||
// Save the dock on the navigation tray
|
// 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
|
// Save settings
|
||||||
Settings.Default.Save();
|
Settings.Default.Save();
|
||||||
@@ -261,7 +261,7 @@ namespace FeedCenter
|
|||||||
ResizeMode = Settings.Default.WindowLocked ? ResizeMode.NoResize : ResizeMode.CanResize;
|
ResizeMode = Settings.Default.WindowLocked ? ResizeMode.NoResize : ResizeMode.CanResize;
|
||||||
|
|
||||||
// Show or hide the border
|
// 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
|
// Update the borders
|
||||||
UpdateBorder();
|
UpdateBorder();
|
||||||
@@ -324,7 +324,7 @@ namespace FeedCenter
|
|||||||
StopTimer();
|
StopTimer();
|
||||||
|
|
||||||
// Move to the next feed if the scroll interval has expired and the mouse isn't hovering
|
// 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;
|
_lastFeedDisplay = DateTime.Now;
|
||||||
else if (DateTime.Now - _lastFeedDisplay >= Settings.Default.FeedScrollInterval)
|
else if (DateTime.Now - _lastFeedDisplay >= Settings.Default.FeedScrollInterval)
|
||||||
NextFeed();
|
NextFeed();
|
||||||
@@ -347,14 +347,14 @@ namespace FeedCenter
|
|||||||
var feedCount = _database.Feeds.Count();
|
var feedCount = _database.Feeds.Count();
|
||||||
|
|
||||||
// Set button states
|
// Set button states
|
||||||
previousToolbarButton.IsEnabled = (feedCount > 1);
|
PreviousToolbarButton.IsEnabled = (feedCount > 1);
|
||||||
nextToolbarButton.IsEnabled = (feedCount > 1);
|
NextToolbarButton.IsEnabled = (feedCount > 1);
|
||||||
refreshToolbarButton.IsEnabled = (feedCount > 0);
|
RefreshToolbarButton.IsEnabled = (feedCount > 0);
|
||||||
feedButton.IsEnabled = (feedCount > 0);
|
FeedButton.IsEnabled = (feedCount > 0);
|
||||||
openAllToolbarButton.IsEnabled = (feedCount > 0);
|
OpenAllToolbarButton.IsEnabled = (feedCount > 0);
|
||||||
markReadToolbarButton.IsEnabled = (feedCount > 0);
|
MarkReadToolbarButton.IsEnabled = (feedCount > 0);
|
||||||
feedLabel.Visibility = (feedCount == 0 ? Visibility.Hidden : Visibility.Visible);
|
FeedLabel.Visibility = (feedCount == 0 ? Visibility.Hidden : Visibility.Visible);
|
||||||
feedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
|
FeedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeFeed()
|
private void InitializeFeed()
|
||||||
@@ -365,7 +365,7 @@ namespace FeedCenter
|
|||||||
var feedCount = _database.Feeds.Count();
|
var feedCount = _database.Feeds.Count();
|
||||||
|
|
||||||
// Clear the link list
|
// Clear the link list
|
||||||
linkTextList.Items.Clear();
|
LinkTextList.Items.Clear();
|
||||||
|
|
||||||
// Reset the feed index
|
// Reset the feed index
|
||||||
_feedIndex = -1;
|
_feedIndex = -1;
|
||||||
@@ -518,10 +518,10 @@ namespace FeedCenter
|
|||||||
switch (multipleOpenAction)
|
switch (multipleOpenAction)
|
||||||
{
|
{
|
||||||
case MultipleOpenAction.IndividualPages:
|
case MultipleOpenAction.IndividualPages:
|
||||||
openAllToolbarButton.ToolTip = Properties.Resources.openAllMultipleToolbarButton;
|
OpenAllToolbarButton.ToolTip = Properties.Resources.openAllMultipleToolbarButton;
|
||||||
break;
|
break;
|
||||||
case MultipleOpenAction.SinglePage:
|
case MultipleOpenAction.SinglePage:
|
||||||
openAllToolbarButton.ToolTip = Properties.Resources.openAllSingleToolbarButton;
|
OpenAllToolbarButton.ToolTip = Properties.Resources.openAllSingleToolbarButton;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -531,19 +531,19 @@ namespace FeedCenter
|
|||||||
// Just clear the display if we have no feed
|
// Just clear the display if we have no feed
|
||||||
if (_currentFeed == null)
|
if (_currentFeed == null)
|
||||||
{
|
{
|
||||||
feedLabel.Text = string.Empty;
|
FeedLabel.Text = string.Empty;
|
||||||
feedButton.Visibility = Visibility.Hidden;
|
FeedButton.Visibility = Visibility.Hidden;
|
||||||
linkTextList.Items.Clear();
|
LinkTextList.Items.Clear();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the header to the feed title
|
// 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 = _database.Feeds.Count() > 1 ? Visibility.Visible : Visibility.Hidden;
|
FeedButton.Visibility = _database.Feeds.Count() > 1 ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
|
||||||
// Clear the current list
|
// Clear the current list
|
||||||
linkTextList.Items.Clear();
|
LinkTextList.Items.Clear();
|
||||||
|
|
||||||
// Sort the items by sequence
|
// Sort the items by sequence
|
||||||
var sortedItems = _currentFeed.Items.Where(item => !item.BeenRead).OrderBy(item => item.Sequence);
|
var sortedItems = _currentFeed.Items.Where(item => !item.BeenRead).OrderBy(item => item.Sequence);
|
||||||
@@ -552,7 +552,7 @@ namespace FeedCenter
|
|||||||
foreach (var feedItem in sortedItems)
|
foreach (var feedItem in sortedItems)
|
||||||
{
|
{
|
||||||
// Add the list item
|
// Add the list item
|
||||||
linkTextList.Items.Add(feedItem);
|
LinkTextList.Items.Add(feedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateOpenAllButton();
|
UpdateOpenAllButton();
|
||||||
@@ -561,14 +561,14 @@ namespace FeedCenter
|
|||||||
private void MarkAllItemsAsRead()
|
private void MarkAllItemsAsRead()
|
||||||
{
|
{
|
||||||
// Loop over all items and mark them as read
|
// Loop over all items and mark them as read
|
||||||
foreach (FeedItem feedItem in linkTextList.Items)
|
foreach (FeedItem feedItem in LinkTextList.Items)
|
||||||
feedItem.BeenRead = true;
|
feedItem.BeenRead = true;
|
||||||
|
|
||||||
// Save the changes
|
// Save the changes
|
||||||
_database.SaveChanges();
|
_database.SaveChanges();
|
||||||
|
|
||||||
// Clear the list
|
// Clear the list
|
||||||
linkTextList.Items.Clear();
|
LinkTextList.Items.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -586,13 +586,13 @@ namespace FeedCenter
|
|||||||
// Reset the progress bar if we need it
|
// Reset the progress bar if we need it
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
feedReadProgress.Value = 0;
|
FeedReadProgress.Value = 0;
|
||||||
feedReadProgress.Maximum = feedCount + 2;
|
FeedReadProgress.Maximum = feedCount + 2;
|
||||||
feedReadProgress.Visibility = Visibility.Visible;
|
FeedReadProgress.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
feedReadProgress.Visibility = Visibility.Collapsed;
|
FeedReadProgress.Visibility = Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ namespace FeedCenter
|
|||||||
private void HandleFeedReadWorkerProgressChanged(object sender, ProgressChangedEventArgs e)
|
private void HandleFeedReadWorkerProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||||
{
|
{
|
||||||
// Set progress
|
// Set progress
|
||||||
feedReadProgress.Value = e.ProgressPercentage;
|
FeedReadProgress.Value = e.ProgressPercentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleFeedReadWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
private void HandleFeedReadWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||||
@@ -661,7 +661,7 @@ namespace FeedCenter
|
|||||||
|
|
||||||
// Check for update
|
// Check for update
|
||||||
if (UpdateCheck.UpdateAvailable)
|
if (UpdateCheck.UpdateAvailable)
|
||||||
newVersionLink.Visibility = Visibility.Visible;
|
NewVersionLink.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
UpdateErrorLink();
|
UpdateErrorLink();
|
||||||
}
|
}
|
||||||
@@ -671,10 +671,10 @@ namespace FeedCenter
|
|||||||
var feedErrorCount = _database.Feeds.Count(f => f.LastReadResult != FeedReadResult.Success);
|
var feedErrorCount = _database.Feeds.Count(f => f.LastReadResult != FeedReadResult.Success);
|
||||||
|
|
||||||
// Set the visibility of the error link
|
// 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
|
// Set the text to match the number of errors
|
||||||
feedErrorsLink.Text = feedErrorCount == 1
|
FeedErrorsLink.Text = feedErrorCount == 1
|
||||||
? Properties.Resources.FeedErrorLink
|
? Properties.Resources.FeedErrorLink
|
||||||
: string.Format(Properties.Resources.FeedErrorsLink, feedErrorCount);
|
: 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
|
// Only handle the middle button
|
||||||
if (e.ChangedButton != MouseButton.Middle)
|
if (e.ChangedButton != MouseButton.Middle)
|
||||||
@@ -937,14 +937,14 @@ namespace FeedCenter
|
|||||||
feedItem.New = false;
|
feedItem.New = false;
|
||||||
|
|
||||||
// Remove the item from the list
|
// Remove the item from the list
|
||||||
linkTextList.Items.Remove(feedItem);
|
LinkTextList.Items.Remove(feedItem);
|
||||||
|
|
||||||
// Save the changes
|
// Save the changes
|
||||||
_database.SaveChanges();
|
_database.SaveChanges();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleLinkTextListListItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
private void HandleItemMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
// Get the feed item
|
// Get the feed item
|
||||||
var feedItem = (FeedItem) ((ListBoxItem) sender).DataContext;
|
var feedItem = (FeedItem) ((ListBoxItem) sender).DataContext;
|
||||||
@@ -957,7 +957,7 @@ namespace FeedCenter
|
|||||||
feedItem.New = false;
|
feedItem.New = false;
|
||||||
|
|
||||||
// Remove the item from the list
|
// Remove the item from the list
|
||||||
linkTextList.Items.Remove(feedItem);
|
LinkTextList.Items.Remove(feedItem);
|
||||||
|
|
||||||
// Save the changes
|
// Save the changes
|
||||||
_database.SaveChanges();
|
_database.SaveChanges();
|
||||||
@@ -1067,7 +1067,7 @@ namespace FeedCenter
|
|||||||
if (rectangle.Bottom != screen.WorkingArea.Bottom)
|
if (rectangle.Bottom != screen.WorkingArea.Bottom)
|
||||||
borderThickness.Bottom = 1;
|
borderThickness.Bottom = 1;
|
||||||
|
|
||||||
windowBorder.BorderThickness = borderThickness;
|
WindowBorder.BorderThickness = borderThickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DelayedMethod _windowStateDelay;
|
private DelayedMethod _windowStateDelay;
|
||||||
@@ -1125,7 +1125,7 @@ namespace FeedCenter
|
|||||||
private void OpenAllFeedItemsIndividually()
|
private void OpenAllFeedItemsIndividually()
|
||||||
{
|
{
|
||||||
// Create a new list of feed items
|
// 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
|
// Get the browser
|
||||||
var browser = BrowserCommon.FindBrowser(Settings.Default.Browser);
|
var browser = BrowserCommon.FindBrowser(Settings.Default.Browser);
|
||||||
@@ -1146,7 +1146,7 @@ namespace FeedCenter
|
|||||||
feedItem.BeenRead = true;
|
feedItem.BeenRead = true;
|
||||||
|
|
||||||
// Remove the item
|
// Remove the item
|
||||||
linkTextList.Items.Remove(feedItem);
|
LinkTextList.Items.Remove(feedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait a little bit
|
// Wait a little bit
|
||||||
@@ -1209,9 +1209,9 @@ namespace FeedCenter
|
|||||||
{
|
{
|
||||||
var menuItem = (MenuItem) e.Source;
|
var menuItem = (MenuItem) e.Source;
|
||||||
|
|
||||||
if (Equals(menuItem, menuRefresh))
|
if (Equals(menuItem, MenuRefresh))
|
||||||
ReadCurrentFeed(true);
|
ReadCurrentFeed(true);
|
||||||
else if (Equals(menuItem, menuRefreshAll))
|
else if (Equals(menuItem, MenuRefreshAll))
|
||||||
ReadFeeds(true);
|
ReadFeeds(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1224,9 +1224,9 @@ namespace FeedCenter
|
|||||||
{
|
{
|
||||||
var menuItem = (MenuItem) e.Source;
|
var menuItem = (MenuItem) e.Source;
|
||||||
|
|
||||||
if (Equals(menuItem, menuOpenAllSinglePage))
|
if (Equals(menuItem, MenuOpenAllSinglePage))
|
||||||
OpenAllFeedItemsOnSinglePage();
|
OpenAllFeedItemsOnSinglePage();
|
||||||
else if (Equals(menuItem, menuOpenAllMultiplePages))
|
else if (Equals(menuItem, MenuOpenAllMultiplePages))
|
||||||
OpenAllFeedItemsIndividually();
|
OpenAllFeedItemsIndividually();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:Options="clr-namespace:FeedCenter.Options"
|
xmlns:options="clr-namespace:FeedCenter.Options"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
d:DesignWidth="300">
|
d:DesignWidth="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock Text="Label"
|
<TextBlock Text="Label"
|
||||||
Name="applicationNameLabel"
|
Name="ApplicationNameLabel"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold" />
|
FontWeight="Bold" />
|
||||||
<TextBlock Text="Label"
|
<TextBlock Text="Label"
|
||||||
Margin="0,22,0,0"
|
Margin="0,22,0,0"
|
||||||
Name="versionLabel"
|
Name="VersionLabel"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<TextBlock Text="Label"
|
<TextBlock Text="Label"
|
||||||
Margin="0,44,0,0"
|
Margin="0,44,0,0"
|
||||||
Name="companyLabel"
|
Name="CompanyLabel"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
base.LoadPanel(database);
|
base.LoadPanel(database);
|
||||||
|
|
||||||
applicationNameLabel.Text = Properties.Resources.ApplicationDisplayName;
|
ApplicationNameLabel.Text = Properties.Resources.ApplicationDisplayName;
|
||||||
|
|
||||||
string version = UpdateCheck.LocalVersion.ToString();
|
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()
|
public override bool ValidatePanel()
|
||||||
@@ -31,9 +31,6 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryAbout;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryAbout; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,11 @@
|
|||||||
Height="300"
|
Height="300"
|
||||||
Width="500"
|
Width="500"
|
||||||
xmlns:my="clr-namespace:FeedCenter.Properties"
|
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"
|
xmlns:feedCenter="clr-namespace:FeedCenter"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/FeedCenter;component/Resources/Application.ico"
|
Icon="/FeedCenter;component/Resources/Application.ico"
|
||||||
FocusManager.FocusedElement="{Binding ElementName=feedLinkFilterText}">
|
FocusManager.FocusedElement="{Binding ElementName=FeedLinkFilterText}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -23,17 +22,18 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Label Content="{x:Static my:Resources.FeedLinkFilterLabel}"
|
<Label Content="{x:Static my:Resources.FeedLinkFilterLabel}"
|
||||||
Name="feedLinkFilterLabel"
|
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Target="{Binding ElementName=feedLinkFilterText}" />
|
Target="{Binding ElementName=FeedLinkFilterText}" />
|
||||||
<TextBox Grid.Column="1"
|
<TextBox Grid.Row="0"
|
||||||
Name="feedLinkFilterText"
|
Grid.Column="1"
|
||||||
|
Name="FeedLinkFilterText"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
TextChanged="HandleFilterTextChanged" />
|
TextChanged="HandleFilterTextChanged" />
|
||||||
<Border Grid.Row="1"
|
<Border Grid.Row="1"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<ItemsControl Name="filteredFeedsList">
|
<ItemsControl Name="FilteredFeedsList">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<CheckBox Margin="2"
|
<CheckBox Margin="2"
|
||||||
@@ -61,27 +61,28 @@
|
|||||||
<TextBlock Margin="2"
|
<TextBlock Margin="2"
|
||||||
Text="{x:Static my:Resources.SelectLabel}">
|
Text="{x:Static my:Resources.SelectLabel}">
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<LinkControl:LinkControl Margin="2"
|
<linkControl:LinkControl Margin="2"
|
||||||
Click="HandleSelectAll"
|
Click="HandleSelectAll"
|
||||||
Text="{x:Static my:Resources.SelectAllLabel}">
|
Text="{x:Static my:Resources.SelectAllLabel}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Margin="2"
|
<linkControl:LinkControl Margin="2"
|
||||||
Click="HandleSelectNone"
|
Click="HandleSelectNone"
|
||||||
Text="{x:Static my:Resources.SelectNoneLabel}">
|
Text="{x:Static my:Resources.SelectNoneLabel}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Margin="2"
|
<linkControl:LinkControl Margin="2"
|
||||||
Click="HandleSelectInvert"
|
Click="HandleSelectInvert"
|
||||||
Text="{x:Static my:Resources.SelectInvertLabel}">
|
Text="{x:Static my:Resources.SelectInvertLabel}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<Grid Grid.Row="2"
|
<Grid Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
MouseRightButtonUp="HandleGridMouseRightButtonUp"
|
MouseRightButtonUp="HandleGridMouseRightButtonUp"
|
||||||
ToolTip="{x:Static my:Resources.EnableHint}">
|
ToolTip="{x:Static my:Resources.EnableHint}">
|
||||||
<Label Content="{x:Static my:Resources.openLabel}"
|
<Label Content="{x:Static my:Resources.openLabel}"
|
||||||
Name="openLabel"
|
Name="OpenLabel"
|
||||||
Padding="4,0,0,0"
|
Padding="4,0,0,0"
|
||||||
Margin="6,8,6,6"
|
Margin="6,8,6,6"
|
||||||
ToolTip="{x:Static my:Resources.DisableHint}"
|
ToolTip="{x:Static my:Resources.DisableHint}"
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
MouseRightButtonUp="HandleGridMouseRightButtonUp"
|
MouseRightButtonUp="HandleGridMouseRightButtonUp"
|
||||||
ToolTip="{x:Static my:Resources.EnableHint}">
|
ToolTip="{x:Static my:Resources.EnableHint}">
|
||||||
<ComboBox Name="openComboBox"
|
<ComboBox Name="OpenComboBox"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
SelectedIndex="0"
|
SelectedIndex="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
@@ -108,7 +109,6 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Margin="0,6,87,6"
|
Margin="0,6,87,6"
|
||||||
Name="okButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
@@ -120,7 +120,6 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
Margin="0,6,6,6"
|
Margin="0,6,6,6"
|
||||||
Name="cancelButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
Grid.Row="3" />
|
Grid.Row="3" />
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace FeedCenter.Options
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool? Display(Window window, FeedCenterEntities database)
|
public void Display(Window window, FeedCenterEntities database)
|
||||||
{
|
{
|
||||||
_checkedListBoxItems = new List<CheckedListItem<Feed>>();
|
_checkedListBoxItems = new List<CheckedListItem<Feed>>();
|
||||||
|
|
||||||
@@ -29,11 +29,11 @@ namespace FeedCenter.Options
|
|||||||
_collectionViewSource.SortDescriptions.Add(new SortDescription("Item.Name", ListSortDirection.Ascending));
|
_collectionViewSource.SortDescriptions.Add(new SortDescription("Item.Name", ListSortDirection.Ascending));
|
||||||
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
|
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
|
||||||
|
|
||||||
filteredFeedsList.ItemsSource = _collectionViewSource.View;
|
FilteredFeedsList.ItemsSource = _collectionViewSource.View;
|
||||||
|
|
||||||
Owner = window;
|
Owner = window;
|
||||||
|
|
||||||
return ShowDialog();
|
ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
|
void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
|
||||||
@@ -42,7 +42,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
var feed = checkedListBoxItem.Item;
|
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)
|
private void HandleFilterTextChanged(object sender, TextChangedEventArgs e)
|
||||||
@@ -54,8 +54,8 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
foreach (var item in _checkedListBoxItems.Where(i => i.IsChecked))
|
foreach (var item in _checkedListBoxItems.Where(i => i.IsChecked))
|
||||||
{
|
{
|
||||||
if (openComboBox.IsEnabled)
|
if (OpenComboBox.IsEnabled)
|
||||||
item.Item.MultipleOpenAction = (MultipleOpenAction) ((ComboBoxItem) openComboBox.SelectedItem).Tag;
|
item.Item.MultipleOpenAction = (MultipleOpenAction) ((ComboBoxItem) OpenComboBox.SelectedItem).Tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogResult = true;
|
DialogResult = true;
|
||||||
@@ -94,8 +94,8 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void HandleGridMouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
private void HandleGridMouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
openLabel.IsEnabled = !openLabel.IsEnabled;
|
OpenLabel.IsEnabled = !OpenLabel.IsEnabled;
|
||||||
openComboBox.IsEnabled = !openComboBox.IsEnabled;
|
OpenComboBox.IsEnabled = !OpenComboBox.IsEnabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
<Window x:Class="FeedCenter.Options.CategoryWindow"
|
<Window x:Class="FeedCenter.Options.CategoryWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
Title="CategoryWindow"
|
Title="CategoryWindow"
|
||||||
Height="119"
|
Height="119"
|
||||||
Width="339"
|
Width="339"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/FeedCenter;component/Resources/Application.ico"
|
Icon="/FeedCenter;component/Resources/Application.ico"
|
||||||
FocusManager.FocusedElement="{Binding ElementName=nameTextBox}" >
|
FocusManager.FocusedElement="{Binding ElementName=NameTextBox}">
|
||||||
<Grid Name="mainGrid">
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="367*" />
|
<ColumnDefinition Width="367*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{x:Static Properties:Resources.feedCategoryLabel}"
|
<Label Content="{x:Static properties:Resources.feedCategoryLabel}"
|
||||||
HorizontalAlignment="Left" Name="urlLabel"
|
HorizontalAlignment="Left"
|
||||||
Target="{Binding ElementName=nameTextBox}"
|
Target="{Binding ElementName=NameTextBox}"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Margin="12,12,0,0" />
|
Margin="12,12,0,0" />
|
||||||
<TextBox Margin="7,14,12,0"
|
<TextBox Margin="7,14,12,0"
|
||||||
Name="nameTextBox"
|
Name="NameTextBox"
|
||||||
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Grid.Column="1" />
|
Grid.Column="1" />
|
||||||
<Button Content="{x:Static Properties:Resources.OkayButton}"
|
<Button Content="{x:Static properties:Resources.OkayButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Name="okButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Margin="0,0,93,12"
|
Margin="0,0,93,12"
|
||||||
Click="HandleOkayButtonClick" Grid.Column="1" />
|
Click="HandleOkayButtonClick"
|
||||||
<Button Content="{x:Static Properties:Resources.CancelButton}"
|
Grid.Column="1" />
|
||||||
|
<Button Content="{x:Static properties:Resources.CancelButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Name="cancelButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
Margin="0,0,12,12" Grid.Column="1" />
|
Margin="0,0,12,12"
|
||||||
|
Grid.Column="1" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:Options="clr-namespace:FeedCenter.Options"
|
xmlns:options="clr-namespace:FeedCenter.Options"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
d:DesignWidth="300">
|
d:DesignWidth="300">
|
||||||
@@ -13,52 +13,55 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox Content="{x:Static Properties:Resources.lockWindowCheckBox}"
|
<CheckBox Content="{x:Static properties:Resources.lockWindowCheckBox}"
|
||||||
Height="16"
|
Height="16"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Name="lockWindowCheckBox"
|
Name="LockWindowCheckBox"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="300"
|
Width="300"
|
||||||
Grid.ColumnSpan="2" />
|
Grid.ColumnSpan="2" />
|
||||||
<CheckBox Content="{x:Static Properties:Resources.displayEmptyFeedsCheckBox}"
|
<CheckBox Content="{x:Static properties:Resources.displayEmptyFeedsCheckBox}"
|
||||||
Height="16"
|
Height="16"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,22,0,0"
|
Margin="0,22,0,0"
|
||||||
Name="displayEmptyFeedsCheckBox"
|
Name="DisplayEmptyFeedsCheckBox"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="300"
|
Width="300"
|
||||||
Grid.ColumnSpan="2" />
|
Grid.ColumnSpan="2"
|
||||||
<Label Content="{x:Static Properties:Resources.toolbarLocationLabel}"
|
Grid.Column="0" />
|
||||||
Name="toolbarLocationLabel"
|
<Label Grid.Column="0"
|
||||||
|
Content="{x:Static properties:Resources.toolbarLocationLabel}"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Margin="0,50,0,0"
|
Margin="0,50,0,0"
|
||||||
Padding="0,5,5,5"
|
Padding="0,5,5,5"
|
||||||
Target="{Binding ElementName=toolbarLocationComboBox}"
|
Target="{Binding ElementName=ToolbarLocationComboBox}"
|
||||||
Width="97" />
|
Width="97" />
|
||||||
<ComboBox Margin="8,53,0,0"
|
<ComboBox Margin="8,53,0,0"
|
||||||
Name="toolbarLocationComboBox"
|
Name="ToolbarLocationComboBox"
|
||||||
VerticalAlignment="Top" Grid.Column="1">
|
VerticalAlignment="Top"
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.Top}"
|
Grid.Column="1">
|
||||||
|
<ComboBoxItem Content="{x:Static properties:Resources.Top}"
|
||||||
Tag="{x:Static Dock.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}" />
|
Tag="{x:Static Dock.Bottom}" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<Label Content="{x:Static Properties:Resources.multipleLineDisplayLabel}"
|
<Label Grid.Column="0"
|
||||||
Name="multipleLineDisplayLabel"
|
Content="{x:Static properties:Resources.multipleLineDisplayLabel}"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Margin="0,82,0,0"
|
Margin="0,82,0,0"
|
||||||
Padding="0,5,5,5"
|
Padding="0,5,5,5"
|
||||||
Target="{Binding ElementName=multipleLineDisplayComboBox}"
|
Target="{Binding ElementName=MultipleLineDisplayComboBox}"
|
||||||
Width="97" />
|
Width="97" />
|
||||||
<ComboBox Margin="8,86,0,0"
|
<ComboBox Margin="8,86,0,0"
|
||||||
Name="multipleLineDisplayComboBox"
|
Name="MultipleLineDisplayComboBox"
|
||||||
VerticalAlignment="Top" Grid.Column="1">
|
VerticalAlignment="Top"
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplayNormal}"
|
Grid.Column="1">
|
||||||
Tag="{x:Static Options:MultipleLineDisplay.Normal}" />
|
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplayNormal}"
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplaySingleLine}"
|
Tag="{x:Static options:MultipleLineDisplay.Normal}" />
|
||||||
Tag="{x:Static Options:MultipleLineDisplay.SingleLine}" />
|
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplaySingleLine}"
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.multipleLineDisplayFirstLine}"
|
Tag="{x:Static options:MultipleLineDisplay.SingleLine}" />
|
||||||
Tag="{x:Static Options:MultipleLineDisplay.FirstLine}" />
|
<ComboBoxItem Content="{x:Static properties:Resources.multipleLineDisplayFirstLine}"
|
||||||
|
Tag="{x:Static options:MultipleLineDisplay.FirstLine}" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
base.LoadPanel(database);
|
base.LoadPanel(database);
|
||||||
|
|
||||||
lockWindowCheckBox.IsChecked = Settings.Default.WindowLocked;
|
LockWindowCheckBox.IsChecked = Settings.Default.WindowLocked;
|
||||||
displayEmptyFeedsCheckBox.IsChecked = Settings.Default.DisplayEmptyFeeds;
|
DisplayEmptyFeedsCheckBox.IsChecked = Settings.Default.DisplayEmptyFeeds;
|
||||||
toolbarLocationComboBox.SelectedItem = toolbarLocationComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (Dock) comboBoxItem.Tag == Settings.Default.ToolbarLocation);
|
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);
|
MultipleLineDisplayComboBox.SelectedItem = MultipleLineDisplayComboBox.Items.Cast<ComboBoxItem>().First(comboBoxItem => (MultipleLineDisplay) comboBoxItem.Tag == Settings.Default.MultipleLineDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ValidatePanel()
|
public override bool ValidatePanel()
|
||||||
@@ -28,22 +28,19 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
public override void SavePanel()
|
public override void SavePanel()
|
||||||
{
|
{
|
||||||
if (lockWindowCheckBox.IsChecked.HasValue && Settings.Default.WindowLocked != lockWindowCheckBox.IsChecked.Value)
|
if (LockWindowCheckBox.IsChecked.HasValue && Settings.Default.WindowLocked != LockWindowCheckBox.IsChecked.Value)
|
||||||
Settings.Default.WindowLocked = lockWindowCheckBox.IsChecked.Value;
|
Settings.Default.WindowLocked = LockWindowCheckBox.IsChecked.Value;
|
||||||
|
|
||||||
if (displayEmptyFeedsCheckBox.IsChecked.HasValue && Settings.Default.DisplayEmptyFeeds != displayEmptyFeedsCheckBox.IsChecked.Value)
|
if (DisplayEmptyFeedsCheckBox.IsChecked.HasValue && Settings.Default.DisplayEmptyFeeds != DisplayEmptyFeedsCheckBox.IsChecked.Value)
|
||||||
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;
|
Settings.Default.ToolbarLocation = dock;
|
||||||
|
|
||||||
var multipleLineDisplay = (MultipleLineDisplay) ((ComboBoxItem) multipleLineDisplayComboBox.SelectedItem).Tag;
|
var multipleLineDisplay = (MultipleLineDisplay) ((ComboBoxItem) MultipleLineDisplayComboBox.SelectedItem).Tag;
|
||||||
Settings.Default.MultipleLineDisplay = multipleLineDisplay;
|
Settings.Default.MultipleLineDisplay = multipleLineDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryDisplay;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryDisplay; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
<Window x:Class="FeedCenter.Options.FeedWindow"
|
<Window x:Class="FeedCenter.Options.FeedWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
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"
|
xmlns:feedCenter="clr-namespace:FeedCenter"
|
||||||
Title="FeedWindow"
|
Title="FeedWindow"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="450"
|
Width="450"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/FeedCenter;component/Resources/Application.ico"
|
Icon="/FeedCenter;component/Resources/Application.ico"
|
||||||
FocusManager.FocusedElement="{Binding ElementName=urlTextBox}">
|
FocusManager.FocusedElement="{Binding ElementName=UrlTextBox}">
|
||||||
<Grid Name="mainGrid">
|
<Grid>
|
||||||
<TabControl Name="optionsTabControl"
|
<TabControl Name="OptionsTabControl"
|
||||||
Margin="12,12,12,41">
|
Margin="12,12,12,41">
|
||||||
<TabItem Header="{x:Static Properties:Resources.generalTab}"
|
<TabItem Header="{x:Static properties:Resources.generalTab}">
|
||||||
Name="generalTab">
|
<Grid>
|
||||||
<Grid Name="generalGrid">
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -26,37 +25,37 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{x:Static Properties:Resources.feedUrlLabel}"
|
<Label Content="{x:Static properties:Resources.feedUrlLabel}"
|
||||||
Name="urlLabel"
|
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Target="{Binding ElementName=urlTextBox}"
|
Target="{Binding ElementName=UrlTextBox}"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
<TextBox Name="urlTextBox"
|
<TextBox Name="UrlTextBox"
|
||||||
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Text="{Binding Path=Source, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
Text="{Binding Path=Source, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
<Label Content="{x:Static Properties:Resources.feedNameLabel}"
|
<Label Content="{x:Static properties:Resources.feedNameLabel}"
|
||||||
Name="nameLabel"
|
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Target="{Binding ElementName=nameTextBox}"
|
Target="{Binding ElementName=NameTextBox}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
<TextBox Name="nameTextBox"
|
<TextBox Name="NameTextBox"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
|
Text="{Binding Path=Name, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
<Label Content="{x:Static Properties:Resources.feedCategoryLabel}"
|
<Label Content="{x:Static properties:Resources.feedCategoryLabel}"
|
||||||
Name="feedCategoryLabel"
|
Target="{Binding ElementName=CategoryComboBox}"
|
||||||
Target="{Binding ElementName=categoryComboBox}"
|
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
<ComboBox Grid.Column="1"
|
<ComboBox Grid.Column="1"
|
||||||
Name="categoryComboBox"
|
Name="CategoryComboBox"
|
||||||
DisplayMemberPath="Name"
|
DisplayMemberPath="Name"
|
||||||
SelectedValuePath="ID"
|
SelectedValuePath="ID"
|
||||||
SelectedValue="{Binding Path=Category.ID}"
|
SelectedValue="{Binding Path=Category.ID}"
|
||||||
@@ -64,22 +63,22 @@
|
|||||||
Margin="6" />
|
Margin="6" />
|
||||||
|
|
||||||
<CheckBox Grid.ColumnSpan="2"
|
<CheckBox Grid.ColumnSpan="2"
|
||||||
Name="readIntervalCheckBox"
|
Grid.Column="0"
|
||||||
|
Name="ReadIntervalCheckBox"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
IsChecked="{Binding Path=Enabled, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
IsChecked="{Binding Path=Enabled, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Margin="6">
|
Margin="6">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<Label Content="{x:Static Properties:Resources.feedReadIntervalPrefix}"
|
<Label Content="{x:Static properties:Resources.feedReadIntervalPrefix}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,0,5,0"
|
Margin="0,0,5,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Padding="0" />
|
Padding="0" />
|
||||||
<TextBox Width="50"
|
<TextBox Width="50"
|
||||||
Name="readIntervalTextBox"
|
|
||||||
Text="{Binding Path=CheckInterval, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
Text="{Binding Path=CheckInterval, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
IsEnabled="{Binding ElementName=readIntervalCheckBox, Path=IsChecked}" />
|
IsEnabled="{Binding ElementName=ReadIntervalCheckBox, Path=IsChecked}" />
|
||||||
<Label Content="{x:Static Properties:Resources.feedReadIntervalSuffix}"
|
<Label Content="{x:Static properties:Resources.feedReadIntervalSuffix}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -88,8 +87,7 @@
|
|||||||
</CheckBox>
|
</CheckBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{x:Static Properties:Resources.readingTab}"
|
<TabItem Header="{x:Static properties:Resources.readingTab}">
|
||||||
Name="readingTab">
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@@ -99,29 +97,28 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Label Content="{x:Static Properties:Resources.openLabel}"
|
<Label Content="{x:Static properties:Resources.openLabel}"
|
||||||
Name="openLabel"
|
Target="{Binding ElementName=OpenComboBox}"
|
||||||
Target="{Binding ElementName=openComboBox}"
|
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
<ComboBox Name="openComboBox"
|
<ComboBox Name="OpenComboBox"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
SelectedValue="{Binding Path=MultipleOpenAction, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
|
SelectedValue="{Binding Path=MultipleOpenAction, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=true}"
|
||||||
SelectedValuePath="Tag"
|
SelectedValuePath="Tag"
|
||||||
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="6">
|
Margin="6">
|
||||||
|
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.openAllSingleToolbarButton}"
|
<ComboBoxItem Content="{x:Static properties:Resources.openAllSingleToolbarButton}"
|
||||||
Tag="{x:Static feedCenter:MultipleOpenAction.SinglePage}" />
|
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}" />
|
Tag="{x:Static feedCenter:MultipleOpenAction.IndividualPages}" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{x:Static Properties:Resources.authenticationTab}"
|
<TabItem Header="{x:Static properties:Resources.authenticationTab}">
|
||||||
Name="authenticationTab">
|
<Grid>
|
||||||
<Grid Name="authenticationGrid">
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -132,61 +129,58 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox Content="{x:Static Properties:Resources.requiresAuthenticationCheckBox}"
|
<CheckBox Content="{x:Static properties:Resources.requiresAuthenticationCheckBox}"
|
||||||
Name="requiresAuthenticationCheckBox"
|
Name="RequiresAuthenticationCheckBox"
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
IsChecked="{Binding Path=Authenticate, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
IsChecked="{Binding Path=Authenticate, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
<Label Content="{x:Static Properties:Resources.authenticationUserNameLabel}"
|
<Label Content="{x:Static properties:Resources.authenticationUserNameLabel}"
|
||||||
Name="authenticationUserNameLabel"
|
Target="{Binding ElementName=AuthenticationUserNameTextBox}"
|
||||||
Target="{Binding ElementName=authenticationUserNameTextBox}"
|
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
|
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="20,0,0,0" />
|
Padding="20,0,0,0" />
|
||||||
<TextBox Name="authenticationUserNameTextBox"
|
<TextBox Name="AuthenticationUserNameTextBox"
|
||||||
Text="{Binding Path=UserName, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
Text="{Binding Path=UserName, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
|
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
<Label Content="{x:Static Properties:Resources.authenticationPasswordLabel}"
|
<Label Content="{x:Static properties:Resources.authenticationPasswordLabel}"
|
||||||
Name="authenticationPasswordLabel"
|
Target="{Binding ElementName=AuthenticationPasswordTextBox}"
|
||||||
Target="{Binding ElementName=authenticationPasswordTextBox}"
|
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
|
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
Margin="6"
|
Margin="6"
|
||||||
Padding="20,0,0,0" />
|
Padding="20,0,0,0" />
|
||||||
<TextBox Name="authenticationPasswordTextBox"
|
<TextBox Name="AuthenticationPasswordTextBox"
|
||||||
Text="{Binding Path=Password, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
Text="{Binding Path=Password, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
IsEnabled="{Binding ElementName=requiresAuthenticationCheckBox, Path=IsChecked}"
|
IsEnabled="{Binding ElementName=RequiresAuthenticationCheckBox, Path=IsChecked}"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="6" />
|
Margin="6" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
<Button Content="{x:Static Properties:Resources.OkayButton}"
|
<Button Content="{x:Static properties:Resources.OkayButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Name="okButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Margin="0,0,93,12"
|
Margin="0,0,93,12"
|
||||||
Click="HandleOkayButtonClick" />
|
Click="HandleOkayButtonClick" />
|
||||||
<Button Content="{x:Static Properties:Resources.CancelButton}"
|
<Button Content="{x:Static properties:Resources.CancelButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Name="cancelButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
IsCancel="True"
|
IsCancel="True"
|
||||||
Margin="0,0,12,12" />
|
Margin="0,0,12,12" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace FeedCenter.Options
|
|||||||
database.Categories.Load();
|
database.Categories.Load();
|
||||||
|
|
||||||
// Bind the category combo box
|
// Bind the category combo box
|
||||||
categoryComboBox.ItemsSource = database.Categories.Local;
|
CategoryComboBox.ItemsSource = database.Categories.Local;
|
||||||
|
|
||||||
// Set the data context
|
// Set the data context
|
||||||
DataContext = feed;
|
DataContext = feed;
|
||||||
@@ -56,7 +56,7 @@ namespace FeedCenter.Options
|
|||||||
var firstErrorElement = bindingExpressions.First(b => b.BindingExpression.HasError).FrameworkElement;
|
var firstErrorElement = bindingExpressions.First(b => b.BindingExpression.HasError).FrameworkElement;
|
||||||
|
|
||||||
// Loop over each tab item
|
// Loop over each tab item
|
||||||
foreach (TabItem tabItem in optionsTabControl.Items)
|
foreach (TabItem tabItem in OptionsTabControl.Items)
|
||||||
{
|
{
|
||||||
// Cast the content as visual
|
// Cast the content as visual
|
||||||
var content = (Visual) tabItem.Content;
|
var content = (Visual) tabItem.Content;
|
||||||
|
|||||||
@@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:Options="clr-namespace:FeedCenter.Options"
|
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:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="311"
|
d:DesignHeight="311"
|
||||||
d:DesignWidth="425">
|
d:DesignWidth="425">
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<ColumnDefinition Width="5" />
|
<ColumnDefinition Width="5" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<DataGrid Name="feedListBox"
|
<DataGrid Name="FeedListBox"
|
||||||
SelectionMode="Extended"
|
SelectionMode="Extended"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
@@ -31,11 +31,11 @@
|
|||||||
Background="{x:Null}">
|
Background="{x:Null}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Binding="{Binding Name}"
|
<DataGridTextColumn Binding="{Binding Name}"
|
||||||
Header="{x:Static Properties:Resources.FeedNameColumnHeader}"
|
Header="{x:Static properties:Resources.FeedNameColumnHeader}"
|
||||||
SortDirection="Ascending"
|
SortDirection="Ascending"
|
||||||
Width="*" />
|
Width="*" />
|
||||||
<DataGridTextColumn Binding="{Binding LastUpdated, StringFormat=d}"
|
<DataGridTextColumn Binding="{Binding LastUpdated, StringFormat=d}"
|
||||||
Header="{x:Static Properties:Resources.LastUpdatedColumnHeader}"
|
Header="{x:Static properties:Resources.LastUpdatedColumnHeader}"
|
||||||
Width="Auto" />
|
Width="Auto" />
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
<DataGrid.ItemContainerStyle>
|
<DataGrid.ItemContainerStyle>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGrid.CellStyle>
|
</DataGrid.CellStyle>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<DataGrid Name="categoryListBox"
|
<DataGrid Name="CategoryListBox"
|
||||||
SelectionChanged="HandleCategoryListBoxSelectionChanged"
|
SelectionChanged="HandleCategoryListBoxSelectionChanged"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
SelectionMode="Extended"
|
SelectionMode="Extended"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
Background="{x:Null}">
|
Background="{x:Null}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Binding="{Binding Name}"
|
<DataGridTextColumn Binding="{Binding Name}"
|
||||||
Header="{x:Static Properties:Resources.CategoryNameColumnHeader}"
|
Header="{x:Static properties:Resources.CategoryNameColumnHeader}"
|
||||||
SortDirection="Ascending"
|
SortDirection="Ascending"
|
||||||
Width="*" />
|
Width="*" />
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
@@ -94,68 +94,66 @@
|
|||||||
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
||||||
<LinkControl:LinkControl Name="addFeedButton"
|
<linkControl:LinkControl Name="AddFeedButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleAddFeedButtonClick"
|
Click="HandleAddFeedButtonClick"
|
||||||
Text="{x:Static Properties:Resources.AddLink}"
|
Text="{x:Static properties:Resources.AddLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.AddFeedButton}">
|
ToolTip="{x:Static properties:Resources.AddFeedButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="editFeedButton"
|
<linkControl:LinkControl Name="EditFeedButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleEditFeedButtonClick"
|
Click="HandleEditFeedButtonClick"
|
||||||
Text="{x:Static Properties:Resources.EditLink}"
|
Text="{x:Static properties:Resources.EditLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.EditFeedButton}">
|
ToolTip="{x:Static properties:Resources.EditFeedButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="deleteFeedButton"
|
<linkControl:LinkControl Name="DeleteFeedButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleDeleteFeedButtonClick"
|
Click="HandleDeleteFeedButtonClick"
|
||||||
Text="{x:Static Properties:Resources.DeleteLink}"
|
Text="{x:Static properties:Resources.DeleteLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.DeleteFeedButton}">
|
ToolTip="{x:Static properties:Resources.DeleteFeedButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="importButton"
|
<linkControl:LinkControl Margin="6,2,2,2"
|
||||||
Margin="6,2,2,2"
|
|
||||||
Click="HandleImportButtonClick"
|
Click="HandleImportButtonClick"
|
||||||
Text="{x:Static Properties:Resources.ImportLink}"
|
Text="{x:Static properties:Resources.ImportLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.ImportFeedsButton}">
|
ToolTip="{x:Static properties:Resources.ImportFeedsButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="exportButton"
|
<linkControl:LinkControl Margin="2"
|
||||||
Margin="2"
|
|
||||||
Click="HandleExportButtonClick"
|
Click="HandleExportButtonClick"
|
||||||
Text="{x:Static Properties:Resources.ExportLink}"
|
Text="{x:Static properties:Resources.ExportLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.ExportFeedsButton}">
|
ToolTip="{x:Static properties:Resources.ExportFeedsButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="multipleEditButton"
|
<linkControl:LinkControl Margin="6,2,2,2"
|
||||||
Margin="6,2,2,2"
|
|
||||||
Click="HandleMultipleEditClick"
|
Click="HandleMultipleEditClick"
|
||||||
Text="{x:Static Properties:Resources.MultipleEditLink}"
|
Text="{x:Static properties:Resources.MultipleEditLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.MultipleEditButton}">
|
ToolTip="{x:Static properties:Resources.MultipleEditButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<Border Grid.Row="1"
|
<Border Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
BorderThickness="1,0,1,1"
|
BorderThickness="1,0,1,1"
|
||||||
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
||||||
<LinkControl:LinkControl Name="addCategoryButton"
|
<linkControl:LinkControl Name="AddCategoryButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleAddCategoryButtonClick"
|
Click="HandleAddCategoryButtonClick"
|
||||||
Text="{x:Static Properties:Resources.AddLink}"
|
Text="{x:Static properties:Resources.AddLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.AddCategoryButton}">
|
ToolTip="{x:Static properties:Resources.AddCategoryButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="editCategoryButton"
|
<linkControl:LinkControl Name="EditCategoryButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleEditCategoryButtonClick"
|
Click="HandleEditCategoryButtonClick"
|
||||||
Text="{x:Static Properties:Resources.EditLink}"
|
Text="{x:Static properties:Resources.EditLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.EditCategoryButton}">
|
ToolTip="{x:Static properties:Resources.EditCategoryButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
<LinkControl:LinkControl Name="deleteCategoryButton"
|
<linkControl:LinkControl Name="DeleteCategoryButton"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
Click="HandleDeleteCategoryButtonClick"
|
Click="HandleDeleteCategoryButtonClick"
|
||||||
Text="{x:Static Properties:Resources.DeleteLink}"
|
Text="{x:Static properties:Resources.DeleteLink}"
|
||||||
ToolTip="{x:Static Properties:Resources.DeleteCategoryButton}">
|
ToolTip="{x:Static properties:Resources.DeleteCategoryButton}">
|
||||||
</LinkControl:LinkControl>
|
</linkControl:LinkControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
@@ -31,8 +31,8 @@ namespace FeedCenter.Options
|
|||||||
collectionViewSource.SortDescriptions.Add(new SortDescription("SortKey", ListSortDirection.Ascending));
|
collectionViewSource.SortDescriptions.Add(new SortDescription("SortKey", ListSortDirection.Ascending));
|
||||||
collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
||||||
|
|
||||||
categoryListBox.ItemsSource = collectionViewSource.View;
|
CategoryListBox.ItemsSource = collectionViewSource.View;
|
||||||
categoryListBox.SelectedIndex = 0;
|
CategoryListBox.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ValidatePanel()
|
public override bool ValidatePanel()
|
||||||
@@ -43,10 +43,7 @@ namespace FeedCenter.Options
|
|||||||
public override void SavePanel()
|
public override void SavePanel()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryFeeds;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryFeeds; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -54,16 +51,16 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void SetFeedButtonStates()
|
private void SetFeedButtonStates()
|
||||||
{
|
{
|
||||||
addFeedButton.IsEnabled = true;
|
AddFeedButton.IsEnabled = true;
|
||||||
editFeedButton.IsEnabled = (feedListBox.SelectedItem != null);
|
EditFeedButton.IsEnabled = (FeedListBox.SelectedItem != null);
|
||||||
deleteFeedButton.IsEnabled = (feedListBox.SelectedItem != null);
|
DeleteFeedButton.IsEnabled = (FeedListBox.SelectedItem != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddFeed()
|
private void AddFeed()
|
||||||
{
|
{
|
||||||
var feed = Feed.Create(Database);
|
var feed = Feed.Create(Database);
|
||||||
|
|
||||||
var category = (Category) categoryListBox.SelectedItem;
|
var category = (Category) CategoryListBox.SelectedItem;
|
||||||
|
|
||||||
feed.Category = category;
|
feed.Category = category;
|
||||||
|
|
||||||
@@ -75,7 +72,7 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
Database.Feeds.Add(feed);
|
Database.Feeds.Add(feed);
|
||||||
|
|
||||||
feedListBox.SelectedItem = feed;
|
FeedListBox.SelectedItem = feed;
|
||||||
|
|
||||||
SetFeedButtonStates();
|
SetFeedButtonStates();
|
||||||
}
|
}
|
||||||
@@ -83,10 +80,10 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void EditSelectedFeed()
|
private void EditSelectedFeed()
|
||||||
{
|
{
|
||||||
if (feedListBox.SelectedItem == null)
|
if (FeedListBox.SelectedItem == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var feed = (Feed) feedListBox.SelectedItem;
|
var feed = (Feed) FeedListBox.SelectedItem;
|
||||||
|
|
||||||
var feedWindow = new FeedWindow();
|
var feedWindow = new FeedWindow();
|
||||||
|
|
||||||
@@ -95,7 +92,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void DeleteSelectedFeed()
|
private void DeleteSelectedFeed()
|
||||||
{
|
{
|
||||||
var feed = (Feed) feedListBox.SelectedItem;
|
var feed = (Feed) FeedListBox.SelectedItem;
|
||||||
|
|
||||||
Database.Feeds.Remove(feed);
|
Database.Feeds.Remove(feed);
|
||||||
|
|
||||||
@@ -291,9 +288,9 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void SetCategoryButtonStates()
|
private void SetCategoryButtonStates()
|
||||||
{
|
{
|
||||||
addCategoryButton.IsEnabled = true;
|
AddCategoryButton.IsEnabled = true;
|
||||||
editCategoryButton.IsEnabled = (categoryListBox.SelectedItem != null);
|
EditCategoryButton.IsEnabled = (CategoryListBox.SelectedItem != null);
|
||||||
deleteCategoryButton.IsEnabled = (categoryListBox.SelectedItem != null);
|
DeleteCategoryButton.IsEnabled = (CategoryListBox.SelectedItem != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddCategory()
|
private void AddCategory()
|
||||||
@@ -308,7 +305,7 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
Database.Categories.Add(category);
|
Database.Categories.Add(category);
|
||||||
|
|
||||||
categoryListBox.SelectedItem = category;
|
CategoryListBox.SelectedItem = category;
|
||||||
|
|
||||||
SetCategoryButtonStates();
|
SetCategoryButtonStates();
|
||||||
}
|
}
|
||||||
@@ -316,10 +313,10 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void EditSelectedCategory()
|
private void EditSelectedCategory()
|
||||||
{
|
{
|
||||||
if (categoryListBox.SelectedItem == null)
|
if (CategoryListBox.SelectedItem == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var category = (Category) categoryListBox.SelectedItem;
|
var category = (Category) CategoryListBox.SelectedItem;
|
||||||
|
|
||||||
var categoryWindow = new CategoryWindow();
|
var categoryWindow = new CategoryWindow();
|
||||||
|
|
||||||
@@ -328,7 +325,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private void DeleteSelectedCategory()
|
private void DeleteSelectedCategory()
|
||||||
{
|
{
|
||||||
var category = (Category) categoryListBox.SelectedItem;
|
var category = (Category) CategoryListBox.SelectedItem;
|
||||||
|
|
||||||
Database.Categories.Remove(category);
|
Database.Categories.Remove(category);
|
||||||
|
|
||||||
@@ -366,20 +363,20 @@ namespace FeedCenter.Options
|
|||||||
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
_collectionViewSource.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
||||||
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
|
_collectionViewSource.Filter += HandleCollectionViewSourceFilter;
|
||||||
|
|
||||||
feedListBox.ItemsSource = _collectionViewSource.View;
|
FeedListBox.ItemsSource = _collectionViewSource.View;
|
||||||
}
|
}
|
||||||
|
|
||||||
_collectionViewSource.View.Refresh();
|
_collectionViewSource.View.Refresh();
|
||||||
|
|
||||||
if (feedListBox.Items.Count > 0)
|
if (FeedListBox.Items.Count > 0)
|
||||||
feedListBox.SelectedIndex = 0;
|
FeedListBox.SelectedIndex = 0;
|
||||||
|
|
||||||
SetFeedButtonStates();
|
SetFeedButtonStates();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
|
private void HandleCollectionViewSourceFilter(object sender, FilterEventArgs e)
|
||||||
{
|
{
|
||||||
var selectedCategory = (Category) categoryListBox.SelectedItem;
|
var selectedCategory = (Category) CategoryListBox.SelectedItem;
|
||||||
|
|
||||||
var feed = (Feed) e.Item;
|
var feed = (Feed) e.Item;
|
||||||
|
|
||||||
@@ -404,9 +401,9 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
if (e.LeftButton == MouseButtonState.Pressed)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
<Options:OptionsPanelBase x:Class="FeedCenter.Options.GeneralOptionsPanel"
|
<options:OptionsPanelBase x:Class="FeedCenter.Options.GeneralOptionsPanel"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
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"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
xmlns:options="clr-namespace:FeedCenter.Options"
|
||||||
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox Content="{x:Static Properties:Resources.startWithWindowsCheckBox}"
|
<CheckBox Content="{x:Static properties:Resources.startWithWindowsCheckBox}"
|
||||||
Name="startWithWindowsCheckBox"
|
Name="StartWithWindowsCheckBox"
|
||||||
VerticalAlignment="Top" VerticalContentAlignment="Center" Grid.ColumnSpan="2" />
|
VerticalAlignment="Top"
|
||||||
<CheckBox Content="{x:Static Properties:Resources.registerAsDefaultFeedReaderCheckBox}"
|
VerticalContentAlignment="Center"
|
||||||
HorizontalAlignment="Left"
|
Grid.ColumnSpan="2" />
|
||||||
Margin="0,22,0,0"
|
|
||||||
Name="registerAsDefaultFeedReaderCheckBox"
|
|
||||||
VerticalAlignment="Top" VerticalContentAlignment="Center" Grid.ColumnSpan="2" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
var settings = Properties.Settings.Default;
|
var settings = Properties.Settings.Default;
|
||||||
|
|
||||||
startWithWindowsCheckBox.IsChecked = settings.StartWithWindows;
|
StartWithWindowsCheckBox.IsChecked = settings.StartWithWindows;
|
||||||
registerAsDefaultFeedReaderCheckBox.IsChecked = settings.RegisterAsDefaultFeedReader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ValidatePanel()
|
public override bool ValidatePanel()
|
||||||
@@ -29,21 +28,12 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
var settings = Properties.Settings.Default;
|
var settings = Properties.Settings.Default;
|
||||||
|
|
||||||
if (startWithWindowsCheckBox.IsChecked.HasValue && settings.StartWithWindows != startWithWindowsCheckBox.IsChecked.Value)
|
if (StartWithWindowsCheckBox.IsChecked.HasValue && settings.StartWithWindows != StartWithWindowsCheckBox.IsChecked.Value)
|
||||||
settings.StartWithWindows = startWithWindowsCheckBox.IsChecked.Value;
|
settings.StartWithWindows = StartWithWindowsCheckBox.IsChecked.Value;
|
||||||
|
|
||||||
if (registerAsDefaultFeedReaderCheckBox.IsChecked.HasValue && settings.RegisterAsDefaultFeedReader != registerAsDefaultFeedReaderCheckBox.IsChecked.Value)
|
|
||||||
settings.RegisterAsDefaultFeedReader = registerAsDefaultFeedReaderCheckBox.IsChecked.Value;
|
|
||||||
|
|
||||||
Application.Current.SetStartWithWindows(settings.StartWithWindows);
|
Application.Current.SetStartWithWindows(settings.StartWithWindows);
|
||||||
|
|
||||||
if (settings.RegisterAsDefaultFeedReader)
|
|
||||||
SystemConfiguration.SetDefaultFeedReader();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryGeneral;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryGeneral; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
public class OptionsPanelBase : UserControl
|
public class OptionsPanelBase : UserControl
|
||||||
{
|
{
|
||||||
protected FeedCenterEntities Database { get; set; }
|
protected FeedCenterEntities Database { get; private set; }
|
||||||
|
|
||||||
public virtual void LoadPanel(FeedCenterEntities database)
|
public virtual void LoadPanel(FeedCenterEntities database)
|
||||||
{
|
{
|
||||||
@@ -22,9 +22,6 @@ namespace FeedCenter.Options
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string CategoryName
|
public virtual string CategoryName => null;
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<Window x:Class="FeedCenter.Options.OptionsWindow"
|
<Window x:Class="FeedCenter.Options.OptionsWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
Title="{x:Static Properties:Resources.OptionsWindow}"
|
Title="{x:Static properties:Resources.OptionsWindow}"
|
||||||
Height="360"
|
Height="360"
|
||||||
Width="720"
|
Width="720"
|
||||||
ResizeMode="CanResize"
|
ResizeMode="CanResize"
|
||||||
@@ -10,25 +10,23 @@
|
|||||||
Icon="/FeedCenter;component/Resources/Application.ico">
|
Icon="/FeedCenter;component/Resources/Application.ico">
|
||||||
<Grid>
|
<Grid>
|
||||||
<ListBox HorizontalAlignment="Left"
|
<ListBox HorizontalAlignment="Left"
|
||||||
Name="categoryListBox"
|
Name="CategoryListBox"
|
||||||
Width="126"
|
Width="126"
|
||||||
SelectionChanged="HandleSelectedCategoryChanged"
|
SelectionChanged="HandleSelectedCategoryChanged"
|
||||||
Margin="12,12,0,41" />
|
Margin="12,12,0,41" />
|
||||||
<ContentControl Margin="144,12,12,41"
|
<ContentControl Margin="144,12,12,41"
|
||||||
Name="contentControl"
|
Name="ContentControl"
|
||||||
IsTabStop="False" />
|
IsTabStop="False" />
|
||||||
<Button Content="{x:Static Properties:Resources.OkayButton}"
|
<Button Content="{x:Static properties:Resources.OkayButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Margin="0,0,93,12"
|
Margin="0,0,93,12"
|
||||||
Name="okButton"
|
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="75"
|
Width="75"
|
||||||
IsDefault="True"
|
IsDefault="True"
|
||||||
Click="HandleOkayButtonClick" />
|
Click="HandleOkayButtonClick" />
|
||||||
<Button Content="{x:Static Properties:Resources.CancelButton}"
|
<Button Content="{x:Static properties:Resources.CancelButton}"
|
||||||
Margin="0,0,12,12"
|
Margin="0,0,12,12"
|
||||||
Name="cancelButton"
|
|
||||||
Height="23"
|
Height="23"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
|
|||||||
@@ -50,26 +50,26 @@ namespace FeedCenter.Options
|
|||||||
optionsPanel.LoadPanel(_database);
|
optionsPanel.LoadPanel(_database);
|
||||||
|
|
||||||
// Add the panel to the category ist
|
// 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
|
// Set the panel into the right side
|
||||||
contentControl.Content = optionsPanel;
|
ContentControl.Content = optionsPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select the first item
|
// Select the first item
|
||||||
categoryListBox.SelectedItem = categoryListBox.Items[0];
|
CategoryListBox.SelectedItem = CategoryListBox.Items[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SelectCategory(OptionsPanelBase panel)
|
private void SelectCategory(OptionsPanelBase panel)
|
||||||
{
|
{
|
||||||
// Set the content
|
// Set the content
|
||||||
contentControl.Content = panel;
|
ContentControl.Content = panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleSelectedCategoryChanged(object sender, SelectionChangedEventArgs e)
|
private void HandleSelectedCategoryChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
// Select the right category
|
// Select the right category
|
||||||
SelectCategory(((CategoryListItem) categoryListBox.SelectedItem).Panel);
|
SelectCategory(((CategoryListItem) CategoryListBox.SelectedItem).Panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -78,7 +78,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
private class CategoryListItem
|
private class CategoryListItem
|
||||||
{
|
{
|
||||||
public OptionsPanelBase Panel { get; private set; }
|
public OptionsPanelBase Panel { get; }
|
||||||
|
|
||||||
public CategoryListItem(OptionsPanelBase panel)
|
public CategoryListItem(OptionsPanelBase panel)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:Options="clr-namespace:FeedCenter.Options"
|
xmlns:options="clr-namespace:FeedCenter.Options"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@@ -17,18 +17,18 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{x:Static Properties:Resources.browserLabel}"
|
<Label Content="{x:Static properties:Resources.browserLabel}"
|
||||||
Name="browserLabel"
|
Target="{Binding ElementName=BrowserComboBox}"
|
||||||
Target="{Binding ElementName=browserComboBox}"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Margin="0,0,5,0" />
|
Margin="0,0,5,0" />
|
||||||
<ComboBox Name="browserComboBox"
|
<ComboBox Name="BrowserComboBox"
|
||||||
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalContentAlignment="Center">
|
VerticalContentAlignment="Center">
|
||||||
<ComboBoxItem Content="{x:Static Properties:Resources.DefaultBrowserCaption}"
|
<ComboBoxItem Content="{x:Static properties:Resources.DefaultBrowserCaption}"
|
||||||
Tag="" />
|
Tag="" />
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
var settings = Properties.Settings.Default;
|
var settings = Properties.Settings.Default;
|
||||||
|
|
||||||
LoadBrowserComboBox(browserComboBox, settings.Browser);
|
LoadBrowserComboBox(BrowserComboBox, settings.Browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ValidatePanel()
|
public override bool ValidatePanel()
|
||||||
@@ -30,7 +30,7 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
var settings = Properties.Settings.Default;
|
var settings = Properties.Settings.Default;
|
||||||
|
|
||||||
var browser = (string) ((ComboBoxItem) browserComboBox.SelectedItem).Tag;
|
var browser = (string) ((ComboBoxItem) BrowserComboBox.SelectedItem).Tag;
|
||||||
|
|
||||||
settings.Browser = browser;
|
settings.Browser = browser;
|
||||||
|
|
||||||
@@ -38,10 +38,7 @@ namespace FeedCenter.Options
|
|||||||
this.UpdateAllSources(expressions);
|
this.UpdateAllSources(expressions);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryReading;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryReading; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void LoadBrowserComboBox(ComboBox comboBox, string selected)
|
private static void LoadBrowserComboBox(ComboBox comboBox, string selected)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,20 +1,23 @@
|
|||||||
<Options:OptionsPanelBase x:Class="FeedCenter.Options.UpdateOptionsPanel"
|
<options:OptionsPanelBase x:Class="FeedCenter.Options.UpdateOptionsPanel"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
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"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
xmlns:options="clr-namespace:FeedCenter.Options"
|
||||||
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="300"
|
||||||
|
d:DesignWidth="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
<CheckBox Content="{x:Static Properties:Resources.checkVersionOnStartupCheckBox}"
|
<CheckBox Content="{x:Static properties:Resources.checkVersionOnStartupCheckBox}"
|
||||||
Name="checkVersionOnStartupCheckBox"
|
Name="CheckVersionOnStartupCheckBox"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<Button Content="{x:Static Properties:Resources.checkVersionNowButton}"
|
<Button Content="{x:Static properties:Resources.checkVersionNowButton}"
|
||||||
Height="23"
|
Height="23"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,22,0,0"
|
Margin="0,22,0,0"
|
||||||
Name="checkVersionNowButton"
|
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="75"
|
Width="75"
|
||||||
Click="HandleCheckVersionNowButtonClick" />
|
Click="HandleCheckVersionNowButtonClick" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Options:OptionsPanelBase>
|
</options:OptionsPanelBase>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace FeedCenter.Options
|
|||||||
{
|
{
|
||||||
base.LoadPanel(database);
|
base.LoadPanel(database);
|
||||||
|
|
||||||
checkVersionOnStartupCheckBox.IsChecked = Properties.Settings.Default.CheckVersionAtStartup;
|
CheckVersionOnStartupCheckBox.IsChecked = Properties.Settings.Default.CheckVersionAtStartup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ValidatePanel()
|
public override bool ValidatePanel()
|
||||||
@@ -23,14 +23,11 @@ namespace FeedCenter.Options
|
|||||||
|
|
||||||
public override void SavePanel()
|
public override void SavePanel()
|
||||||
{
|
{
|
||||||
if (checkVersionOnStartupCheckBox.IsChecked.HasValue && 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;
|
Properties.Settings.Default.CheckVersionAtStartup = CheckVersionOnStartupCheckBox.IsChecked.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string CategoryName
|
public override string CategoryName => Properties.Resources.optionCategoryUpdate;
|
||||||
{
|
|
||||||
get { return Properties.Resources.optionCategoryUpdate; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleCheckVersionNowButtonClick(object sender, System.Windows.RoutedEventArgs e)
|
private void HandleCheckVersionNowButtonClick(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
17
Application/Properties/Settings.Designer.cs
generated
17
Application/Properties/Settings.Designer.cs
generated
@@ -1,7 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// 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
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -12,7 +12,7 @@ namespace FeedCenter.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[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 {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
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.UserScopedSettingAttribute()]
|
||||||
[global::System.Configuration.SettingsProviderAttribute(typeof(Common.Settings.GenericSettingsProvider))]
|
[global::System.Configuration.SettingsProviderAttribute(typeof(Common.Settings.GenericSettingsProvider))]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
|||||||
@@ -53,9 +53,6 @@
|
|||||||
<Setting Name="OpenAllSleepInterval" Provider="Common.Settings.GenericSettingsProvider" Type="System.Int32" Scope="User">
|
<Setting Name="OpenAllSleepInterval" Provider="Common.Settings.GenericSettingsProvider" Type="System.Int32" Scope="User">
|
||||||
<Value Profile="(Default)">500</Value>
|
<Value Profile="(Default)">500</Value>
|
||||||
</Setting>
|
</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">
|
<Setting Name="Browser" Provider="Common.Settings.GenericSettingsProvider" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:Properties="clr-namespace:FeedCenter.Properties"
|
xmlns:properties="clr-namespace:FeedCenter.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Splash"
|
Title="Splash"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
@@ -21,9 +21,8 @@
|
|||||||
BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
|
BorderBrush="{x:Static SystemColors.ActiveBorderBrush}"
|
||||||
Padding="3">
|
Padding="3">
|
||||||
<DockPanel LastChildFill="True">
|
<DockPanel LastChildFill="True">
|
||||||
<Label Content="{x:Static Properties:Resources.ApplicationDisplayName}"
|
<Label Content="{x:Static properties:Resources.ApplicationDisplayName}"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Name="lblApplicationName"
|
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="20"
|
FontSize="20"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
@@ -32,18 +31,18 @@
|
|||||||
DockPanel.Dock="Top" />
|
DockPanel.Dock="Top" />
|
||||||
<Label Content="*Version"
|
<Label Content="*Version"
|
||||||
Padding="0,3,0,0"
|
Padding="0,3,0,0"
|
||||||
Name="lblVersion"
|
Name="VersionLabel"
|
||||||
HorizontalContentAlignment="Center"
|
HorizontalContentAlignment="Center"
|
||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
DockPanel.Dock="Top" />
|
DockPanel.Dock="Top" />
|
||||||
<ProgressBar Name="progressBar"
|
<ProgressBar Name="ProgressBar"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="16"
|
Height="16"
|
||||||
DockPanel.Dock="Bottom"
|
DockPanel.Dock="Bottom"
|
||||||
Margin="5,0,5,5" />
|
Margin="5,0,5,5" />
|
||||||
<Label Content="*Status"
|
<Label Content="*Status"
|
||||||
Height="35"
|
Height="35"
|
||||||
Name="lblStatus"
|
Name="StatusLabel"
|
||||||
DockPanel.Dock="Bottom"
|
DockPanel.Dock="Bottom"
|
||||||
VerticalContentAlignment="Bottom"
|
VerticalContentAlignment="Bottom"
|
||||||
Margin="5,0,5,0"
|
Margin="5,0,5,0"
|
||||||
|
|||||||
@@ -52,16 +52,16 @@ namespace FeedCenter
|
|||||||
string version = UpdateCheck.LocalVersion.ToString();
|
string version = UpdateCheck.LocalVersion.ToString();
|
||||||
|
|
||||||
// Show the version
|
// Show the version
|
||||||
lblVersion.Content = string.Format(Properties.Resources.Version, version);
|
VersionLabel.Content = string.Format(Properties.Resources.Version, version);
|
||||||
|
|
||||||
// Set the starting caption
|
// Set the starting caption
|
||||||
lblStatus.Content = Properties.Resources.SplashStarting;
|
StatusLabel.Content = Properties.Resources.SplashStarting;
|
||||||
|
|
||||||
// Build the progress steps
|
// Build the progress steps
|
||||||
LoadProgressSteps();
|
LoadProgressSteps();
|
||||||
|
|
||||||
// Set the progress bar to the number of steps
|
// Set the progress bar to the number of steps
|
||||||
progressBar.Maximum = _progressSteps.Count;
|
ProgressBar.Maximum = _progressSteps.Count;
|
||||||
|
|
||||||
// Create the worker with progress and cancel
|
// Create the worker with progress and cancel
|
||||||
_backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
|
_backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true };
|
||||||
@@ -97,14 +97,14 @@ namespace FeedCenter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update the progress bar
|
// Update the progress bar
|
||||||
progressBar.Value += e.ProgressPercentage;
|
ProgressBar.Value += e.ProgressPercentage;
|
||||||
|
|
||||||
// Get the message
|
// Get the message
|
||||||
var message = (string) e.UserState;
|
var message = (string) e.UserState;
|
||||||
|
|
||||||
// Update the status label if one was supplied
|
// Update the status label if one was supplied
|
||||||
if (!string.IsNullOrEmpty(message))
|
if (!string.IsNullOrEmpty(message))
|
||||||
lblStatus.Content = message;
|
StatusLabel.Content = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleBackgroundWorkerDoWork(object sender, DoWorkEventArgs e)
|
private void HandleBackgroundWorkerDoWork(object sender, DoWorkEventArgs e)
|
||||||
@@ -160,7 +160,7 @@ namespace FeedCenter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move the progress bar to the max just in case
|
// Move the progress bar to the max just in case
|
||||||
progressBar.Value = progressBar.Maximum;
|
ProgressBar.Value = ProgressBar.Maximum;
|
||||||
|
|
||||||
// Close the window
|
// Close the window
|
||||||
Close();
|
Close();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Win32;
|
using System;
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using FeedCenter.Properties;
|
using FeedCenter.Properties;
|
||||||
@@ -8,52 +7,6 @@ namespace FeedCenter
|
|||||||
{
|
{
|
||||||
public static class SystemConfiguration
|
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;
|
private static bool UseDebugPath => Environment.CommandLine.IndexOf("/debugPath", StringComparison.InvariantCultureIgnoreCase) != -1;
|
||||||
|
|
||||||
public static string DataDirectory => UseDebugPath ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) : UserSettingsPath;
|
public static string DataDirectory => UseDebugPath ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) : UserSettingsPath;
|
||||||
|
|||||||
@@ -48,9 +48,6 @@
|
|||||||
<setting name="OpenAllSleepInterval" serializeAs="String">
|
<setting name="OpenAllSleepInterval" serializeAs="String">
|
||||||
<value>500</value>
|
<value>500</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="RegisterAsDefaultFeedReader" serializeAs="String">
|
|
||||||
<value>False</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="Browser" serializeAs="String">
|
<setting name="Browser" serializeAs="String">
|
||||||
<value />
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
|
|||||||
Reference in New Issue
Block a user