Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge odahan's changes #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/LogViewer/v15/.suo
Binary file not shown.
Binary file added .vs/LogViewerForLog4Net/v15/.suo
Binary file not shown.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
158 changes: 87 additions & 71 deletions About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,79 @@
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="LogViewer.About"
Title="About" Height="706" Width="400"
Background="{DynamicResource WindowBackgroundBrush}"
Title="About" Height="706" Width="440"
Loaded="window_Loaded" >
<Window.Resources>
<Storyboard x:Key="TitleAnim">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(ee:RippleEffect.Frequency)" Storyboard.TargetName="stackPanel">
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(ee:RippleEffect.Magnitude)" Storyboard.TargetName="stackPanel">
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="RichTextBox1">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="label">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBoxBase.IsReadOnlyCaretVisible)" Storyboard.TargetName="RichTextBox1">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:4" Value="False"/>
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource TitleAnim}"/>
</EventTrigger>
</Window.Triggers>
<Border BorderBrush="#FF6A6A6A" BorderThickness="8" CornerRadius="8">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black"/>
<GradientStop Color="#FF232323" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Window.Resources>
<Storyboard x:Key="TitleAnim">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(ee:RippleEffect.Frequency)" Storyboard.TargetName="stackPanel">
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(ee:RippleEffect.Magnitude)" Storyboard.TargetName="stackPanel">
<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="RichTextBox1">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="label">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBoxBase.IsReadOnlyCaretVisible)" Storyboard.TargetName="RichTextBox1">
<DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
<DiscreteBooleanKeyFrame KeyTime="0:0:4" Value="False"/>
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource TitleAnim}"/>
</EventTrigger>
</Window.Triggers>
<Border BorderBrush="#FF6A6A6A" BorderThickness="8" CornerRadius="8">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black"/>
<GradientStop Color="#FF232323" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid Margin="10,10,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="93" />
<RowDefinition Height="30"/>
<RowDefinition Height="0.837*" />
<RowDefinition Height="0.163*" />
<RowDefinition Height="41"/>
<RowDefinition Height="396*" />
<RowDefinition Height="79*" />
<RowDefinition Height="29.5"/>
</Grid.RowDefinitions>
<StackPanel x:Name="stackPanel" Orientation="Vertical" VerticalAlignment="Stretch">
<StackPanel.Effect>
<ee:RippleEffect Magnitude="1" Frequency="100"/>
</StackPanel.Effect>
<StackPanel.Effect>
<ee:RippleEffect Magnitude="1" Frequency="100"/>
</StackPanel.Effect>
<StackPanel Orientation="Horizontal">
<Label x:Name="labelAssemblyName"
<Label x:Name="LabelAssemblyName"
Foreground="Orange"
FontWeight="Normal"
FontSize="24"
FontSize="18"
FontFamily="Calibri"
Content="LogViewer" Margin="0,0,5,0"/>
<Label x:Name="labelAssemblyVersion"
<Label x:Name="LabelAssemblyVersion"
Foreground="Orange"
FontWeight="Normal"
FontSize="24"
FontSize="18"
FontFamily="Calibri"
Content="2.x"/>
Content="3.x"/>
</StackPanel>
<Label x:Name="labelAssembly" Foreground="AntiqueWhite"/>
<Label x:Name="LabelAssembly" Foreground="AntiqueWhite"/>
</StackPanel>
<Label x:Name="label" Grid.Row="1" Foreground="Orange" Height="23" Content="Highlights:" />
<Label x:Name="label" Grid.Row="1" Foreground="Orange" Content="Highlights:" Margin="0,3" />
<RichTextBox
Grid.Row="2"
x:Name="RichTextBox1"
Expand All @@ -89,33 +88,50 @@
<FlowDocument PageWidth="600" LineHeight="1" IsOptimalParagraphEnabled="True" >
<List>
<ListItem>
<Paragraph><Run Text="Drag and Drop to open XML log files (multi selection)"/></Paragraph>
<Paragraph>
<Run Text="Drag and Drop to open XML log files (multi selection)"/>
</Paragraph>
</ListItem>
<ListItem>
<Paragraph><Run Text="Use ALT-Drop to merge files"/></Paragraph>
<Paragraph>
<Run Text="Use ALT-Drop to merge files"/>
</Paragraph>
</ListItem>
<ListItem>
<Paragraph><Run Text="Dbl-Click 'Log File' to display long/short file names"/></Paragraph>
<ListItem>
<Paragraph>
<Run Text="Dbl-Click 'Log File' to display long/short file names"/>
</Paragraph>
</ListItem>
<ListItem>
<Paragraph><Run Text="Recent File List in xml file (exe folder)"/></Paragraph>
<Paragraph>
<Run Text="Recent File List in xml file (exe folder)"/>
</Paragraph>
</ListItem>
<ListItem>
<Paragraph><Run Text="Column Sorting (click headers)"/></Paragraph>
<Paragraph>
<Run Text="Column Sorting (click headers)"/>
</Paragraph>
</ListItem>
<ListItem>
<Paragraph><Run Text="Quick Filter (click message level icon)"/></Paragraph>
<Paragraph>
<Run Text="Quick Filter (click message level icon)"/>
</Paragraph>
</ListItem>

