Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
V1.5.2
Browse files Browse the repository at this point in the history
NEW:
 #23
  • Loading branch information
jibedoubleve authored Oct 25, 2019
1 parent 444ea82 commit ba99e1a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
39 changes: 38 additions & 1 deletion Probel.JsonReader.Presentation/Views/ShellView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Probel.JsonReader.Presentation.Properties;
using Probel.JsonReader.Presentation.Services;
using Probel.JsonReader.Presentation.ViewModels;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
Expand All @@ -18,6 +20,7 @@ public partial class ShellView : Window
{
#region Fields

private const string UNSELECT_ALL = "unselect_all";
private readonly ILogService _logger;

#endregion Fields
Expand All @@ -41,13 +44,33 @@ public ShellView(ILogService logger)

#region Methods


private void OnUnselectAllCategories(object sender, RoutedEventArgs e)
{
if (sender is MenuItem)
{
var categories = new List<string>();
ViewModel.RefillCategories(categories);
ViewModel.FilterCommand.TryExecute(ViewModel.FilterMinutes.ToString());

foreach (var menu in _menuCategories.Items)
{
if (menu is MenuItem mi) { mi.IsChecked = false; }
}
}
}

private void OnCategoryClick(object sender, RoutedEventArgs e)
{
if (sender is MenuItem mi)
{
mi.IsChecked = !mi.IsChecked;

var categories = (from m in _menuCategories.Items.Cast<MenuItem>()
var collection = (from m in _menuCategories.Items.Cast<object>()
where m is MenuItem
select m).Cast<MenuItem>().ToList();

var categories = (from m in collection
where m.IsChecked == true
select (string)m.Header).ToList();

Expand Down Expand Up @@ -151,6 +174,7 @@ private void Refresh()
private void RefreshCategories()
{
_menuCategories.Items.Clear();

var categories = ViewModel.GetCategories();

for (var i = 0; i < categories.Count(); i++)
Expand All @@ -164,6 +188,19 @@ private void RefreshCategories()

_menuCategories.Items.Insert(i, btn);
}

_menuCategories.Items.Add(new Separator());
_menuCategories.Items.Add(BuildUnselectAll());
}
private MenuItem BuildUnselectAll()
{
var btn = new MenuItem()
{
Header = "Unselect all",
IsChecked = false,
};
btn.Click += OnUnselectAllCategories;
return btn;
}

private void RefreshFileHistory()
Expand Down
4 changes: 2 additions & 2 deletions Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
// [assembly: AssemblyVersion("1.0.*")]
using System.Reflection;

[assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.5.1")]
[assembly: AssemblyVersion("1.5.2")]
[assembly: AssemblyFileVersion("1.5.2")]
2 changes: 1 addition & 1 deletion build/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Log Reader"
#define MyAppVersion "1.5.1"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "Probel"
#define MyAppURL "http://www.probel.xyz"
#define MyAppExeName "Probel.JsonReader.Presentation.exe"
Expand Down

0 comments on commit ba99e1a

Please sign in to comment.