From edd6de675774832dcad82845ed0f2e69a59477a6 Mon Sep 17 00:00:00 2001 From: Dirkster99 Date: Tue, 24 Jul 2018 23:32:16 +0200 Subject: [PATCH] Added Log4Net support for all demo apps. --- source/AvalonDock.MVVMTestApp/App.config | 2 +- source/AvalonDock.TestApp/App.config | 39 +++++++++++++++++++ source/AvalonDock.TestApp/App.xaml.cs | 9 ++++- .../AvalonDock.TestApp.csproj | 7 ++++ source/AvalonDock.TestApp/packages.config | 4 ++ .../AvalonDock.WinFormsTestApp.csproj | 4 ++ source/AvalonDock.WinFormsTestApp/Program.cs | 7 ++++ source/AvalonDock.WinFormsTestApp/app.config | 33 ++++++++++++++++ .../packages.config | 4 ++ 9 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 source/AvalonDock.TestApp/App.config create mode 100644 source/AvalonDock.TestApp/packages.config create mode 100644 source/AvalonDock.WinFormsTestApp/packages.config diff --git a/source/AvalonDock.MVVMTestApp/App.config b/source/AvalonDock.MVVMTestApp/App.config index 7708c15b..23b17221 100644 --- a/source/AvalonDock.MVVMTestApp/App.config +++ b/source/AvalonDock.MVVMTestApp/App.config @@ -9,7 +9,7 @@ http://yourlog4netviewer.codeplex.com/ --> - + diff --git a/source/AvalonDock.TestApp/App.config b/source/AvalonDock.TestApp/App.config new file mode 100644 index 00000000..bd42cb1e --- /dev/null +++ b/source/AvalonDock.TestApp/App.config @@ -0,0 +1,39 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/AvalonDock.TestApp/App.xaml.cs b/source/AvalonDock.TestApp/App.xaml.cs index c62db45a..536ab24a 100644 --- a/source/AvalonDock.TestApp/App.xaml.cs +++ b/source/AvalonDock.TestApp/App.xaml.cs @@ -23,6 +23,8 @@ This program is provided to you under the terms of the New BSD using System.Windows.Interop; using System.Windows.Input; using System.Diagnostics; +using log4net.Config; +using log4net; namespace AvalonDock.TestApp { @@ -31,8 +33,13 @@ namespace AvalonDock.TestApp /// public partial class App : Application { - public App() + protected static ILog Logger; // Enable debugging via Log4Net + + static App() { + XmlConfigurator.Configure(); // Read Log4Net config from App.config file + Logger = LogManager.GetLogger("default"); + //Dispatcher.Thread.CurrentUICulture = new System.Globalization.CultureInfo("ru"); } } diff --git a/source/AvalonDock.TestApp/AvalonDock.TestApp.csproj b/source/AvalonDock.TestApp/AvalonDock.TestApp.csproj index 8760009e..d5678d69 100644 --- a/source/AvalonDock.TestApp/AvalonDock.TestApp.csproj +++ b/source/AvalonDock.TestApp/AvalonDock.TestApp.csproj @@ -72,6 +72,9 @@ MinimumRecommendedRules.ruleset + + ..\packages\log4net.2.0.8\lib\net40-client\log4net.dll + @@ -140,6 +143,10 @@ Xceed.Wpf.AvalonDock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/AvalonDock.WinFormsTestApp/packages.config b/source/AvalonDock.WinFormsTestApp/packages.config new file mode 100644 index 00000000..c700faaf --- /dev/null +++ b/source/AvalonDock.WinFormsTestApp/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file