</List>

<Paragraph><LineBreak/><Run Text="Log4Net Config file must be setup as follows:"/><LineBreak/><Italic FontSize="10"/></Paragraph>

<Paragraph>
<LineBreak/>
<Run Text="Log4Net Config file must be setup as follows:"/>
<LineBreak/>
<Italic FontSize="10"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
<Button Grid.Row="4" Height="23" x:Name="buttonOK" Width="75" Click="buttonOK_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" Content="OK"/>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,14.616,0,0"><Hyperlink Foreground="Orange" TargetName="_blank" NavigateUri="http://www.codeproject.com/KB/cs/logviewer.aspx" RequestNavigate="hyperlink_RequestNavigate"><Run Text="Original code by Ken C. Len"/></Hyperlink></TextBlock>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" Margin="0,32.616,0,29.531" d:LayoutOverrides="Height"><Hyperlink Foreground="Orange" TargetName="_blank" NavigateUri="http://www.e-naxos.com/blog" RequestNavigate="hyperlink_RequestNavigate"><Run Text="Enhanced version by Olivier Dahan. Microsoft MVP"/></Hyperlink></TextBlock>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"><Hyperlink Foreground="DarkGray" TargetName="_blank" NavigateUri="http://yourlog4netviewer.codeplex.com/" RequestNavigate="hyperlink_RequestNavigate"><Run Text="LogViewer Project on CodePlex"/></Hyperlink></TextBlock>
<Button Grid.Row="4" Height="23" x:Name="ButtonOk" Width="75" Click="buttonOK_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" Content="OK"/>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="105,15,105,0" Height="16" Width="146"><Hyperlink Foreground="Orange" TargetName="_blank" NavigateUri="http://www.codeproject.com/KB/cs/logviewer.aspx" RequestNavigate="hyperlink_RequestNavigate"><Run Text="Original code by Ken C. Len"/></Hyperlink></TextBlock>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" Margin="44,33,44,30" Width="268"><Hyperlink Foreground="Orange" TargetName="_blank" NavigateUri="http://www.e-naxos.com/blog" RequestNavigate="hyperlink_RequestNavigate"><Run Text="Enhanced version by Olivier Dahan. Microsoft MVP"/></Hyperlink></TextBlock>
<TextBlock Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold" Height="21" Margin="68,0" Width="220"><Hyperlink Foreground="DarkGray" TargetName="_blank" NavigateUri="https://github.com/odahan/LogViewerForLog4Net" RequestNavigate="hyperlink_RequestNavigate"><Run Text="LogViewer Project on GitHub"/></Hyperlink></TextBlock>

