From 3fe021949a14dd85f36644e1aa1e43336021056a Mon Sep 17 00:00:00 2001 From: Ben Wallis Date: Tue, 9 May 2017 21:41:51 +0100 Subject: [PATCH] Replaced AutoMapper usage for ItemFilterBlockGroup viewmodel mapping with constructor overload Updated NuGet packages --- .../Filtration.Common.Tests.csproj | 10 +- Filtration.Common.Tests/packages.config | 4 +- Filtration.Common/Filtration.Common.csproj | 4 +- Filtration.Common/packages.config | 2 +- ...ration.ItemFilterPreview.Data.Tests.csproj | 5 +- .../packages.config | 2 +- .../Filtration.ItemFilterPreview.Tests.csproj | 20 +- Filtration.ItemFilterPreview.Tests/app.config | 2 +- .../packages.config | 6 +- .../Filtration.ItemFilterPreview.csproj | 10 +- Filtration.ItemFilterPreview/packages.config | 4 +- .../Filtration.ObjectModel.Tests.csproj | 10 +- Filtration.ObjectModel.Tests/packages.config | 4 +- .../IItemFilterBlockItem.cs | 2 - .../Filtration.Parser.Tests.csproj | 20 +- Filtration.Parser.Tests/packages.config | 6 +- Filtration.Parser/Filtration.Parser.csproj | 5 +- Filtration.Parser/packages.config | 2 +- Filtration.Tests/Filtration.Tests.csproj | 20 +- Filtration.Tests/app.config | 2 +- Filtration.Tests/packages.config | 6 +- .../Filtration.ThemeEditor.Tests.csproj | 10 +- Filtration.ThemeEditor.Tests/packages.config | 4 +- .../Filtration.ThemeEditor.csproj | 12 +- Filtration.ThemeEditor/packages.config | 6 +- Filtration/App.config | 4 +- Filtration/App.xaml.cs | 34 +- Filtration/Filtration.csproj | 22 +- Filtration/NLog.xsd | 671 ++++++++++++++---- Filtration/Services/StaticDataService.cs | 2 - Filtration/Utilities/AutoMapperHelpers.cs | 32 - Filtration/Utilities/BlockGroupMapper.cs | 26 - .../ItemFilterBlockGroupViewModel.cs | 36 + .../ToolPanes/BlockGroupBrowserViewModel.cs | 18 +- .../WindsorInstallers/ServicesInstaller.cs | 6 - Filtration/packages.config | 10 +- 36 files changed, 676 insertions(+), 363 deletions(-) delete mode 100644 Filtration/Utilities/AutoMapperHelpers.cs delete mode 100644 Filtration/Utilities/BlockGroupMapper.cs diff --git a/Filtration.Common.Tests/Filtration.Common.Tests.csproj b/Filtration.Common.Tests/Filtration.Common.Tests.csproj index f5eaeec..4cef0e6 100644 --- a/Filtration.Common.Tests/Filtration.Common.Tests.csproj +++ b/Filtration.Common.Tests/Filtration.Common.Tests.csproj @@ -35,13 +35,11 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.Common.Tests/packages.config b/Filtration.Common.Tests/packages.config index c5d64ff..4b97194 100644 --- a/Filtration.Common.Tests/packages.config +++ b/Filtration.Common.Tests/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/Filtration.Common/Filtration.Common.csproj b/Filtration.Common/Filtration.Common.csproj index 3e0716c..13f3165 100644 --- a/Filtration.Common/Filtration.Common.csproj +++ b/Filtration.Common/Filtration.Common.csproj @@ -35,8 +35,8 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll + + ..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll diff --git a/Filtration.Common/packages.config b/Filtration.Common/packages.config index 088a524..0173a29 100644 --- a/Filtration.Common/packages.config +++ b/Filtration.Common/packages.config @@ -1,7 +1,7 @@  - + \ No newline at end of file diff --git a/Filtration.ItemFilterPreview.Data.Tests/Filtration.ItemFilterPreview.Data.Tests.csproj b/Filtration.ItemFilterPreview.Data.Tests/Filtration.ItemFilterPreview.Data.Tests.csproj index 5869c8a..30c7e22 100644 --- a/Filtration.ItemFilterPreview.Data.Tests/Filtration.ItemFilterPreview.Data.Tests.csproj +++ b/Filtration.ItemFilterPreview.Data.Tests/Filtration.ItemFilterPreview.Data.Tests.csproj @@ -46,9 +46,8 @@ ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll True - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.ItemFilterPreview.Data.Tests/packages.config b/Filtration.ItemFilterPreview.Data.Tests/packages.config index 5229672..f051d19 100644 --- a/Filtration.ItemFilterPreview.Data.Tests/packages.config +++ b/Filtration.ItemFilterPreview.Data.Tests/packages.config @@ -1,7 +1,7 @@  - + diff --git a/Filtration.ItemFilterPreview.Tests/Filtration.ItemFilterPreview.Tests.csproj b/Filtration.ItemFilterPreview.Tests/Filtration.ItemFilterPreview.Tests.csproj index e6f2a41..e82122d 100644 --- a/Filtration.ItemFilterPreview.Tests/Filtration.ItemFilterPreview.Tests.csproj +++ b/Filtration.ItemFilterPreview.Tests/Filtration.ItemFilterPreview.Tests.csproj @@ -46,21 +46,17 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.ItemFilterPreview.Tests/app.config b/Filtration.ItemFilterPreview.Tests/app.config index c1fa1bd..0c4712b 100644 --- a/Filtration.ItemFilterPreview.Tests/app.config +++ b/Filtration.ItemFilterPreview.Tests/app.config @@ -8,7 +8,7 @@ - + diff --git a/Filtration.ItemFilterPreview.Tests/packages.config b/Filtration.ItemFilterPreview.Tests/packages.config index a76be05..24885ed 100644 --- a/Filtration.ItemFilterPreview.Tests/packages.config +++ b/Filtration.ItemFilterPreview.Tests/packages.config @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file diff --git a/Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj b/Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj index f78f69b..88676a1 100644 --- a/Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj +++ b/Filtration.ItemFilterPreview/Filtration.ItemFilterPreview.csproj @@ -40,9 +40,8 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll - True + + ..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll @@ -60,9 +59,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll True - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll diff --git a/Filtration.ItemFilterPreview/packages.config b/Filtration.ItemFilterPreview/packages.config index 7255210..500f87c 100644 --- a/Filtration.ItemFilterPreview/packages.config +++ b/Filtration.ItemFilterPreview/packages.config @@ -1,8 +1,8 @@  - + - + \ No newline at end of file diff --git a/Filtration.ObjectModel.Tests/Filtration.ObjectModel.Tests.csproj b/Filtration.ObjectModel.Tests/Filtration.ObjectModel.Tests.csproj index 0af02c0..69dd6ef 100644 --- a/Filtration.ObjectModel.Tests/Filtration.ObjectModel.Tests.csproj +++ b/Filtration.ObjectModel.Tests/Filtration.ObjectModel.Tests.csproj @@ -35,13 +35,11 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.ObjectModel.Tests/packages.config b/Filtration.ObjectModel.Tests/packages.config index c5d64ff..4b97194 100644 --- a/Filtration.ObjectModel.Tests/packages.config +++ b/Filtration.ObjectModel.Tests/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/Filtration.ObjectModel/IItemFilterBlockItem.cs b/Filtration.ObjectModel/IItemFilterBlockItem.cs index 021201e..ec693d0 100644 --- a/Filtration.ObjectModel/IItemFilterBlockItem.cs +++ b/Filtration.ObjectModel/IItemFilterBlockItem.cs @@ -5,8 +5,6 @@ namespace Filtration.ObjectModel { public interface IItemFilterBlockItem : INotifyPropertyChanged { - event PropertyChangedEventHandler PropertyChanged; - string PrefixText { get; } string OutputText { get; } string DisplayHeading { get; } diff --git a/Filtration.Parser.Tests/Filtration.Parser.Tests.csproj b/Filtration.Parser.Tests/Filtration.Parser.Tests.csproj index ee5be14..216294f 100644 --- a/Filtration.Parser.Tests/Filtration.Parser.Tests.csproj +++ b/Filtration.Parser.Tests/Filtration.Parser.Tests.csproj @@ -40,21 +40,17 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.Parser.Tests/packages.config b/Filtration.Parser.Tests/packages.config index ded3f06..59fe830 100644 --- a/Filtration.Parser.Tests/packages.config +++ b/Filtration.Parser.Tests/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/Filtration.Parser/Filtration.Parser.csproj b/Filtration.Parser/Filtration.Parser.csproj index c8291d2..2a8d160 100644 --- a/Filtration.Parser/Filtration.Parser.csproj +++ b/Filtration.Parser/Filtration.Parser.csproj @@ -35,9 +35,8 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll - True + + ..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll diff --git a/Filtration.Parser/packages.config b/Filtration.Parser/packages.config index fce0733..89d6418 100644 --- a/Filtration.Parser/packages.config +++ b/Filtration.Parser/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Filtration.Tests/Filtration.Tests.csproj b/Filtration.Tests/Filtration.Tests.csproj index 0e6db22..4d15320 100644 --- a/Filtration.Tests/Filtration.Tests.csproj +++ b/Filtration.Tests/Filtration.Tests.csproj @@ -35,21 +35,17 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.dll - - ..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll - True + + ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.Tests/app.config b/Filtration.Tests/app.config index 576244b..15eab9e 100644 --- a/Filtration.Tests/app.config +++ b/Filtration.Tests/app.config @@ -8,7 +8,7 @@ - + diff --git a/Filtration.Tests/packages.config b/Filtration.Tests/packages.config index ded3f06..59fe830 100644 --- a/Filtration.Tests/packages.config +++ b/Filtration.Tests/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/Filtration.ThemeEditor.Tests/Filtration.ThemeEditor.Tests.csproj b/Filtration.ThemeEditor.Tests/Filtration.ThemeEditor.Tests.csproj index da3c05f..88b49fc 100644 --- a/Filtration.ThemeEditor.Tests/Filtration.ThemeEditor.Tests.csproj +++ b/Filtration.ThemeEditor.Tests/Filtration.ThemeEditor.Tests.csproj @@ -35,13 +35,11 @@ ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Moq.4.5.21\lib\net45\Moq.dll - True + + ..\packages\Moq.4.5.30\lib\net45\Moq.dll - - ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll - True + + ..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll diff --git a/Filtration.ThemeEditor.Tests/packages.config b/Filtration.ThemeEditor.Tests/packages.config index c5d64ff..4b97194 100644 --- a/Filtration.ThemeEditor.Tests/packages.config +++ b/Filtration.ThemeEditor.Tests/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/Filtration.ThemeEditor/Filtration.ThemeEditor.csproj b/Filtration.ThemeEditor/Filtration.ThemeEditor.csproj index 7af0956..0cc1a04 100644 --- a/Filtration.ThemeEditor/Filtration.ThemeEditor.csproj +++ b/Filtration.ThemeEditor/Filtration.ThemeEditor.csproj @@ -31,16 +31,15 @@ 4 - - ..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll - True + + ..\packages\AutoMapper.6.0.2\lib\net45\AutoMapper.dll ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll + + ..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll @@ -58,8 +57,7 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - ..\packages\NLog.4.3.7\lib\net45\NLog.dll - True + ..\packages\NLog.4.4.9\lib\net45\NLog.dll diff --git a/Filtration.ThemeEditor/packages.config b/Filtration.ThemeEditor/packages.config index 5f23e20..c5e8141 100644 --- a/Filtration.ThemeEditor/packages.config +++ b/Filtration.ThemeEditor/packages.config @@ -1,10 +1,10 @@  - + - + - + \ No newline at end of file diff --git a/Filtration/App.config b/Filtration/App.config index 9be4e10..ebcbc98 100644 --- a/Filtration/App.config +++ b/Filtration/App.config @@ -4,7 +4,7 @@
- +
@@ -41,7 +41,7 @@ - + diff --git a/Filtration/App.xaml.cs b/Filtration/App.xaml.cs index 19c8f2e..6690e58 100644 --- a/Filtration/App.xaml.cs +++ b/Filtration/App.xaml.cs @@ -36,34 +36,18 @@ namespace Filtration .Single(); _container.Kernel.ComponentModelBuilder.RemoveContributor(propInjector); - + _container.AddFacility(); _container.Install(FromAssembly.InThisApplication()); _container.Install(FromAssembly.Named("Filtration.Parser")); // Not directly referenced so manually call its installers - - Mapper.Configuration.ConstructServicesUsing(_container.Resolve); - - Mapper.CreateMap() - .ForMember(destination => destination.ChildGroups, options => options.ResolveUsing( - delegate(ResolutionResult resolutionResult) - { - var context = resolutionResult.Context; - var showAdvanced = (bool) context.Options.Items["showAdvanced"]; - var group = (ItemFilterBlockGroup) context.SourceValue; - if (showAdvanced) - return group.ChildGroups; - else - return group.ChildGroups.Where(c => c.Advanced == false); - })) - .ForMember(dest => dest.SourceBlockGroup, - opts => opts.MapFrom(from => from)) - .ForMember(dest => dest.IsExpanded, - opts => opts.UseValue(false)); - - Mapper.CreateMap().ConstructUsingServiceLocator(); - Mapper.CreateMap().ReverseMap(); - Mapper.CreateMap(); + Mapper.Initialize(cfg => + { + cfg.ConstructServicesUsing(_container.Resolve); + cfg.CreateMap().ConstructUsingServiceLocator(); + cfg.CreateMap().ReverseMap(); + cfg.CreateMap(); + }); Mapper.AssertConfigurationIsValid(); @@ -73,7 +57,7 @@ namespace Filtration var updateCheckService = _container.Resolve(); updateCheckService.CheckForUpdates(); } - + private static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { Logger.Fatal(e.Exception); diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj index c056a2f..49144f9 100644 --- a/Filtration/Filtration.csproj +++ b/Filtration/Filtration.csproj @@ -42,20 +42,18 @@ Resources\filtration.ico - - ..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll - True + + ..\packages\AutoMapper.6.0.2\lib\net45\AutoMapper.dll ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll True - - ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll + + ..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll - - ..\packages\ControlzEx.2.1.2.3\lib\net45\ControlzEx.dll - True + + ..\packages\ControlzEx.2.2.0.4\lib\net45\ControlzEx.dll ..\packages\Fluent.Ribbon.4.0.3.394\lib\net45\Fluent.dll @@ -79,8 +77,7 @@ - ..\packages\NLog.4.3.7\lib\net45\NLog.dll - True + ..\packages\NLog.4.4.9\lib\net45\NLog.dll @@ -94,8 +91,7 @@ - ..\packages\ControlzEx.2.1.2.3\lib\net45\System.Windows.Interactivity.dll - True + ..\packages\ControlzEx.2.2.0.4\lib\net45\System.Windows.Interactivity.dll @@ -185,8 +181,6 @@ ThemeComponentSelectionControl.xaml - - diff --git a/Filtration/NLog.xsd b/Filtration/NLog.xsd index c489255..c9cbd05 100644 --- a/Filtration/NLog.xsd +++ b/Filtration/NLog.xsd @@ -42,12 +42,32 @@ - Pass NLog internal exceptions to the application. Default value is: false. + Throw an exception when there is an internal error. Default value is: false. + + + + + Throw an exception when there is a configuration error. If not set, determined by throwExceptions. + + + + + Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false. - Write internal NLog messages to the the System.Diagnostics.Trace. Default value is: false + Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false. + + + + + Write timestamps for internal NLog messages. Default value is: true. + + + + + Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false. @@ -174,7 +194,7 @@ - Name of the file to be included. The name is relative to the name of the current config file. + Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file. @@ -244,41 +264,17 @@ - - - - - - - - - - - Name of the target. - - - - - Layout used to format log messages. - - - - - Indicates whether to add <!-- --> comments around all written texts. - - - - - + + @@ -290,6 +286,11 @@ Number of log events that should be processed in a batch by the lazy writer thread. + + + Limit of full s to write before yielding into Performance is better when writing many small batches, than writing a single large batch + + Action to be taken when the lazy writer thread request queue count exceeds the set limit. @@ -305,6 +306,11 @@ Time in milliseconds to sleep between batches. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -320,12 +326,30 @@ + + + Name of the target. + + + Delay the flush until the LogEvent has been confirmed as written + + + + + Condition expression. Log events who meet this condition will cause a flush on the wrapped target. + + + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -337,6 +361,7 @@ + @@ -358,6 +383,11 @@ Indicates whether to use sliding timeout. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -368,23 +398,26 @@ + + - - - - - + + + + + + @@ -401,6 +434,11 @@ Instance of that is used to format log messages. + + + End of line value if a newline is appended at the end of log message . + + Maximum message size in bytes. @@ -421,6 +459,11 @@ Action that should be taken if the message is larger than maxMessageSize. + + + Maximum current connections. 0 = no maximum. + + Indicates whether to keep connection open whenever possible. @@ -431,11 +474,6 @@ Size of the connection cache (number of connections which are kept alive). - - - Maximum current connections. 0 = no maximum. - - Network address. @@ -446,19 +484,24 @@ Maximum queue size. + + + Indicates whether to include stack contents. + + Indicates whether to include source info (file name and line number) in the information sent over the network. - + - NDC item separator. + Indicates whether to include NLog-specific extensions to log4j schema. - + - Indicates whether to include stack contents. + Indicates whether to include dictionary contents. @@ -471,16 +514,21 @@ AppInfo field. By default it's the friendly name of the current AppDomain. - + - Indicates whether to include NLog-specific extensions to log4j schema. + NDC item separator. - + Indicates whether to include dictionary contents. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -525,8 +573,10 @@ + + @@ -553,6 +603,11 @@ Indicates whether to use default row highlighting rules. + + + Indicates whether to auto-check if the console is available. - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + The encoding for writing messages to the . @@ -563,6 +618,11 @@ Indicates whether the error stream (stderr) should be used instead of the output stream (stdout). + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -664,7 +724,9 @@ + + @@ -691,11 +753,21 @@ Indicates whether to send the log messages to the standard error instead of the standard output. + + + Indicates whether to auto-check if the console is available - Disables console writing if Environment.UserInteractive = False (Windows Service) - Disables console writing if Console Standard Input is not available (Non-Console-App) + + The encoding for writing messages to the . + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -704,77 +776,83 @@ - - - - - - - - + + + + + + + + + + - Name of the target. - - - Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. - - - - - Name of the connection string (as specified in <connectionStrings> configuration section. - - - - - Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. - - - - - Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. - - - - - Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. - - - - - Name of the database provider. - - - - - Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. - - - - - Indicates whether to keep the database connection open between the log events. - - Obsolete - value will be ignored! The logging code always runs outside of transaction. Gets or sets a value indicating whether to use database transactions. Some data providers require this. + + + Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string. + + + + + Name of the database provider. + + + + + Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string. + + + + + Indicates whether to keep the database connection open between the log events. + + + + + Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string. + + + + + Name of the connection string (as specified in <connectionStrings> configuration section. + + + + + Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase. + + + + + Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string. + + Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Text of the SQL command to be run on each log level. @@ -866,6 +944,7 @@ + @@ -887,6 +966,11 @@ Footer. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -896,6 +980,7 @@ + @@ -907,6 +992,11 @@ Layout used to format log messages. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -924,6 +1014,7 @@ + @@ -975,6 +1066,11 @@ Message length limit to write to the Event Log. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -991,6 +1087,7 @@ + @@ -1002,6 +1099,11 @@ Indicates whether to return to the first target after any successful write. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1022,7 +1124,12 @@ + + + + + @@ -1032,15 +1139,16 @@ - + + + - @@ -1104,7 +1212,12 @@ - Gets or set a value indicating whether a managed file stream is forced, instead of used the native implementation. + Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation. + + + + + Is the an absolute or relative path? @@ -1112,6 +1225,26 @@ Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong. + + + Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write + + + + + Is the an absolute or relative path? + + + + + Value indicationg whether file creation calls should be synchronized by a system global mutex. + + + + + Indicates whether the footer should be written only when the file is archived. + + Name of the file to write to. @@ -1157,9 +1290,9 @@ Indicates whether concurrent writes to the log file by multiple processes on the same host. - + - Delay in milliseconds to wait before attempting to write to the file again. + Indicates whether to keep log file open instead of opening and closing it on each logging event. @@ -1182,6 +1315,11 @@ Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Log file buffer size in bytes. @@ -1192,16 +1330,16 @@ Indicates whether to automatically flush the file buffers after each log message. + + + Delay in milliseconds to wait before attempting to write to the file again. + + Number of times the write is appended on the file before NLog discards the log message. - - - Indicates whether to keep log file open instead of opening and closing it on each logging event. - - @@ -1221,6 +1359,20 @@ + + + + + + + + + + + + + + @@ -1249,6 +1401,7 @@ + @@ -1260,6 +1413,11 @@ Condition expression. Log events who meet this condition will be forwarded to the wrapped target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1275,6 +1433,7 @@ + @@ -1316,6 +1475,11 @@ Username to change context to. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1342,6 +1506,38 @@ + + + + + + + + + + + + Name of the target. + + + + + Interval in which messages will be written up to the number of messages. + + + + + Maximum allowed number of messages written per . + + + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + + + + @@ -1354,6 +1550,7 @@ + @@ -1390,6 +1587,11 @@ Indicates whether to use binary message encoding. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1397,6 +1599,7 @@ + @@ -1409,11 +1612,16 @@ Name of the parameter. - + Type of the parameter. + + + Type of the parameter. Obsolete alias for + + @@ -1432,9 +1640,10 @@ - - + + + @@ -1510,9 +1719,9 @@ Sender's email address (e.g. joe@domain.com). - + - Indicates whether NewLine characters in the body should be replaced with tags. + Indicates the SMTP client timeout. @@ -1520,9 +1729,14 @@ Priority used for sending mails. - + - Indicates the SMTP client timeout. + Indicates whether NewLine characters in the body should be replaced with tags. + + + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit @@ -1593,6 +1807,7 @@ + @@ -1604,6 +1819,11 @@ Layout used to format log messages. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1616,6 +1836,7 @@ + @@ -1646,6 +1867,11 @@ Indicates whether to check if a queue exists before writing to it. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Indicates whether to create the queue if it doesn't exists. @@ -1677,6 +1903,7 @@ + @@ -1693,6 +1920,11 @@ Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1703,6 +1935,7 @@ + @@ -1712,6 +1945,7 @@ + @@ -1728,6 +1962,11 @@ Encoding to be used. + + + End of line value if a newline is appended at the end of log message . + + Maximum message size in bytes. @@ -1773,6 +2012,11 @@ Maximum queue size. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1783,23 +2027,26 @@ + + - - - - - + + + + + + @@ -1816,6 +2063,11 @@ Instance of that is used to format log messages. + + + End of line value if a newline is appended at the end of log message . + + Maximum message size in bytes. @@ -1836,6 +2088,11 @@ Action that should be taken if the message is larger than maxMessageSize. + + + Maximum current connections. 0 = no maximum. + + Indicates whether to keep connection open whenever possible. @@ -1846,11 +2103,6 @@ Size of the connection cache (number of connections which are kept alive). - - - Maximum current connections. 0 = no maximum. - - Network address. @@ -1861,29 +2113,14 @@ Maximum queue size. - - - Indicates whether to include source info (file name and line number) in the information sent over the network. - - - - - NDC item separator. - - Indicates whether to include stack contents. - + - Indicates whether to include call site (class and method name) in the information sent over the network. - - - - - AppInfo field. By default it's the friendly name of the current AppDomain. + Indicates whether to include source info (file name and line number) in the information sent over the network. @@ -1896,6 +2133,31 @@ Indicates whether to include dictionary contents. + + + Indicates whether to include call site (class and method name) in the information sent over the network. + + + + + AppInfo field. By default it's the friendly name of the current AppDomain. + + + + + NDC item separator. + + + + + Indicates whether to include dictionary contents. + + + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1906,6 +2168,7 @@ + @@ -1922,6 +2185,11 @@ Indicates whether to perform layout calculation. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1931,6 +2199,7 @@ + @@ -1942,6 +2211,11 @@ Layout used to format log messages. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -1957,6 +2231,7 @@ + @@ -1998,6 +2273,11 @@ Performance counter instance name. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2040,6 +2320,7 @@ + @@ -2051,6 +2332,11 @@ Default filter to be applied when no specific rule matches. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2075,12 +2361,18 @@ + Name of the target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2089,6 +2381,7 @@ + @@ -2096,6 +2389,11 @@ Name of the target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Number of times to repeat each log message. @@ -2109,6 +2407,7 @@ + @@ -2117,6 +2416,11 @@ Name of the target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Number of retries that should be attempted on the wrapped target in case of a failure. @@ -2135,12 +2439,18 @@ + Name of the target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2149,12 +2459,18 @@ + Name of the target. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2164,6 +2480,7 @@ + @@ -2175,6 +2492,11 @@ Layout used to format log messages. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + @@ -2185,11 +2507,16 @@ + + + + + @@ -2201,11 +2528,26 @@ Should we include the BOM (Byte-order-mark) for UTF? Influences the property. This will only work for UTF-8. + + + Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit + + Encoding. + + + Value whether escaping be done according to the old NLog style (Very non-standard) + + + + + Value whether escaping be done according to Rfc3986 (Supports Internationalized Resource Identifiers - IRIs) + + Web service method name. Only used with Soap. @@ -2226,6 +2568,16 @@ Web service URL. + + + Name of the root XML element, if POST of XML document chosen. If so, this property must not be null. (see and ). + + + + + (optional) root namespace of the XML document, if POST of XML document chosen. (see and ). + + @@ -2235,6 +2587,8 @@ + + @@ -2345,9 +2699,21 @@ + + + + + List of property names to exclude when is true + + + + + Option to include all properties from the log events + + Option to render the empty object value {} @@ -2364,6 +2730,7 @@ + @@ -2372,6 +2739,11 @@ Determines wether or not this attribute will be Json encoded. + + + Indicates whether to escape non-ascii characters + + Layout that will be rendered as the attribute's value. @@ -2412,7 +2784,26 @@ - + + + + + + + + Option to include all properties from the log events + + + + + Indicates whether to include contents of the dictionary. + + + + + Indicates whether to include contents of the dictionary. + + diff --git a/Filtration/Services/StaticDataService.cs b/Filtration/Services/StaticDataService.cs index 36c5356..0d9467d 100644 --- a/Filtration/Services/StaticDataService.cs +++ b/Filtration/Services/StaticDataService.cs @@ -2,10 +2,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Windows; using Filtration.Common.Services; using Filtration.Common.Utilities; -using Filtration.Utilities; namespace Filtration.Services { diff --git a/Filtration/Utilities/AutoMapperHelpers.cs b/Filtration/Utilities/AutoMapperHelpers.cs deleted file mode 100644 index 73b46e8..0000000 --- a/Filtration/Utilities/AutoMapperHelpers.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Linq; -using Filtration.ViewModels; - -namespace Filtration.Utilities -{ - internal class AutoMapperHelpers - { - public static void ItemFilterBlockGroupViewModelPostMap(ItemFilterBlockGroupViewModel viewModel) - { - foreach (var childViewModel in viewModel.ChildGroups) - { - ItemFilterBlockGroupViewModelPostMap(childViewModel); - } - - if (viewModel.ChildGroups.Count > 0) - { - if (viewModel.ChildGroups.All(g => g.IsChecked == true)) - { - viewModel.IsChecked = true; - } - else if (viewModel.ChildGroups.Any(g => g.IsChecked == true || g.IsChecked == null)) - { - viewModel.IsChecked = null; - } - else - { - viewModel.IsChecked = false; - } - } - } - } -} diff --git a/Filtration/Utilities/BlockGroupMapper.cs b/Filtration/Utilities/BlockGroupMapper.cs deleted file mode 100644 index 267f376..0000000 --- a/Filtration/Utilities/BlockGroupMapper.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.ObjectModel; -using System.Linq; -using AutoMapper; -using Filtration.ObjectModel; -using Filtration.ViewModels; - -namespace Filtration.Utilities -{ - internal interface IBlockGroupMapper - { - ObservableCollection MapBlockGroupsToViewModels( - ObservableCollection blockGroups, bool showAdvanced); - } - - internal class BlockGroupMapper : IBlockGroupMapper - { - public ObservableCollection MapBlockGroupsToViewModels( - ObservableCollection blockGroups, bool showAdvanced) - { - - var mappedViewModels = Mapper.Map>(blockGroups, opts => opts.Items["showAdvanced"] = showAdvanced); - AutoMapperHelpers.ItemFilterBlockGroupViewModelPostMap(mappedViewModels.First()); - return mappedViewModels.First().ChildGroups; - } - } -} diff --git a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs index b3c8132..54b7243 100644 --- a/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs +++ b/Filtration/ViewModels/ItemFilterBlockGroupViewModel.cs @@ -18,6 +18,42 @@ namespace Filtration.ViewModels ChildGroups = new ObservableCollection(); } + public ItemFilterBlockGroupViewModel(ItemFilterBlockGroup itemFilterBlockGroup, bool showAdvanced, ItemFilterBlockGroupViewModel parent) + { + GroupName = itemFilterBlockGroup.GroupName; + ParentGroup = parent; + Advanced = itemFilterBlockGroup.Advanced; + SourceBlockGroup = itemFilterBlockGroup; + IsChecked = itemFilterBlockGroup.IsChecked; + + ChildGroups = new ObservableCollection(); + foreach (var childGroup in itemFilterBlockGroup.ChildGroups.Where(c => showAdvanced || !c.Advanced)) + { + ChildGroups.Add(new ItemFilterBlockGroupViewModel(childGroup, showAdvanced, this)); + } + + if (ChildGroups.Any()) + { + SetIsCheckedBasedOnChildGroups(); + } + } + + private void SetIsCheckedBasedOnChildGroups() + { + if (ChildGroups.All(g => g.IsChecked == true)) + { + IsChecked = true; + } + else if (ChildGroups.Any(g => g.IsChecked == true || g.IsChecked == null)) + { + IsChecked = null; + } + else + { + IsChecked = false; + } + } + public string GroupName { get; internal set; } public ItemFilterBlockGroupViewModel ParentGroup { get; internal set; } public ObservableCollection ChildGroups { get; internal set; } diff --git a/Filtration/ViewModels/ToolPanes/BlockGroupBrowserViewModel.cs b/Filtration/ViewModels/ToolPanes/BlockGroupBrowserViewModel.cs index 92d9152..a13f3c4 100644 --- a/Filtration/ViewModels/ToolPanes/BlockGroupBrowserViewModel.cs +++ b/Filtration/ViewModels/ToolPanes/BlockGroupBrowserViewModel.cs @@ -1,7 +1,7 @@ using System; using System.Collections.ObjectModel; +using System.Linq; using System.Windows.Media.Imaging; -using Filtration.Utilities; using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Messaging; @@ -15,13 +15,11 @@ namespace Filtration.ViewModels.ToolPanes internal class BlockGroupBrowserViewModel : ToolViewModel, IBlockGroupBrowserViewModel { - private readonly IBlockGroupMapper _blockGroupMapper; private ObservableCollection _blockGroupViewModelViewModels; private ItemFilterBlockGroupViewModel _selectedBlockGroupViewModel; - public BlockGroupBrowserViewModel(IBlockGroupMapper blockGroupMapper) : base("Block Group Browser") + public BlockGroupBrowserViewModel() : base("Block Group Browser") { - _blockGroupMapper = blockGroupMapper; FilterToSelectedBlockGroupCommand = new RelayCommand(OnFilterToSelectedBlockGroupCommand, () => SelectedBlockGroupViewModel != null); ContentId = ToolContentId; @@ -60,7 +58,7 @@ namespace Filtration.ViewModels.ToolPanes public ItemFilterBlockGroupViewModel SelectedBlockGroupViewModel { - get { return _selectedBlockGroupViewModel; } + get => _selectedBlockGroupViewModel; set { _selectedBlockGroupViewModel = value; @@ -73,7 +71,7 @@ namespace Filtration.ViewModels.ToolPanes public ObservableCollection BlockGroupViewModels { - get { return _blockGroupViewModelViewModels; } + get => _blockGroupViewModelViewModels; private set { _blockGroupViewModelViewModels = value; @@ -94,9 +92,11 @@ namespace Filtration.ViewModels.ToolPanes private ObservableCollection RebuildBlockGroupViewModels(bool showAdvanced) { - return - _blockGroupMapper.MapBlockGroupsToViewModels( - AvalonDockWorkspaceViewModel.ActiveScriptViewModel.Script.ItemFilterBlockGroups, showAdvanced); + // This assumes that there will only ever be a single root node. + return new ObservableCollection + ( + new ItemFilterBlockGroupViewModel(AvalonDockWorkspaceViewModel.ActiveScriptViewModel.Script.ItemFilterBlockGroups.First(), showAdvanced, null).ChildGroups + ); } private void OnFilterToSelectedBlockGroupCommand() diff --git a/Filtration/WindsorInstallers/ServicesInstaller.cs b/Filtration/WindsorInstallers/ServicesInstaller.cs index ec3b2e4..d96e5a1 100644 --- a/Filtration/WindsorInstallers/ServicesInstaller.cs +++ b/Filtration/WindsorInstallers/ServicesInstaller.cs @@ -2,7 +2,6 @@ using Castle.MicroKernel.SubSystems.Configuration; using Castle.Windsor; using Filtration.Services; -using Filtration.Utilities; namespace Filtration.WindsorInstallers { @@ -20,11 +19,6 @@ namespace Filtration.WindsorInstallers .ImplementedBy() .LifeStyle.Singleton); - container.Register( - Component.For() - .ImplementedBy() - .LifeStyle.Singleton); - container.Register( Component.For() .ImplementedBy() diff --git a/Filtration/packages.config b/Filtration/packages.config index da3f499..d24e04a 100644 --- a/Filtration/packages.config +++ b/Filtration/packages.config @@ -1,17 +1,17 @@  - + - + - + - + - + \ No newline at end of file