Skip to content

Commit

Permalink
Corrected inconsistent whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlasHackert committed Aug 28, 2017
1 parent 8ba7fbc commit 9183dbb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Console/UI/Pages/Rules.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="800"
Title="Firewall rules">
Title="Firewall rules">
<DockPanel>
<Border DockPanel.Dock="Top">
<Border.Style>
Expand Down Expand Up @@ -59,8 +59,8 @@
</Grid>
</Border>
<Grid>
<DataGrid AlternatingRowBackground="Gainsboro" BorderThickness="0" x:Name="gridRules" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ColumnWidth="*" GridLinesVisibility="None" SelectionMode="Single" IsReadOnly="True" AutoGenerateColumns="False" HeadersVisibility="Column">
<DataGrid.CellStyle>
<DataGrid AlternatingRowBackground="Gainsboro" BorderThickness="0" x:Name="gridRules" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ColumnWidth="*" GridLinesVisibility="None" SelectionMode="Single" IsReadOnly="True" AutoGenerateColumns="False" HeadersVisibility="Column">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
Expand Down
30 changes: 15 additions & 15 deletions Console/UI/Pages/Rules.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@

namespace Wokhan.WindowsFirewallNotifier.Console.UI.Pages
{
/// <summary>
/// Interaction logic for Rules.xaml
/// </summary>
public partial class Rules : Page
/// <summary>
/// Interaction logic for Rules.xaml
/// </summary>
public partial class Rules : Page
{
private ObservableCollection<FirewallHelper.Rule> allRules;
private ObservableCollection<FirewallHelper.Rule> allRules;

public Rules()
public Rules()
{
InitializeComponent();

initAllRules();
initRules();
gridRules.ItemsSource = allRules;
// Apply a default sort by Name, ascending.
ICollectionView dataView = CollectionViewSource.GetDefaultView(gridRules.ItemsSource);
dataView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
gridRules.Items.Refresh();
gridRules.ItemsSource = allRules;
// Apply a default sort by Name, ascending.
ICollectionView dataView = CollectionViewSource.GetDefaultView(gridRules.ItemsSource);
dataView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
gridRules.Items.Refresh();
}

private string _filter = String.Empty;
Expand Down Expand Up @@ -59,7 +59,7 @@ private void initAllRules()
{
try
{
allRules = new ObservableCollection<FirewallHelper.Rule>(FirewallHelper.GetRules());
allRules = new ObservableCollection<FirewallHelper.Rule>(FirewallHelper.GetRules());
}
catch (Exception e)
{
Expand Down Expand Up @@ -129,10 +129,10 @@ private void btnRemoveRule_Click(object sender, RoutedEventArgs e)
{
if (MessageBox.Show(Common.Properties.Resources.MSG_RULE_DELETE, Common.Properties.Resources.MSG_DLG_TITLE, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
{
FirewallHelper.Rule selectedRule = (FirewallHelper.Rule)gridRules.SelectedItem;
FirewallHelper.Rule selectedRule = (FirewallHelper.Rule)gridRules.SelectedItem;

allRules.Remove(selectedRule);
FirewallHelper.RemoveRule(selectedRule.Name);
allRules.Remove(selectedRule);
FirewallHelper.RemoveRule(selectedRule.Name);

//initAllRules();
//initRules();
Expand Down

0 comments on commit 9183dbb

Please sign in to comment.