</Grid>
</Border>
Expand Down
15 changes: 7 additions & 8 deletions About.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
/*
* Project : LogViewer
* Description : Viewer for Log4Net XML logs (see About box for log4Net configuration).
* Version : 2.7
* Version : 3.0
* Modified on : 1.0 15-3-2010
* 2.1 May 2010 OD
* 2.6 26-jun-2010 OD - add quick filter on symbols, cancel filter on filter zoom/text symbol
* 2.7 --Jul-2010 OD - save window size, split position. Reset split.
* 2.x -- Open Source Project on CodePlex
* 3.0 Windows Store version OD (change from codeplex to GitHub)
*
*
* Copyrights : (c) 2010 Olivier Dahan for the enhanced version - www.e-naxos.com
* Copyrights : (c) 2010/2017 Olivier Dahan for the enhanced version & Windows Store version - www.e-naxos.com
* (c) 2009 Ken C. Len for original version
*
* LogViewer is a free software distributed on CodePlex : http://yourlog4netviewer.codeplex.com/ under the Microsoft Reciprocal License (Ms-RL)
* LogViewer is a free software distributed on GitHub under the Microsoft Reciprocal License (Ms-RL)
*
*/
#endregion
Expand Down Expand Up @@ -59,7 +60,6 @@
using System.Reflection;
using System.Windows.Documents;
using System.Windows.Navigation;
using WPF.Themes;

namespace LogViewer
{
Expand All @@ -78,7 +78,6 @@ public About()

private void window_Loaded(object sender, RoutedEventArgs e)
{
this.ApplyTheme("ExpressionDark");
var sbText = new StringBuilder();
var assembly = Assembly.GetEntryAssembly();
if (assembly != null)
Expand All @@ -90,12 +89,12 @@ private void window_Loaded(object sender, RoutedEventArgs e)
if (type == typeof(AssemblyTitleAttribute))
{
var title = (AssemblyTitleAttribute)attribute;
labelAssemblyName.Content = title.Title;
LabelAssemblyName.Content = title.Title;
}
if (type == typeof(AssemblyFileVersionAttribute))
{
var version = (AssemblyFileVersionAttribute)attribute;
labelAssemblyVersion.Content = version.Version;
LabelAssemblyVersion.Content = version.Version;
}
if (type == typeof(AssemblyCopyrightAttribute))
{
Expand All @@ -113,7 +112,7 @@ private void window_Loaded(object sender, RoutedEventArgs e)
sbText.AppendFormat("{0}\r", description.Description);
}
}
labelAssembly.Content = sbText.ToString();
LabelAssembly.Content = sbText.ToString();
}
// ReSharper disable VerbatimStringLiteralsWordIsNotInDictionary
const string text = @"<log4net>
Expand Down
2 changes: 1 addition & 1 deletion App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Application x:Class="LogViewer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
Expand Down
35 changes: 22 additions & 13 deletions App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

#endregion

using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -63,35 +62,45 @@

namespace LogViewer
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string[] _filesToLoad;

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
log.DebugFormat("Arguments passed to the application: {0}", string.Join(", ", e.Args));

DispatcherUnhandledException += App_DispatcherUnhandledException;

Log.DebugFormat("Arguments passed to the application: {0}", string.Join(", ", e.Args));
_filesToLoad = e.Args;
}

protected override void OnActivated(System.EventArgs e)
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
Log.Error("Unhandled Exception",e.Exception);
MessageBox.Show("Unhandled Exception occured and hasd been logged. App will shutdown sorry.",
"Fatal error");
}

protected override void OnActivated(System.EventArgs e)
{
base.OnActivated(e);
var window = (MainWindow as Window1);
var window = (MainWindow as MainWindow);
if (window == null)
return;
var files = _filesToLoad.Where(File.Exists).Select(f => new FileInfo(f)).ToList();
for (var i = 0; i < files.Count; i++)
{
var file = files[i];
log.DebugFormat("Merging file: \"{0}\"", file.FullName);
log.DebugFormat("File Path: \"{0}\"", file.Directory);
log.DebugFormat("File Name: \"{0}\"", file.Name);
log.DebugFormat("File Extension: \"{0}\"", file.Extension);
Log.DebugFormat("Merging file: \"{0}\"", file.FullName);
Log.DebugFormat("File Path: \"{0}\"", file.Directory);
Log.DebugFormat("File Name: \"{0}\"", file.Name);
Log.DebugFormat("File Extension: \"{0}\"", file.Extension);
window.loadFile(file.FullName, i > 0);
}
_filesToLoad = new string[0];
Expand Down
Loading