From 7b1f20c12d55a59645956f4d9d8346cbdfb46fad Mon Sep 17 00:00:00 2001 From: Alexandre Zollinger Chohfi Date: Tue, 30 Mar 2021 13:47:16 -0700 Subject: [PATCH] Added WinUI3 version. --- .gitignore | 1 + ColorCode.Core/ColorCode.Core.csproj | 2 +- ColorCode.UWP/Common/ExtensionMethods.cs | 6 + ColorCode.UWP/RichTextBlockFormatter.cs | 14 +- ColorCode.WinUI/ColorCode.WinUI.csproj | 27 +++ ColorCode.sln | 120 ++++++++++-- Directory.Build.props | 32 +++- .../ColorCode.BasicTests.csproj | 2 +- .../ColorCode.WinUITests (Package).wapproj | 89 +++++++++ .../Package.appxmanifest | 48 +++++ Tests/ColorCode.WinUITests/App.xaml | 15 ++ Tests/ColorCode.WinUITests/App.xaml.cs | 63 ++++++ .../ColorCode.WinUITests.csproj | 25 +++ Tests/ColorCode.WinUITests/MainWindow.xaml | 28 +++ Tests/ColorCode.WinUITests/MainWindow.xaml.cs | 123 ++++++++++++ Tests/ColorCode.WinUITests/app.manifest | 15 ++ azure-pipelines.yml | 17 +- build/build.cake | 48 +++-- build/build.ps1 | 181 +++++++++++++----- build/tools/packages.config | 2 +- global.json | 2 +- version.json | 2 +- 22 files changed, 760 insertions(+), 102 deletions(-) create mode 100644 ColorCode.WinUI/ColorCode.WinUI.csproj create mode 100644 Tests/ColorCode.WinUITests (Package)/ColorCode.WinUITests (Package).wapproj create mode 100644 Tests/ColorCode.WinUITests (Package)/Package.appxmanifest create mode 100644 Tests/ColorCode.WinUITests/App.xaml create mode 100644 Tests/ColorCode.WinUITests/App.xaml.cs create mode 100644 Tests/ColorCode.WinUITests/ColorCode.WinUITests.csproj create mode 100644 Tests/ColorCode.WinUITests/MainWindow.xaml create mode 100644 Tests/ColorCode.WinUITests/MainWindow.xaml.cs create mode 100644 Tests/ColorCode.WinUITests/app.manifest diff --git a/.gitignore b/.gitignore index 84b8c44..344efb4 100644 --- a/.gitignore +++ b/.gitignore @@ -290,5 +290,6 @@ __pycache__/ *.odx.cs *.xsd.cs /build/tools +/build/nupkg BuildResults.xml \ No newline at end of file diff --git a/ColorCode.Core/ColorCode.Core.csproj b/ColorCode.Core/ColorCode.Core.csproj index 84c03e5..40023af 100644 --- a/ColorCode.Core/ColorCode.Core.csproj +++ b/ColorCode.Core/ColorCode.Core.csproj @@ -19,5 +19,5 @@ full true - + \ No newline at end of file diff --git a/ColorCode.UWP/Common/ExtensionMethods.cs b/ColorCode.UWP/Common/ExtensionMethods.cs index 666bf26..102cc03 100644 --- a/ColorCode.UWP/Common/ExtensionMethods.cs +++ b/ColorCode.UWP/Common/ExtensionMethods.cs @@ -1,9 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. using System; +#if WINUI +using Microsoft.UI.Xaml.Media; + +namespace ColorCode.WinUI.Common +#else using Windows.UI.Xaml.Media; namespace ColorCode.UWP.Common +#endif { public static class ExtensionMethods { diff --git a/ColorCode.UWP/RichTextBlockFormatter.cs b/ColorCode.UWP/RichTextBlockFormatter.cs index 540e161..464a6ab 100644 --- a/ColorCode.UWP/RichTextBlockFormatter.cs +++ b/ColorCode.UWP/RichTextBlockFormatter.cs @@ -2,13 +2,21 @@ using System.Collections.Generic; using ColorCode.Parsing; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Documents; using ColorCode.Styling; using Windows.UI.Text; -using ColorCode.UWP.Common; using ColorCode.Common; +#if WINUI +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Documents; +using ColorCode.WinUI.Common; +using Microsoft.UI.Xaml; +using Microsoft.UI.Text; +#else +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Documents; +using ColorCode.UWP.Common; using Windows.UI.Xaml; +#endif namespace ColorCode { diff --git a/ColorCode.WinUI/ColorCode.WinUI.csproj b/ColorCode.WinUI/ColorCode.WinUI.csproj new file mode 100644 index 0000000..06cd796 --- /dev/null +++ b/ColorCode.WinUI/ColorCode.WinUI.csproj @@ -0,0 +1,27 @@ + + + + net5.0-windows10.0.18362.0 + $(TargetPlatformMinVersion) + ColorCode + ColorCode.WinUI + ColorCode.WinUI + Contains the RichTextBlockFormatter, for rendering the Colorized Code to a RichTextBlock. + ColorCode Syntax Highlighting SyntaxHighlighting Formatting UWP RichTextBlock Document InlineCollection + $(DefineConstants);WINUI + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ColorCode.sln b/ColorCode.sln index 7adf6f2..7189554 100644 --- a/ColorCode.sln +++ b/ColorCode.sln @@ -7,13 +7,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.HTML", "ColorCode EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5B9F207C-2EAB-4F77-95C7-206D65C87137}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.UWP", "ColorCode.UWP\ColorCode.UWP.csproj", "{A482CFCC-D474-4C43-A812-1B0B4E6E484F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.Core", "ColorCode.Core\ColorCode.Core.csproj", "{F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.BasicTests", "Tests\ColorCode.BasicTests\ColorCode.BasicTests.csproj", "{A3E27CD2-6D33-44D3-962F-E56C4CD25F10}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorCode.UWPTests", "Tests\ColorCode.UWPTests\ColorCode.UWPTests.csproj", "{A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.WinUITests", "Tests\ColorCode.WinUITests\ColorCode.WinUITests.csproj", "{F1ED6BD6-2690-4BF3-835C-C3927C33424F}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ColorCode.WinUITests (Package)", "Tests\ColorCode.WinUITests (Package)\ColorCode.WinUITests (Package).wapproj", "{DD20D31A-915E-43A2-B819-3A7AE39CA25C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.WinUI", "ColorCode.WinUI\ColorCode.WinUI.csproj", "{5B043ED5-3662-4CE5-9004-637E1739C363}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A4B1B99B-FC3A-4C76-8B46-B96723829FD2}" ProjectSection(SolutionItems) = preProject @@ -25,14 +27,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution version.json = version.json EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorCode.UWP", "ColorCode.UWP\ColorCode.UWP.csproj", "{9A628641-BF6E-439F-AF60-BF9E471D45AF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorCode.UWPTests", "Tests\ColorCode.UWPTests\ColorCode.UWPTests.csproj", "{A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection @@ -41,6 +49,8 @@ Global {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|Any CPU.Build.0 = Debug|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|ARM.ActiveCfg = Debug|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|ARM.Build.0 = Debug|Any CPU + {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|ARM64.Build.0 = Debug|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|x64.ActiveCfg = Debug|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|x64.Build.0 = Debug|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -49,30 +59,18 @@ Global {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|Any CPU.Build.0 = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|ARM.ActiveCfg = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|ARM.Build.0 = Release|Any CPU + {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|ARM64.ActiveCfg = Release|Any CPU + {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|ARM64.Build.0 = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|x64.ActiveCfg = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|x64.Build.0 = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|x86.ActiveCfg = Release|Any CPU {33A3FB96-F1EB-4AF0-94E0-F629E1F574A8}.Release|x86.Build.0 = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|ARM.ActiveCfg = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|ARM.Build.0 = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|x64.ActiveCfg = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|x64.Build.0 = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|x86.ActiveCfg = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Debug|x86.Build.0 = Debug|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|Any CPU.Build.0 = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|ARM.ActiveCfg = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|ARM.Build.0 = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|x64.ActiveCfg = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|x64.Build.0 = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|x86.ActiveCfg = Release|Any CPU - {A482CFCC-D474-4C43-A812-1B0B4E6E484F}.Release|x86.Build.0 = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|ARM.ActiveCfg = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|ARM.Build.0 = Debug|Any CPU + {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|ARM64.Build.0 = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|x64.ActiveCfg = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|x64.Build.0 = Debug|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -81,6 +79,8 @@ Global {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|Any CPU.Build.0 = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|ARM.ActiveCfg = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|ARM.Build.0 = Release|Any CPU + {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|ARM64.ActiveCfg = Release|Any CPU + {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|ARM64.Build.0 = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|x64.ActiveCfg = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|x64.Build.0 = Release|Any CPU {F6DE802C-9BD7-4BFA-9553-BCBF51E0556B}.Release|x86.ActiveCfg = Release|Any CPU @@ -89,6 +89,8 @@ Global {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|Any CPU.Build.0 = Debug|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|ARM.ActiveCfg = Debug|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|ARM.Build.0 = Debug|Any CPU + {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|ARM64.Build.0 = Debug|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|x64.ActiveCfg = Debug|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|x64.Build.0 = Debug|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -96,14 +98,91 @@ Global {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|Any CPU.ActiveCfg = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|ARM.ActiveCfg = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|ARM.Build.0 = Release|Any CPU + {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|ARM64.ActiveCfg = Release|Any CPU + {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|ARM64.Build.0 = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|x64.ActiveCfg = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|x64.Build.0 = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|x86.ActiveCfg = Release|Any CPU {A3E27CD2-6D33-44D3-962F-E56C4CD25F10}.Release|x86.Build.0 = Release|Any CPU + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|Any CPU.ActiveCfg = Debug|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|ARM.ActiveCfg = Debug|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|ARM64.ActiveCfg = Debug|arm64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|ARM64.Build.0 = Debug|arm64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|x64.ActiveCfg = Debug|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|x64.Build.0 = Debug|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|x86.ActiveCfg = Debug|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Debug|x86.Build.0 = Debug|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|Any CPU.ActiveCfg = Release|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|ARM.ActiveCfg = Release|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|ARM64.ActiveCfg = Release|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|x64.ActiveCfg = Release|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|x64.Build.0 = Release|x64 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|x86.ActiveCfg = Release|x86 + {F1ED6BD6-2690-4BF3-835C-C3927C33424F}.Release|x86.Build.0 = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|Any CPU.ActiveCfg = Debug|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|ARM.ActiveCfg = Debug|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|ARM64.Build.0 = Debug|ARM64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x64.ActiveCfg = Debug|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x64.Build.0 = Debug|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x64.Deploy.0 = Debug|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x86.ActiveCfg = Debug|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x86.Build.0 = Debug|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Debug|x86.Deploy.0 = Debug|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|Any CPU.ActiveCfg = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|ARM.ActiveCfg = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|ARM64.ActiveCfg = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x64.ActiveCfg = Release|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x64.Build.0 = Release|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x64.Deploy.0 = Release|x64 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x86.ActiveCfg = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x86.Build.0 = Release|x86 + {DD20D31A-915E-43A2-B819-3A7AE39CA25C}.Release|x86.Deploy.0 = Release|x86 + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|ARM.Build.0 = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|ARM64.Build.0 = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|x64.ActiveCfg = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|x64.Build.0 = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|x86.ActiveCfg = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Debug|x86.Build.0 = Debug|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|Any CPU.Build.0 = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|ARM.ActiveCfg = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|ARM.Build.0 = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|ARM64.ActiveCfg = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|ARM64.Build.0 = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|x64.ActiveCfg = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|x64.Build.0 = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|x86.ActiveCfg = Release|Any CPU + {5B043ED5-3662-4CE5-9004-637E1739C363}.Release|x86.Build.0 = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|ARM.ActiveCfg = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|ARM.Build.0 = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|ARM64.Build.0 = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|x64.ActiveCfg = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|x64.Build.0 = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|x86.ActiveCfg = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Debug|x86.Build.0 = Debug|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|Any CPU.Build.0 = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|ARM.ActiveCfg = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|ARM.Build.0 = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|ARM64.ActiveCfg = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|ARM64.Build.0 = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|x64.ActiveCfg = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|x64.Build.0 = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|x86.ActiveCfg = Release|Any CPU + {9A628641-BF6E-439F-AF60-BF9E471D45AF}.Release|x86.Build.0 = Release|Any CPU {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|Any CPU.ActiveCfg = Debug|x86 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|ARM.ActiveCfg = Debug|ARM {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|ARM.Build.0 = Debug|ARM {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|ARM.Deploy.0 = Debug|ARM + {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|ARM64.ActiveCfg = Debug|x86 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|x64.ActiveCfg = Debug|x64 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|x64.Build.0 = Debug|x64 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Debug|x64.Deploy.0 = Debug|x64 @@ -114,6 +193,7 @@ Global {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|ARM.ActiveCfg = Release|ARM {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|ARM.Build.0 = Release|ARM {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|ARM.Deploy.0 = Release|ARM + {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|ARM64.ActiveCfg = Release|x86 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|x64.ActiveCfg = Release|x64 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|x64.Build.0 = Release|x64 {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3}.Release|x64.Deploy.0 = Release|x64 @@ -126,6 +206,8 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A3E27CD2-6D33-44D3-962F-E56C4CD25F10} = {5B9F207C-2EAB-4F77-95C7-206D65C87137} + {F1ED6BD6-2690-4BF3-835C-C3927C33424F} = {5B9F207C-2EAB-4F77-95C7-206D65C87137} + {DD20D31A-915E-43A2-B819-3A7AE39CA25C} = {5B9F207C-2EAB-4F77-95C7-206D65C87137} {A3D5A8A5-1D1F-412D-A829-C3DC1C7D4DF3} = {5B9F207C-2EAB-4F77-95C7-206D65C87137} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/Directory.Build.props b/Directory.Build.props index 4aac4d0..77dd529 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,24 +9,50 @@ Copyright © Microsoft Corporation, William Bradley 2017 $(MSBuildProjectName.Contains('UWP')) + $(MSBuildProjectName.Contains('WinUI')) $(MSBuildProjectName.Contains('Test')) - + + + + 10.0.16299.0 10.0.14393.0 + + + 10.0.18362.0 + 10.0.17763.0 + + + + true + + - + true + + true + + true - + + + + + + + + + diff --git a/Tests/ColorCode.BasicTests/ColorCode.BasicTests.csproj b/Tests/ColorCode.BasicTests/ColorCode.BasicTests.csproj index 7af5f42..6a41eee 100644 --- a/Tests/ColorCode.BasicTests/ColorCode.BasicTests.csproj +++ b/Tests/ColorCode.BasicTests/ColorCode.BasicTests.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 false diff --git a/Tests/ColorCode.WinUITests (Package)/ColorCode.WinUITests (Package).wapproj b/Tests/ColorCode.WinUITests (Package)/ColorCode.WinUITests (Package).wapproj new file mode 100644 index 0000000..c9c4b1e --- /dev/null +++ b/Tests/ColorCode.WinUITests (Package)/ColorCode.WinUITests (Package).wapproj @@ -0,0 +1,89 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + arm64 + + + Release + arm64 + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + ColorCode.WinUITests\ + net5.0-windows$(TargetPlatformVersion);$(AssetTargetFallback) + + + + dd20d31a-915e-43a2-b819-3a7ae39ca25c + 10.0.18362.0 + 10.0.18362.0 + en-US + false + ..\ColorCode.WinUITests\ColorCode.WinUITests.csproj + + + + Designer + + + + + Images\LockScreenLogo.scale-200.png + + + Images\SplashScreen.scale-200.png + + + Images\Square150x150Logo.scale-200.png + + + Images\Square44x44Logo.scale-200.png + + + Images\Square44x44Logo.targetsize-24_altform-unplated.png + + + Images\StoreLogo.png + + + Images\Wide310x150Logo.scale-200.png + + + + + True + Properties\PublishProfiles\win10-$(Platform).pubxml + + + + + build + + + build + + + + \ No newline at end of file diff --git a/Tests/ColorCode.WinUITests (Package)/Package.appxmanifest b/Tests/ColorCode.WinUITests (Package)/Package.appxmanifest new file mode 100644 index 0000000..5ff23d4 --- /dev/null +++ b/Tests/ColorCode.WinUITests (Package)/Package.appxmanifest @@ -0,0 +1,48 @@ + + + + + + + + ColorCode.WinUITests (Package) + alzollin + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/ColorCode.WinUITests/App.xaml b/Tests/ColorCode.WinUITests/App.xaml new file mode 100644 index 0000000..fef6763 --- /dev/null +++ b/Tests/ColorCode.WinUITests/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/Tests/ColorCode.WinUITests/App.xaml.cs b/Tests/ColorCode.WinUITests/App.xaml.cs new file mode 100644 index 0000000..ebed719 --- /dev/null +++ b/Tests/ColorCode.WinUITests/App.xaml.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +using System; +using Windows.ApplicationModel; +using Microsoft.UI.Xaml; +using WinRT; +using System.Runtime.InteropServices; + +namespace ColorCode.WinUITests +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + //this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + IWindowNative windowWrapper = m_window.As(); + WindowHandle = windowWrapper.WindowHandle; + m_window.Activate(); + } + + public IntPtr WindowHandle { get; private set; } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("EECDBF0E-BAE9-4CB6-A68E-9598E1CB57BB")] + internal interface IWindowNative + { + IntPtr WindowHandle { get; } + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + // Save application state and stop any background activity + } + + private Window m_window; + } +} diff --git a/Tests/ColorCode.WinUITests/ColorCode.WinUITests.csproj b/Tests/ColorCode.WinUITests/ColorCode.WinUITests.csproj new file mode 100644 index 0000000..45e1f03 --- /dev/null +++ b/Tests/ColorCode.WinUITests/ColorCode.WinUITests.csproj @@ -0,0 +1,25 @@ + + + WinExe + net5.0-windows10.0.18362.0 + 10.0.17763.0 + $(TargetPlatformMinVersion) + ColorCode.WinUITests + app.manifest + x86;x64;arm64 + win10-x86;win10-x64;win10-arm64 + + + + + + + + + + + + + + + diff --git a/Tests/ColorCode.WinUITests/MainWindow.xaml b/Tests/ColorCode.WinUITests/MainWindow.xaml new file mode 100644 index 0000000..37b7344 --- /dev/null +++ b/Tests/ColorCode.WinUITests/MainWindow.xaml @@ -0,0 +1,28 @@ + + + + + + + + + +