From 619213b55badce1f494f9489e33119e0e2148505 Mon Sep 17 00:00:00 2001 From: JieCarolHu Date: Tue, 16 Jan 2018 20:03:09 -0800 Subject: [PATCH] add text and hyperlink to C# code style page --- .../Options/GridOptionPreviewControl.xaml | 40 +++++++++++-------- .../Options/GridOptionPreviewControl.xaml.cs | 26 ++++++++++-- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml b/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml index 402e414c60b..304bbf87fc8 100644 --- a/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml +++ b/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml @@ -5,7 +5,7 @@ xmlns:converters="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Options.Converters" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:options="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Options" xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging" @@ -21,9 +21,9 @@ @@ -35,12 +35,18 @@ + + + + + + @@ -106,8 +112,8 @@ - @@ -115,7 +121,7 @@ @@ -127,8 +133,8 @@ - @@ -147,12 +153,12 @@ - @@ -169,8 +175,8 @@ - - + + diff --git a/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml.cs b/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml.cs index c06930190c0..c3146f14008 100644 --- a/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml.cs +++ b/src/VisualStudio/Core/Impl/Options/GridOptionPreviewControl.xaml.cs @@ -1,10 +1,16 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Diagnostics; using System.Linq; +using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; using System.Windows.Input; +using System.Windows.Navigation; +using Microsoft.CodeAnalysis.Diagnostics.Log; using Microsoft.CodeAnalysis.Options; +using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.Options { @@ -14,13 +20,16 @@ internal partial class GridOptionPreviewControl : AbstractOptionPageControl private readonly IServiceProvider _serviceProvider; private readonly Func _createViewModel; + public static string CodeStylePageHeader = "The settings configured here only apply to your machine. To configure these settings to travel with your solution, use EditorConfig. "; + public static string CodeStylePageHeaderLearnMoreText = "Learn more"; + public static Uri CodeStylePageHeaderLearnMoreUri = new Uri("https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference"); public static string DescriptionHeader => ServicesVSResources.Description; public static string PreferenceHeader => ServicesVSResources.Preference; public static string SeverityHeader => ServicesVSResources.Severity; - internal GridOptionPreviewControl(IServiceProvider serviceProvider, - Func createViewModel) + internal GridOptionPreviewControl(IServiceProvider serviceProvider, + Func createViewModel) : base(serviceProvider) { InitializeComponent(); @@ -29,6 +38,17 @@ internal partial class GridOptionPreviewControl : AbstractOptionPageControl _createViewModel = createViewModel; } + private void LearnMoreHyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) + { + if (e.Uri == null) + { + return; + } + + BrowserHelper.StartBrowser(e.Uri); + e.Handled = true; + } + private void Options_SelectionChanged(object sender, SelectionChangedEventArgs e) { var dataGrid = (DataGrid)sender; -- GitLab