From 8c8a98e4b3daa9b3cf2141d06cb373e9ed925799 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 12 Dec 2018 15:58:00 +0100 Subject: [PATCH] Updated MahApps.Metro and other dependencies, added an initial azure-pipelines.yml and removed unneeded building of .nupkg on every build. Also removed all the project references of all projects which are not directly needed (Greenshot.Addon.InternetExplorer is still needed), and when these are build the output is xcopied to the Greenshot solution bin directories so they can be picked up. --- src/NuGet.Config => NuGet.Config | 3 + azure-pipelines.yml | 54 +++++++++++ src/Directory.Build.props | 16 ++- src/Greenshot.Addon.Box/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Box.csproj | 6 +- .../FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Confluence.csproj | 6 +- src/Greenshot.Addon.Dropbox/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Dropbox.csproj | 6 +- .../FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.ExternalCommand.csproj | 6 +- src/Greenshot.Addon.Flickr/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Flickr.csproj | 6 +- .../FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.GooglePhotos.csproj | 6 +- src/Greenshot.Addon.Imgur/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Imgur.csproj | 8 +- src/Greenshot.Addon.Jira/FodyWeavers.xsd | 97 ++++++++++++++++++- .../Greenshot.Addon.Jira.csproj | 6 +- .../Drawing/TextContainer.cs | 3 + .../FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.LegacyEditor.csproj | 6 +- src/Greenshot.Addon.Lutim/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Lutim.csproj | 8 +- src/Greenshot.Addon.OCR/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.OCR.csproj | 6 +- .../Greenshot.Addon.OcrCommand.csproj | 1 + src/Greenshot.Addon.OcrCommand/Program.cs | 4 +- src/Greenshot.Addon.Office/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Office.csproj | 6 +- src/Greenshot.Addon.OneDrive/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.OneDrive.csproj | 8 +- .../FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Photobucket.csproj | 6 +- src/Greenshot.Addon.Tfs/FodyWeavers.xsd | 11 ++- .../Greenshot.Addon.Tfs.csproj | 8 +- src/Greenshot.Addon.Tfs/TfsClient.cs | 1 + .../Greenshot.Addon.Win10.csproj | 4 +- src/Greenshot.Addons/FodyWeavers.xsd | 11 ++- src/Greenshot.Addons/Greenshot.Addons.csproj | 10 +- src/Greenshot.Gfx/Greenshot.Gfx.csproj | 2 +- src/Greenshot.Tests/Greenshot.Tests.csproj | 2 +- .../Configuration/IMetroConfiguration.cs | 8 +- .../Impl/MetroConfigurationImpl.cs | 30 +++++- src/Greenshot/FodyWeavers.xsd | 11 ++- src/Greenshot/Greenshot.csproj | 33 ++----- src/Greenshot/Languages/language-de-DE.xml | 3 - src/Greenshot/Startup.cs | 4 + .../ViewModels/UiConfigViewModel.cs | 78 ++++++++++----- .../Ui/Configuration/Views/UiConfigView.xaml | 4 +- src/global.json | 5 + 51 files changed, 464 insertions(+), 172 deletions(-) rename src/NuGet.Config => NuGet.Config (69%) create mode 100644 azure-pipelines.yml create mode 100644 src/global.json diff --git a/src/NuGet.Config b/NuGet.Config similarity index 69% rename from src/NuGet.Config rename to NuGet.Config index 1246f1e65..8d3dbb9f2 100644 --- a/src/NuGet.Config +++ b/NuGet.Config @@ -1,10 +1,13 @@  + + + \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..6184bb341 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,54 @@ +# .NET Desktop +# Build and run tests for .NET Desktop or Windows classic desktop solutions. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net + +pool: + vmImage: 'VS2017-Win2016' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: DotNetCoreInstaller@0 + displayName: 'Use .NET Core sdk 3.0' + inputs: + version: '3.0.100-preview-009825' + +- task: NuGetToolInstaller@0 + displayName: 'Use NuGet 4.9.2' + inputs: + versionSpec: 4.9.2 + checkLatest: true + +- task: NuGetCommand@2 + displayName: NuGet restore + inputs: + restoreSolution: '$(solution)' + feedsToUse: config + +- task: VSBuild@1 + displayName: 'Build solution **\*.sln' + inputs: + vsVersion: 'latest' + solution: '$(solution)' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: CopyFiles@2 + displayName: 'Copy Files to: $(build.artifactstagingdirectory)' + inputs: + SourceFolder: '$(system.defaultworkingdirectory)' + Contents: | + **\bin\$(BuildConfiguration)\*.nupkg + **\TestResults\**\*.coverage + TargetFolder: '$(build.artifactstagingdirectory)' + flattenFolders: true + + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 41d23e844..439362dbc 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -23,7 +23,7 @@ true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true - true + false @@ -55,4 +55,18 @@ runtime; build; native; contentfiles; analyzers + + + + diff --git a/src/Greenshot.Addon.Box/FodyWeavers.xsd b/src/Greenshot.Addon.Box/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Box/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Box/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj b/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj index fac915c25..af2f966f2 100644 --- a/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj +++ b/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj @@ -44,13 +44,13 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Confluence/FodyWeavers.xsd b/src/Greenshot.Addon.Confluence/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Confluence/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Confluence/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj b/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj index 7d6900899..322c827cb 100644 --- a/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj +++ b/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj @@ -51,13 +51,13 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Dropbox/FodyWeavers.xsd b/src/Greenshot.Addon.Dropbox/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Dropbox/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Dropbox/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj b/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj index a555afc4d..3943c3944 100644 --- a/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj +++ b/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj @@ -46,13 +46,13 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.ExternalCommand/FodyWeavers.xsd b/src/Greenshot.Addon.ExternalCommand/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.ExternalCommand/FodyWeavers.xsd +++ b/src/Greenshot.Addon.ExternalCommand/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj b/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj index ba7ede4c4..87865a111 100644 --- a/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj +++ b/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj @@ -38,11 +38,11 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Flickr/FodyWeavers.xsd b/src/Greenshot.Addon.Flickr/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Flickr/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Flickr/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj b/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj index e21ca96ba..c3a9d555f 100644 --- a/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj +++ b/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj @@ -46,11 +46,11 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.GooglePhotos/FodyWeavers.xsd b/src/Greenshot.Addon.GooglePhotos/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.GooglePhotos/FodyWeavers.xsd +++ b/src/Greenshot.Addon.GooglePhotos/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj b/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj index 22ee69d8a..5b1e370a7 100644 --- a/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj +++ b/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj @@ -46,11 +46,11 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Imgur/FodyWeavers.xsd b/src/Greenshot.Addon.Imgur/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Imgur/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Imgur/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj b/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj index 559d8f2cf..feeeabe14 100644 --- a/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj +++ b/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj @@ -46,15 +46,15 @@ - - + + - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Greenshot.Addon.Jira/FodyWeavers.xsd b/src/Greenshot.Addon.Jira/FodyWeavers.xsd index 061979a03..197a7d95d 100644 --- a/src/Greenshot.Addon.Jira/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Jira/FodyWeavers.xsd @@ -1,19 +1,110 @@  - + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj b/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj index b0991a4d7..b1746a411 100644 --- a/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj +++ b/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj @@ -48,14 +48,14 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs index 3de2d3a05..469989ea5 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs @@ -31,6 +31,9 @@ using Dapplo.Windows.Common.Structs; using Greenshot.Addon.LegacyEditor.Drawing.Fields; using Greenshot.Addon.LegacyEditor.Memento; using Greenshot.Addons.Interfaces.Drawing; +#if DEBUG +using System.Diagnostics; +#endif namespace Greenshot.Addon.LegacyEditor.Drawing { diff --git a/src/Greenshot.Addon.LegacyEditor/FodyWeavers.xsd b/src/Greenshot.Addon.LegacyEditor/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.LegacyEditor/FodyWeavers.xsd +++ b/src/Greenshot.Addon.LegacyEditor/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj index c5df09816..ed9705ce4 100644 --- a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj +++ b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj @@ -133,12 +133,12 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Lutim/FodyWeavers.xsd b/src/Greenshot.Addon.Lutim/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Lutim/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Lutim/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj b/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj index df30e7f82..38077bf8d 100644 --- a/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj +++ b/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj @@ -46,13 +46,13 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.OCR/FodyWeavers.xsd b/src/Greenshot.Addon.OCR/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.OCR/FodyWeavers.xsd +++ b/src/Greenshot.Addon.OCR/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj b/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj index 6fee555fb..8e254984d 100644 --- a/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj +++ b/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj @@ -38,10 +38,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.OcrCommand/Greenshot.Addon.OcrCommand.csproj b/src/Greenshot.Addon.OcrCommand/Greenshot.Addon.OcrCommand.csproj index 1eb22b4d6..0635b9938 100644 --- a/src/Greenshot.Addon.OcrCommand/Greenshot.Addon.OcrCommand.csproj +++ b/src/Greenshot.Addon.OcrCommand/Greenshot.Addon.OcrCommand.csproj @@ -1,6 +1,7 @@  + WinExe net471 Greenshot.Addon.OcrCommand GreenshotOCRCommand diff --git a/src/Greenshot.Addon.OcrCommand/Program.cs b/src/Greenshot.Addon.OcrCommand/Program.cs index 14e0b88e7..cfb36ad77 100644 --- a/src/Greenshot.Addon.OcrCommand/Program.cs +++ b/src/Greenshot.Addon.OcrCommand/Program.cs @@ -27,7 +27,9 @@ using System; using System.Collections.Generic; using System.IO; using Greenshot.Addon.OcrCommand.Modi; - +#if DEBUG +using System.Diagnostics; +#endif #endregion namespace Greenshot.Addon.OcrCommand diff --git a/src/Greenshot.Addon.Office/FodyWeavers.xsd b/src/Greenshot.Addon.Office/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Office/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Office/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj b/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj index cd9cd36ec..e0feba67c 100644 --- a/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj +++ b/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj @@ -45,8 +45,8 @@ - - + + @@ -54,7 +54,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.OneDrive/FodyWeavers.xsd b/src/Greenshot.Addon.OneDrive/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.OneDrive/FodyWeavers.xsd +++ b/src/Greenshot.Addon.OneDrive/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj b/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj index adaa0e106..7015cf716 100644 --- a/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj +++ b/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj @@ -46,13 +46,13 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Photobucket/FodyWeavers.xsd b/src/Greenshot.Addon.Photobucket/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Photobucket/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Photobucket/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj b/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj index 23aab302f..c370c2110 100644 --- a/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj +++ b/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj @@ -46,11 +46,11 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Tfs/FodyWeavers.xsd b/src/Greenshot.Addon.Tfs/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addon.Tfs/FodyWeavers.xsd +++ b/src/Greenshot.Addon.Tfs/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj b/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj index b8bbbb8c3..3719f3726 100644 --- a/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj +++ b/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj @@ -46,13 +46,13 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Tfs/TfsClient.cs b/src/Greenshot.Addon.Tfs/TfsClient.cs index 97df1dd16..9554d46b1 100644 --- a/src/Greenshot.Addon.Tfs/TfsClient.cs +++ b/src/Greenshot.Addon.Tfs/TfsClient.cs @@ -28,6 +28,7 @@ using System.Linq; using System.Net.Http; using System.Threading.Tasks; using Dapplo.HttpExtensions; +using Dapplo.HttpExtensions.ContentConverter; using Dapplo.HttpExtensions.Factory; using Dapplo.HttpExtensions.JsonNet; using Greenshot.Addon.Tfs.Entities; diff --git a/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj b/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj index e184bc5f1..6125b7999 100644 --- a/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj +++ b/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj @@ -57,8 +57,8 @@ - - + + \ No newline at end of file diff --git a/src/Greenshot.Addons/FodyWeavers.xsd b/src/Greenshot.Addons/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot.Addons/FodyWeavers.xsd +++ b/src/Greenshot.Addons/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot.Addons/Greenshot.Addons.csproj b/src/Greenshot.Addons/Greenshot.Addons.csproj index 44c108648..02ed03360 100644 --- a/src/Greenshot.Addons/Greenshot.Addons.csproj +++ b/src/Greenshot.Addons/Greenshot.Addons.csproj @@ -44,13 +44,13 @@ - 1.2.10 + 1.2.14 - 1.2.10 + 1.2.14 - 1.2.10 + 1.2.14 0.9.18 @@ -67,12 +67,12 @@ 0.8.3 - + all runtime; build; native; contentfiles; analyzers - 3.0.0-alpha0089 + 3.0.0-alpha0096 2.3.0 diff --git a/src/Greenshot.Gfx/Greenshot.Gfx.csproj b/src/Greenshot.Gfx/Greenshot.Gfx.csproj index bf6e3f287..f639a7c8c 100644 --- a/src/Greenshot.Gfx/Greenshot.Gfx.csproj +++ b/src/Greenshot.Gfx/Greenshot.Gfx.csproj @@ -29,7 +29,7 @@ - 1.2.10 + 1.2.14 2.3.0 diff --git a/src/Greenshot.Tests/Greenshot.Tests.csproj b/src/Greenshot.Tests/Greenshot.Tests.csproj index 9e660bb1f..be783180b 100644 --- a/src/Greenshot.Tests/Greenshot.Tests.csproj +++ b/src/Greenshot.Tests/Greenshot.Tests.csproj @@ -69,7 +69,7 @@ - + diff --git a/src/Greenshot/Configuration/IMetroConfiguration.cs b/src/Greenshot/Configuration/IMetroConfiguration.cs index 05193b6e0..b0652478c 100644 --- a/src/Greenshot/Configuration/IMetroConfiguration.cs +++ b/src/Greenshot/Configuration/IMetroConfiguration.cs @@ -30,10 +30,10 @@ namespace Greenshot.Configuration [IniSection("Metro")] public interface IMetroConfiguration : IIniSection, IMetroUiConfiguration { - [DefaultValue(Themes.Light)] - new Themes Theme { get; set; } + [DefaultValue("Light")] + new string Theme { get; set; } - [DefaultValue(ThemeAccents.Olive)] - new ThemeAccents ThemeAccent { get; set; } + [DefaultValue("Olive")] + new string ThemeColor{ get; set; } } } diff --git a/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs index 5a2d7e452..dfe253108 100644 --- a/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs +++ b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs @@ -21,14 +21,38 @@ #endregion -using Dapplo.CaliburnMicro.Metro.Configuration; +using Dapplo.CaliburnMicro.Metro; using Dapplo.Config.Ini; namespace Greenshot.Configuration.Impl { internal class MetroConfigurationImpl : IniSectionBase, IMetroConfiguration { - public Themes Theme { get; set; } - public ThemeAccents ThemeAccent { get; set; } + private readonly MetroThemeManager _metroThemeManager; + public MetroConfigurationImpl(MetroThemeManager metroThemeManager) + { + _metroThemeManager = metroThemeManager; + } + public string Theme { get; set; } + public string ThemeColor { get; set; } + + #region Overrides of IniSectionBase + + public override void AfterLoad() + { + if (string.IsNullOrEmpty(Theme)) + { + Theme = null; + } + if (string.IsNullOrEmpty(ThemeColor)) + { + ThemeColor = null; + } + _metroThemeManager.ChangeTheme(Theme, ThemeColor); + + base.AfterLoad(); + } + + #endregion } } diff --git a/src/Greenshot/FodyWeavers.xsd b/src/Greenshot/FodyWeavers.xsd index 061979a03..6e1ac6983 100644 --- a/src/Greenshot/FodyWeavers.xsd +++ b/src/Greenshot/FodyWeavers.xsd @@ -1,6 +1,6 @@  - + @@ -8,12 +8,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/Greenshot/Greenshot.csproj b/src/Greenshot/Greenshot.csproj index e8eec24c0..767df5d26 100644 --- a/src/Greenshot/Greenshot.csproj +++ b/src/Greenshot/Greenshot.csproj @@ -79,11 +79,11 @@ - - - - - + + + + + @@ -91,37 +91,20 @@ - + all runtime; build; native; contentfiles; analyzers - + + - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Greenshot/Languages/language-de-DE.xml b/src/Greenshot/Languages/language-de-DE.xml index 88b0cfa4d..991a6e6ac 100644 --- a/src/Greenshot/Languages/language-de-DE.xml +++ b/src/Greenshot/Languages/language-de-DE.xml @@ -1,8 +1,5 @@  - - - Bitte melden Sie Fehler unter Wenn Sie Greenshot mögen, können Sie uns gerne unterstützen: diff --git a/src/Greenshot/Startup.cs b/src/Greenshot/Startup.cs index 5ce639996..75d6f1b55 100644 --- a/src/Greenshot/Startup.cs +++ b/src/Greenshot/Startup.cs @@ -34,6 +34,10 @@ using Dapplo.Addons.Bootstrapper; using Dapplo.CaliburnMicro.Dapp; using Dapplo.Config.Ini.Converters; using Dapplo.Config.Language; +using Dapplo.Log; +#if DEBUG +using Dapplo.Log.Loggers; +#endif using Dapplo.Utils; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Dpi.Forms; diff --git a/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs b/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs index 3df66c02d..dbff7a912 100644 --- a/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs +++ b/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs @@ -24,12 +24,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; using System.Reactive.Disposables; using Dapplo.CaliburnMicro.Configuration; using Dapplo.CaliburnMicro.Extensions; using Dapplo.CaliburnMicro.Metro; -using Dapplo.CaliburnMicro.Metro.Configuration; +using Dapplo.Config.Intercepting; using Dapplo.Utils.Extensions; using Greenshot.Addons; using Greenshot.Addons.Core; @@ -40,20 +39,22 @@ namespace Greenshot.Ui.Configuration.ViewModels { public sealed class UiConfigViewModel : SimpleConfigScreen { + private readonly MetroThemeManager _metroThemeManager; + /// /// Here all disposables are registered, so we can clean the up /// private CompositeDisposable _disposables; /// - /// The avaible theme accents + /// The available themes /// - public ObservableCollection> AvailableThemeAccents { get; set; } = new ObservableCollection>(); + public ObservableCollection AvailableThemes { get; set; } = new ObservableCollection(); /// - /// The avaible themes + /// The available theme colors /// - public ObservableCollection> AvailableThemes { get; set; } = new ObservableCollection>(); + public ObservableCollection AvailableThemeColors { get; set; } = new ObservableCollection(); /// /// Used from the View @@ -77,29 +78,35 @@ namespace Greenshot.Ui.Configuration.ViewModels public IGreenshotLanguage GreenshotLanguage { get; } - private MetroWindowManager MetroWindowManager { get; } - + /// + /// Default constructor for DI usage + /// + /// ICoreConfiguration + /// IGreenshotLanguage + /// IConfigTranslations + /// IMetroConfiguration + /// MetroThemeManager public UiConfigViewModel( ICoreConfiguration coreConfiguration, IGreenshotLanguage greenshotLanguage, IConfigTranslations configTranslations, IMetroConfiguration metroConfiguration, - MetroWindowManager metroWindowManager - + MetroThemeManager metroThemeManager ) { + _metroThemeManager = metroThemeManager; CoreConfiguration = coreConfiguration; GreenshotLanguage = greenshotLanguage; ConfigTranslations = configTranslations; MetroConfiguration = metroConfiguration; - MetroWindowManager = metroWindowManager; } public override void Commit() { + // Manually commit + _metroThemeManager.ChangeTheme(MetroConfiguration.Theme, MetroConfiguration.ThemeColor); // Manually commit MetroConfiguration.CommitTransaction(); - MetroWindowManager.ChangeTheme(MetroConfiguration.Theme, MetroConfiguration.ThemeAccent); CoreConfiguration.CommitTransaction(); // TODO: Fix @@ -107,24 +114,28 @@ namespace Greenshot.Ui.Configuration.ViewModels } + /// + public override void Rollback() + { + MetroConfiguration.RollbackTransaction(); + _metroThemeManager.ChangeTheme(MetroConfiguration.Theme, MetroConfiguration.ThemeColor); + } + + /// + public override void Terminate() + { + MetroConfiguration.RollbackTransaction(); + _metroThemeManager.ChangeTheme(MetroConfiguration.Theme, MetroConfiguration.ThemeColor); + } + public override void Initialize(IConfig config) { // Prepare disposables _disposables?.Dispose(); - AvailableThemeAccents.Clear(); - foreach (var themeAccent in Enum.GetValues(typeof(ThemeAccents)).Cast()) - { - var translation = themeAccent.EnumValueOf(); - AvailableThemeAccents.Add(new Tuple(themeAccent, translation)); - } - AvailableThemes.Clear(); - foreach (var theme in Enum.GetValues(typeof(Themes)).Cast()) - { - var translation = theme.EnumValueOf(); - AvailableThemes.Add(new Tuple(theme, translation)); - } + MetroThemeManager.AvailableThemes.ForEach(themeBaseColor => AvailableThemes.Add(themeBaseColor)); + MetroThemeManager.AvailableThemeColors.ForEach(colorScheme => AvailableThemeColors.Add(colorScheme)); // Place this under the Ui parent ParentId = nameof(ConfigIds.Ui); @@ -138,6 +149,25 @@ namespace Greenshot.Ui.Configuration.ViewModels GreenshotLanguage.CreateDisplayNameBinding(this, nameof(IGreenshotLanguage.SettingsTitle)) }; + // Automatically show theme changes + _disposables.Add( + MetroConfiguration.OnPropertyChanging(nameof(MetroConfiguration.Theme)).Subscribe(args => + { + if (args is PropertyChangingEventArgsEx propertyChangingEventArgsEx) + { + _metroThemeManager.ChangeTheme(propertyChangingEventArgsEx.NewValue as string, null); + } + }) + ); + _disposables.Add( + MetroConfiguration.OnPropertyChanging(nameof(MetroConfiguration.ThemeColor)).Subscribe(args => + { + if (args is PropertyChangingEventArgsEx propertyChangingEventArgsEx) + { + _metroThemeManager.ChangeTheme(null, propertyChangingEventArgsEx.NewValue as string); + } + }) + ); base.Initialize(config); } diff --git a/src/Greenshot/Ui/Configuration/Views/UiConfigView.xaml b/src/Greenshot/Ui/Configuration/Views/UiConfigView.xaml index 71357e50a..9093aba8e 100644 --- a/src/Greenshot/Ui/Configuration/Views/UiConfigView.xaml +++ b/src/Greenshot/Ui/Configuration/Views/UiConfigView.xaml @@ -10,8 +10,8 @@