A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Added license, privacy policy, third party notices....
Etienne Baudoux9b5185c05333
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex dbfa588bb..c726cdaef 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -18,7 +18,7 @@ You can contribute to DevToys app by:* Make sure you have Visual Studio 2019 16.10+ installed.* In Visual Studio Installer, install the required components by importing the `.vsconfig` file from the root of the repository.* Run `init.ps1` in a PowerShell command prompt to restore all the dependencies.-* Open `src/DevTools.sln` with Visual Studio and set Solution Platform to x64(amd64)*.+* Open `src/DevTools.sln` with Visual Studio and set Solution Platform to x64*.* Once opened, set `src/dev/startup/DevTools.Startup/DevTools.Startup.wapproj` as startup project.* Now you should be able to build and run DevToys on your machine. If it fails, try close the solution and reopen it again.diff --git a/LICENSE.md b/LICENSE.mdnew file mode 100644index 000000000..48b0929f8--- /dev/null+++ b/LICENSE.md@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2021 Etienne Baudoux++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.\ No newline at end of filediff --git a/PRIVACY-POLICY.md b/PRIVACY-POLICY.mdnew file mode 100644index 000000000..134577ade--- /dev/null+++ b/PRIVACY-POLICY.md@@ -0,0 +1,66 @@+### Privacy Policy++Last updated: September 23, 2021++This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You.+We use Your anonynous Non-Personal data and health and performance data of the Service to provide and improve the Service itself. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy.++### Interpretation and Definitions++#### Interpretation++The words of which the initial letter is capitalized have meanings defined under the following conditions.+The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.++#### Definitions++For the purposes of this Privacy Policy:+++ **You** means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable.++ **Developer** (referred to as either "the Developer", "We", "Us" or "Our" in this Agreement) refers to DevToys's owner.++ **Website** refers to DevToys's website, accessible from [github.com/veler/devtoys](https://github.com/veler/devtoys)++ **Service** refers to the DevToys software.++ **Country** refers to: Washington, USA.++ **Service Provider** means any natural or legal person who processes the data on behalf of the Developer. It refers to third-party developer(s) or individuals contributor to facilitate the Service, to provide the Service on behalf of the Developer, to perform services related to the Service or to assist the Developer in analyzing how the Service is used.++ **Personal Data** is any information that relates to an identified or identifiable individual.++ **Non-Personal Data** is any information that does not relates to an identified or identifiable individual.++ **Device** means any device that can access the Service such as a computer, a cellphone or a digital tablet.++ **Usage Data** refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration that the Service takes to start).++### Collecting and Using Your Personal Data++#### Types of Data Collected++##### Personal Data++While using Our Service, We will never retain or ask You to provide Us any personally identifiable information.++##### Usage Data++Usage Data is collected automatically when using the Service.+Usage Data may include non-identifiable information such as error messages, performance metric, ordered list of features used during the use of the Service.+Usage Data are not sent to the Developer and Service Provider.+Usage Data are displayed in the "Logs" section in the Settings page of the Service.++### Links to Other Websites++Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit.++We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.++### Third-Party Services++Our Service allow You to use a Third-Party service. We strongly advise You to review the Privacy Policy of every service You use.++We have no control over and assume no responsibility for the content, privacy policies or practices of any third party services.++### Changes to this Privacy Policy++We may update our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page.+You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page.++### Contact Us++If you have any questions about this Privacy Policy, You can contact us:+++ By visiting this page on our website: [www.velersoftware.com](https://www.velersoftware.com/contact.php)diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.mdnew file mode 100644index 000000000..143d54497--- /dev/null+++ b/THIRD-PARTY-NOTICES.md@@ -0,0 +1,176 @@+THIRD-PARTY SOFTWARE NOTICES AND INFORMATION++This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Etienne Baudoux received such components are set forth below. Etienne Baudoux reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.++1. Newtonsoft.Json (https://github.com/JamesNK/Newtonsoft.Json)+2. ColorCode-Universal (https://github.com/CommunityToolkit/ColorCode-Universal)+3. DiffPlex (https://github.com/mmanela/diffplex)+4. Windows Community Toolkit (https://github.com/CommunityToolkit/WindowsCommunityToolkit)+5. Notepads App (https://github.com/JasonStein/Notepads)++Newtonsoft.Json NOTICES AND INFORMATION BEGIN HERE+=========================================+The MIT License (MIT)++Copyright (c) 2007 James Newton-King++Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of+the Software, and to permit persons to whom the Software is furnished to do so,+subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++ColorCode-Universal NOTICES AND INFORMATION BEGIN HERE+=========================================+# Microsoft Public License (Ms-PL)++This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.++1. Definitions++ The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.++ A "contribution" is the original software, or any additions or changes to the software.++ A "contributor" is any person that distributes its contribution under this license.++ "Licensed patents" are a contributor's patent claims that read directly on its contribution.++2. Grant of Rights++ (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.++ (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.++3. Conditions and Limitations++ (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.++ (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.++ (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.++ (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.++ (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.++DiffPlex NOTICES AND INFORMATION BEGIN HERE+=========================================+Apache License+Version 2.0, January 2004+http://www.apache.org/licenses/++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION++1. Definitions.++"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.++"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.++"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.++"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.++"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.++"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.++"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).++"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.++"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."++"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.++2. Grant of Copyright License.++Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.++3. Grant of Patent License.++Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.++4. Redistribution.++You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:++You must give any other recipients of the Work or Derivative Works a copy of this License; and+You must cause any modified files to carry prominent notices stating that You changed the files; and+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.++5. Submission of Contributions.++Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.++6. Trademarks.++This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.++7. Disclaimer of Warranty.++Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.++8. Limitation of Liability.++In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.++9. Accepting Warranty or Additional Liability.++While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.++END OF TERMS AND CONDITIONS++Windows Community Toolkit NOTICES AND INFORMATION BEGIN HERE+=========================================+# Windows Community Toolkit++Copyright � .NET Foundation and Contributors++All rights reserved.++## MIT License (MIT)++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++Notepads App NOTICES AND INFORMATION BEGIN HERE+=========================================+MIT License++Copyright (c) 2020 Jackie (Jiaqi) Liu++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.\ No newline at end of filediff --git a/src/DevTools.sln b/src/DevTools.slnindex e005beb5c..6d14f22fa 100644--- a/src/DevTools.sln+++ b/src/DevTools.sln@@ -19,7 +19,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution..\CONTRIBUTING.md = ..\CONTRIBUTING.mdDirectory.Build.props = Directory.Build.propsDirectory.Build.targets = Directory.Build.targets+ ..\LICENSE.md = ..\LICENSE.md+ ..\PRIVACY-POLICY.md = ..\PRIVACY-POLICY.md..\README.md = ..\README.md+ ..\THIRD-PARTY-NOTICES.md = ..\THIRD-PARTY-NOTICES.mdEndProjectSectionEndProjectProject("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "def", "def", "{A2C92FF9-1D2E-47C6-8D7D-975412F7F36E}"diff --git a/src/dev/def/DevTools.Core/IWindowManager.cs b/src/dev/def/DevTools.Core/IWindowManager.csnew file mode 100644index 000000000..784ca890d--- /dev/null+++ b/src/dev/def/DevTools.Core/IWindowManager.cs@@ -0,0 +1,24 @@+using System.Threading.Tasks;++namespace DevTools.Core+{+ /// <summary>+ /// Provides a set of methods to manager windows and dialogs.+ /// </summary>+ public interface IWindowManager+ {+ /// <summary>+ /// Prompt a message dialog to the user.+ /// </summary>+ /// <param name="content">The content to show in the dialog. It can be a UI element or a text.</param>+ /// <param name="primaryButtonText">The text of the primary button.</param>+ /// <param name="secondaryButtonText">The text of the secondary button. If null or empty, the button will be hidden.</param>+ /// <param name="title">The title of the message. If null, use the application name.</param>+ /// <returns>Returns <code>true</code> if the user clicks on the primary button.</returns>+ Task<bool> ShowContentDialogAsync(+ object content,+ string primaryButtonText,+ string? secondaryButtonText = null,+ string? title = null);+ }+}diff --git a/src/dev/impl/DevTools.Common/AssetsHelper.cs b/src/dev/impl/DevTools.Common/AssetsHelper.csnew file mode 100644index 000000000..a4a7b7293--- /dev/null+++ b/src/dev/impl/DevTools.Common/AssetsHelper.cs@@ -0,0 +1,49 @@+#nullable enable++using DevTools.Core.Threading;+using System;+using System.IO;+using System.Threading.Tasks;+using Windows.Storage;++namespace DevTools.Common+{+ public static class AssetsHelper+ {+ public static async Task<string> GetPrivacyStatementAsync()+ {+ string result = await GetLocalFileContentAsync($"Assets\\PRIVACY-POLICY.md").ConfigureAwait(false);++ return result;+ }++ public static async Task<string> GetThirdPartyNoticesAsync()+ {+ string result = await GetLocalFileContentAsync($"Assets\\THIRD-PARTY-NOTICES.md").ConfigureAwait(false);++ return result;+ }++ public static async Task<string> GetLicenseAsync()+ {+ string result = await GetLocalFileContentAsync($"Assets\\LICENSE.md").ConfigureAwait(false);++ return result;+ }++ private static async Task<string> GetLocalFileContentAsync(string filePath)+ {+ await TaskScheduler.Default;++ StorageFolder installationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;++ IStorageItem file = await installationFolder.TryGetItemAsync(filePath);+ if (file != null)+ {+ return File.ReadAllText(file.Path);+ }++ return string.Empty;+ }+ }+}diff --git a/src/dev/impl/DevTools.Common/DevTools.Common.csproj b/src/dev/impl/DevTools.Common/DevTools.Common.csprojindex 40dbee993..a4280dfed 100644--- a/src/dev/impl/DevTools.Common/DevTools.Common.csproj+++ b/src/dev/impl/DevTools.Common/DevTools.Common.csproj@@ -74,6 +74,7 @@<Compile Include="..\..\shared\SharedAssemblyInfo.cs"><Link>Properties\SharedAssemblyInfo.cs</Link></Compile>+ <Compile Include="AssetsHelper.cs" /><Compile Include="LanguageDefinition.cs" /><Compile Include="Properties\AssemblyInfo.cs" /><Compile Include="LanguageManager.cs">@@ -216,6 +217,20 @@<ItemGroup><PRIResource Include="Strings\fr\MainPage.resw" /></ItemGroup>+ <ItemGroup>+ <None Include="..\..\..\..\LICENSE.md">+ <Link>Assets\LICENSE.md</Link>+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </None>+ <None Include="..\..\..\..\PRIVACY-POLICY.md">+ <Link>Assets\PRIVACY-POLICY.md</Link>+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </None>+ <None Include="..\..\..\..\THIRD-PARTY-NOTICES.md">+ <Link>Assets\THIRD-PARTY-NOTICES.md</Link>+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </None>+ </ItemGroup><Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/src/dev/impl/DevTools.Common/LanguageManager.cs b/src/dev/impl/DevTools.Common/LanguageManager.csindex e028c7b99..fd62e1074 100644--- a/src/dev/impl/DevTools.Common/LanguageManager.cs+++ b/src/dev/impl/DevTools.Common/LanguageManager.cs@@ -450,6 +450,11 @@ namespace DevTools.Common/// </summary>public string Behaviors => _resources.GetString("Behaviors");+ /// <summary>+ /// Gets the resource Close.+ /// </summary>+ public string Close => _resources.GetString("Close");+/// <summary>/// Gets the resource Dark./// </summary>@@ -490,6 +495,11 @@ namespace DevTools.Common/// </summary>public string LanguageDescription => _resources.GetString("LanguageDescription");+ /// <summary>+ /// Gets the resource License.+ /// </summary>+ public string License => _resources.GetString("License");+/// <summary>/// Gets the resource Light./// </summary>@@ -505,6 +515,11 @@ namespace DevTools.Common/// </summary>public string LineNumbersDescription => _resources.GetString("LineNumbersDescription");+ /// <summary>+ /// Gets the resource PrivacyPolicy.+ /// </summary>+ public string PrivacyPolicy => _resources.GetString("PrivacyPolicy");+/// <summary>/// Gets the resource SmartDetection./// </summary>@@ -520,6 +535,11 @@ namespace DevTools.Common/// </summary>public string TextEditor => _resources.GetString("TextEditor");+ /// <summary>+ /// Gets the resource ThirdPartyNotices.+ /// </summary>+ public string ThirdPartyNotices => _resources.GetString("ThirdPartyNotices");+/// <summary>/// Gets the resource UsefulLinks./// </summary>diff --git a/src/dev/impl/DevTools.Common/Strings/en/Settings.resw b/src/dev/impl/DevTools.Common/Strings/en/Settings.reswindex 454fd2a05..4bb51bddc 100644--- a/src/dev/impl/DevTools.Common/Strings/en/Settings.resw+++ b/src/dev/impl/DevTools.Common/Strings/en/Settings.resw@@ -132,6 +132,9 @@<data name="Behaviors" xml:space="preserve"><value>Behaviors</value></data>+ <data name="Close" xml:space="preserve">+ <value>Close</value>+ </data><data name="Dark" xml:space="preserve"><value>Dark</value></data>@@ -156,6 +159,9 @@<data name="LanguageDescription" xml:space="preserve"><value>The app needs to be restarted when selecting another language</value></data>+ <data name="License" xml:space="preserve">+ <value>License</value>+ </data><data name="Light" xml:space="preserve"><value>Light</value></data>@@ -165,6 +171,9 @@<data name="LineNumbersDescription" xml:space="preserve"><value>Display line numbers in the text editor</value></data>+ <data name="PrivacyPolicy" xml:space="preserve">+ <value>Privacy policy</value>+ </data><data name="SmartDetection" xml:space="preserve"><value>Smart detection</value></data>@@ -174,6 +183,9 @@<data name="TextEditor" xml:space="preserve"><value>Text editor</value></data>+ <data name="ThirdPartyNotices" xml:space="preserve">+ <value>Third party licenses</value>+ </data><data name="UsefulLinks" xml:space="preserve"><value>Useful links</value></data>diff --git a/src/dev/impl/DevTools.Core.Impl/DevTools.Core.Impl.csproj b/src/dev/impl/DevTools.Core.Impl/DevTools.Core.Impl.csprojindex a3c7132fa..42879b29d 100644--- a/src/dev/impl/DevTools.Core.Impl/DevTools.Core.Impl.csproj+++ b/src/dev/impl/DevTools.Core.Impl/DevTools.Core.Impl.csproj@@ -82,6 +82,7 @@<Compile Include="Theme\ThemeListener.cs" /><Compile Include="Threading\Thread.cs" /><Compile Include="TitleBar.cs" />+ <Compile Include="WindowManager.cs" /></ItemGroup><ItemGroup><PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="$(NuGet_MicrosoftNETCoreUniversalWindowsPlatform)" />diff --git a/src/dev/impl/DevTools.Core.Impl/WindowManager.cs b/src/dev/impl/DevTools.Core.Impl/WindowManager.csnew file mode 100644index 000000000..99206a2dc--- /dev/null+++ b/src/dev/impl/DevTools.Core.Impl/WindowManager.cs@@ -0,0 +1,43 @@+#nullable enable++using DevTools.Core.Threading;+using System;+using System.Composition;+using System.Threading.Tasks;+using Windows.ApplicationModel;+using Windows.UI.Xaml.Controls;++namespace DevTools.Core.Impl+{+ [Export(typeof(IWindowManager))]+ internal sealed class WindowManager : IWindowManager+ {+ private readonly IThread _thread;++ [ImportingConstructor]+ public WindowManager(IThread thread)+ {+ _thread = thread;+ }++ public Task<bool> ShowContentDialogAsync(object content, string primaryButtonText, string? secondaryButtonText = null, string? title = null)+ {+ return _thread.RunOnUIThreadAsync(async () =>+ {+ var confirmationDialog = new ContentDialog+ {+ Title = title ?? Package.Current.DisplayName,+ Content = content,+ CloseButtonText = Arguments.NotNullOrWhiteSpace(primaryButtonText, nameof(primaryButtonText))+ };++ if (!string.IsNullOrEmpty(secondaryButtonText))+ {+ confirmationDialog.PrimaryButtonText = secondaryButtonText;+ }++ return await confirmationDialog.ShowAsync() == ContentDialogResult.Primary;+ });+ }+ }+}diff --git a/src/dev/impl/DevTools.Impl/DevTools.Impl.csproj b/src/dev/impl/DevTools.Impl/DevTools.Impl.csprojindex 062956563..085e7fcdf 100644--- a/src/dev/impl/DevTools.Impl/DevTools.Impl.csproj+++ b/src/dev/impl/DevTools.Impl/DevTools.Impl.csproj@@ -82,13 +82,17 @@<Compile Include="Views\MainPage.xaml.cs"><DependentUpon>MainPage.xaml</DependentUpon></Compile>+ <Compile Include="Views\Settings\MarkdownContentDialog.xaml.cs">+ <DependentUpon>MarkdownContentDialog.xaml</DependentUpon>+ </Compile><Compile Include="Views\Settings\SettingsToolPage.xaml.cs"><DependentUpon>SettingsToolPage.xaml</DependentUpon></Compile>- <Compile Include="Views\Settings\SettingsToolProvider.cs" />- <Compile Include="Views\Settings\SettingsToolViewModel.cs" />+ <Compile Include="ViewModels\Settings\SettingsToolProvider.cs" />+ <Compile Include="ViewModels\Settings\SettingsToolViewModel.cs" /></ItemGroup><ItemGroup>+ <PackageReference Include="ColorCode.UWP" Version="$(Nuget_ColorCodeUwp)" /><PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="$(NuGet_MicrosoftNETCoreUniversalWindowsPlatform)" /><PackageReference Include="Microsoft.Toolkit.Mvvm" Version="$(NuGet_MicrosoftToolkitMvvm)" /><PackageReference Include="Microsoft.Toolkit.Uwp.UI.Behaviors" Version="$(Nuget_MicrosoftToolkitUwpUIBehaviors)" />@@ -118,6 +122,10 @@<SubType>Designer</SubType><Generator>MSBuild:Compile</Generator></Page>+ <Page Include="Views\Settings\MarkdownContentDialog.xaml">+ <SubType>Designer</SubType>+ <Generator>MSBuild:Compile</Generator>+ </Page><Page Include="Views\Settings\SettingsToolPage.xaml"><SubType>Designer</SubType><Generator>MSBuild:Compile</Generator>@@ -128,6 +136,7 @@<Link>Assets\Logo\Square44x44Logo.altform-lightunplated_targetsize-16.png</Link></Content></ItemGroup>+ <ItemGroup /><Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolProvider.cs b/src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolProvider.cssimilarity index 97%rename from src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolProvider.csrename to src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolProvider.csindex 6e90e0ec6..ece081f2d 100644--- a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolProvider.cs+++ b/src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolProvider.cs@@ -13,7 +13,7 @@ using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;using Windows.UI.Xaml.Media;-namespace DevTools.Impl.Views.Settings+namespace DevTools.Impl.ViewModels.Settings{[Export(typeof(IToolProvider))][Name("Settings")]diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolViewModel.cs b/src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolViewModel.cssimilarity index 59%rename from src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolViewModel.csrename to src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolViewModel.csindex e8ca570b2..14f3468f3 100644--- a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolViewModel.cs+++ b/src/dev/impl/DevTools.Impl/ViewModels/Settings/SettingsToolViewModel.cs@@ -1,20 +1,25 @@#nullable enableusing DevTools.Common;+using DevTools.Core;using DevTools.Core.Settings;using DevTools.Core.Theme;+using DevTools.Impl.Views.Settings;using DevTools.Providers;using Microsoft.Toolkit.Mvvm.ComponentModel;+using Microsoft.Toolkit.Mvvm.Input;using System;using System.Collections.Generic;using System.Composition;using System.Reflection;+using System.Threading.Tasks;-namespace DevTools.Impl.Views.Settings+namespace DevTools.Impl.ViewModels.Settings{[Export(typeof(SettingsToolViewModel))]public sealed class SettingsToolViewModel : ObservableRecipient, IToolViewModel{+ private readonly IWindowManager _windowManager;private readonly ISettingsProvider _settingsProvider;public Type View { get; } = typeof(SettingsToolPage);@@ -72,9 +77,60 @@ namespace DevTools.Impl.Views.Settings[ImportingConstructor]public SettingsToolViewModel(+ IWindowManager windowManager,ISettingsProvider settingsProvider){+ _windowManager = windowManager;_settingsProvider = settingsProvider;++ PrivacyPolicyCommand = new AsyncRelayCommand(ExecutePrivacyPolicyCommandAsync);+ ThirdPartyNoticesCommand = new AsyncRelayCommand(ExecuteThirdPartyNoticesCommandAsync);+ LicenseCommand = new AsyncRelayCommand(ExecuteLicenseCommandAsync);+ }++ #region PrivacyPolicyCommand++ internal IAsyncRelayCommand PrivacyPolicyCommand { get; }++ private async Task ExecutePrivacyPolicyCommandAsync()+ {+ await _windowManager.ShowContentDialogAsync(+ new MarkdownContentDialog(+ await AssetsHelper.GetPrivacyStatementAsync()),+ Strings.Close,+ title: Strings.PrivacyPolicy);}++ #endregion++ #region ThirdPartyNoticesCommand++ internal IAsyncRelayCommand ThirdPartyNoticesCommand { get; }++ private async Task ExecuteThirdPartyNoticesCommandAsync()+ {+ await _windowManager.ShowContentDialogAsync(+ new MarkdownContentDialog(+ await AssetsHelper.GetThirdPartyNoticesAsync()),+ Strings.Close,+ title: Strings.ThirdPartyNotices);+ }++ #endregion++ #region LicenseCommand++ internal IAsyncRelayCommand LicenseCommand { get; }++ private async Task ExecuteLicenseCommandAsync()+ {+ await _windowManager.ShowContentDialogAsync(+ new MarkdownContentDialog(+ await AssetsHelper.GetLicenseAsync()),+ Strings.Close,+ title: Strings.License);+ }++ #endregion}}diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xaml b/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xamlnew file mode 100644index 000000000..6f8b4201b--- /dev/null+++ b/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xaml@@ -0,0 +1,29 @@+<UserControl+ x:Class="DevTools.Impl.Views.Settings.MarkdownContentDialog"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ xmlns:local="using:DevTools.Impl.Views.Settings"+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"+ xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"+ mc:Ignorable="d"+ d:DesignHeight="300"+ d:DesignWidth="400">++ <ScrollViewer+ VerticalScrollMode="Enabled"+ VerticalScrollBarVisibility="Auto"+ HorizontalScrollMode="Disabled"+ HorizontalScrollBarVisibility="Hidden"+ HorizontalContentAlignment="Stretch">+ <controls:MarkdownTextBlock+ x:Name="MarkdownTextBlock"+ IsTextSelectionEnabled="True"+ HorizontalAlignment="Stretch"+ TextWrapping="Wrap"+ Background="Transparent"+ MaxWidth="500"+ LinkClicked="MarkdownTextBlock_LinkClicked">+ </controls:MarkdownTextBlock>+ </ScrollViewer>+</UserControl>diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xaml.cs b/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xaml.csnew file mode 100644index 000000000..31f5af34e--- /dev/null+++ b/src/dev/impl/DevTools.Impl/Views/Settings/MarkdownContentDialog.xaml.cs@@ -0,0 +1,30 @@+#nullable enable++using DevTools.Common;+using System;+using Windows.UI.Xaml.Controls;++namespace DevTools.Impl.Views.Settings+{+ public sealed partial class MarkdownContentDialog : UserControl+ {+ public MarkdownContentDialog(string markdown)+ {+ InitializeComponent();++ MarkdownTextBlock.Text = markdown;+ }++ private async void MarkdownTextBlock_LinkClicked(object sender, Microsoft.Toolkit.Uwp.UI.Controls.LinkClickedEventArgs e)+ {+ try+ {+ string uriToLaunch = e.Link;+ var uri = new Uri(uriToLaunch);++ await Windows.System.Launcher.LaunchUriAsync(uri);+ }+ catch { }+ }+ }+}diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml b/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xamlindex 84f6c5dc2..b6eb024a3 100644--- a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml+++ b/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml@@ -130,14 +130,14 @@</Grid.ColumnDefinitions><StackPanel Grid.Column="0"><HyperlinkButton Content="App website" NavigateUri="http://www.microsoft.com" />- <HyperlinkButton Content="Privacy policy" NavigateUri="http://www.microsoft.com" />+ <HyperlinkButton Content="{x:Bind ViewModel.Strings.PrivacyPolicy}" Command="{x:Bind ViewModel.PrivacyPolicyCommand}" /><HyperlinkButton Content="Rate and review on Microsoft Store" NavigateUri="http://www.microsoft.com" /><HyperlinkButton Content="Donate" NavigateUri="http://www.microsoft.com" /></StackPanel><StackPanel Grid.Column="1"><HyperlinkButton Content="Source code" NavigateUri="http://www.microsoft.com" />- <HyperlinkButton Content="License" NavigateUri="http://www.microsoft.com" />- <HyperlinkButton Content="Third party licenses" NavigateUri="http://www.microsoft.com" />+ <HyperlinkButton Content="{x:Bind ViewModel.Strings.License}" Command="{x:Bind ViewModel.LicenseCommand}" />+ <HyperlinkButton Content="{x:Bind ViewModel.Strings.ThirdPartyNotices}" Command="{x:Bind ViewModel.ThirdPartyNoticesCommand}" /><HyperlinkButton Content="Report a problem" NavigateUri="http://www.microsoft.com" /></StackPanel></Grid>diff --git a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml.cs b/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml.csindex c4fcf2bba..8c4bc3992 100644--- a/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml.cs+++ b/src/dev/impl/DevTools.Impl/Views/Settings/SettingsToolPage.xaml.cs@@ -2,6 +2,7 @@using DevTools.Core;using DevTools.Core.Navigation;+using DevTools.Impl.ViewModels.Settings;using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;using Windows.UI.Xaml.Navigation;diff --git a/src/dev/startup/DevTools.Startup/Package.appxmanifest b/src/dev/startup/DevTools.Startup/Package.appxmanifestindex 162cfe4e7..bae568237 100644--- a/src/dev/startup/DevTools.Startup/Package.appxmanifest+++ b/src/dev/startup/DevTools.Startup/Package.appxmanifest@@ -73,8 +73,4 @@</Extensions></Application></Applications>-- <Capabilities>- <Capability Name="internetClient" />- </Capabilities></Package>