-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a new tab for the naming style options that were exposed via services in a previous commit
- Loading branch information
Showing
26 changed files
with
818 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ConfigSettings/NamingStyle/View/ColumnDefinitions/NamingStylesLocationColumnDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Windows; | ||
using Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Data; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
using Microsoft.VisualStudio.Shell.TableControl; | ||
using Microsoft.VisualStudio.Shell.TableManager; | ||
using Microsoft.VisualStudio.Utilities; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.ColumnDefinitions | ||
{ | ||
using static Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.Common.ColumnDefinitions.NamingStyle; | ||
|
||
[Export(typeof(ITableColumnDefinition))] | ||
[Name(Location)] | ||
internal class NamingStylesLocationColumnDefinition : TableColumnDefinitionBase | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public NamingStylesLocationColumnDefinition() | ||
{ | ||
} | ||
|
||
public override string Name => Location; | ||
public override string DisplayName => ServicesVSResources.Location; | ||
public override double MinWidth => 350; | ||
public override bool DefaultVisible => true; | ||
public override bool IsFilterable => true; | ||
public override bool IsSortable => true; | ||
|
||
public override bool TryCreateColumnContent( | ||
ITableEntryHandle entry, | ||
bool singleColumnView, | ||
out FrameworkElement? content) | ||
{ | ||
if (!entry.TryGetValue(Location, out NamingStyleSetting setting)) | ||
{ | ||
content = null; | ||
return false; | ||
} | ||
|
||
var viewModel = new NamingStylesLocationViewModel(setting); | ||
var control = new NamingStylesLocationControl(viewModel); | ||
content = control; | ||
return true; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...ConfigSettings/NamingStyle/View/ColumnDefinitions/NamingStylesSeverityColumnDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Windows; | ||
using Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Data; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
using Microsoft.VisualStudio.Shell.TableControl; | ||
using Microsoft.VisualStudio.Shell.TableManager; | ||
using Microsoft.VisualStudio.Utilities; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.ColumnDefinitions | ||
{ | ||
using static Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.Common.ColumnDefinitions.NamingStyle; | ||
|
||
[Export(typeof(ITableColumnDefinition))] | ||
[Name(Severity)] | ||
internal class NamingStylesSeverityColumnDefinition : TableColumnDefinitionBase | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public NamingStylesSeverityColumnDefinition() | ||
{ | ||
} | ||
|
||
public override string Name => Severity; | ||
public override string DisplayName => ServicesVSResources.Severity; | ||
public override bool IsFilterable => false; | ||
public override bool IsSortable => false; | ||
public override double MinWidth => 120; | ||
|
||
public override bool TryCreateColumnContent(ITableEntryHandle entry, bool singleColumnView, out FrameworkElement? content) | ||
{ | ||
if (!entry.TryGetValue(Severity, out NamingStyleSetting setting)) | ||
{ | ||
content = null; | ||
return false; | ||
} | ||
|
||
var viewModel = new NamingStylesSeverityViewModel(setting); | ||
var control = new NamingStylesSeverityControl(viewModel); | ||
content = control; | ||
return true; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...torConfigSettings/NamingStyle/View/ColumnDefinitions/NamingStylesStyleColumnDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Windows; | ||
using Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Data; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
using Microsoft.VisualStudio.Shell.TableControl; | ||
using Microsoft.VisualStudio.Shell.TableManager; | ||
using Microsoft.VisualStudio.Utilities; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.ColumnDefinitions | ||
{ | ||
using static Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.Common.ColumnDefinitions.NamingStyle; | ||
|
||
[Export(typeof(ITableColumnDefinition))] | ||
[Name(Style)] | ||
internal class NamingStylesStyleColumnDefinition : TableColumnDefinitionBase | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public NamingStylesStyleColumnDefinition() | ||
{ | ||
} | ||
|
||
public override string Name => Style; | ||
public override string DisplayName => ServicesVSResources.Naming_Style; | ||
public override bool IsFilterable => true; | ||
public override bool IsSortable => true; | ||
public override double MinWidth => 350; | ||
|
||
public override bool TryCreateColumnContent(ITableEntryHandle entry, bool singleColumnView, out FrameworkElement? content) | ||
{ | ||
if (!entry.TryGetValue(Style, out NamingStyleSetting setting)) | ||
{ | ||
content = null; | ||
return false; | ||
} | ||
|
||
var viewModel = new NamingStylesStyleViewModel(setting); | ||
var control = new NamingStylesStyleControl(viewModel); | ||
content = control; | ||
return true; | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...itorConfigSettings/NamingStyle/View/ColumnDefinitions/NamingStylesTypeColumnDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel.Composition; | ||
using System.Windows; | ||
using Microsoft.CodeAnalysis.Editor.EditorConfigSettings.Data; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
using Microsoft.VisualStudio.Shell.TableControl; | ||
using Microsoft.VisualStudio.Shell.TableManager; | ||
using Microsoft.VisualStudio.Utilities; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.ColumnDefinitions | ||
{ | ||
using static Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.Common.ColumnDefinitions.NamingStyle; | ||
|
||
[Export(typeof(ITableColumnDefinition))] | ||
[Name(Type)] | ||
internal class NamingStylesTypeColumnDefinition : TableColumnDefinitionBase | ||
{ | ||
[ImportingConstructor] | ||
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] | ||
public NamingStylesTypeColumnDefinition() | ||
{ | ||
} | ||
|
||
public override string Name => Type; | ||
public override string DisplayName => ServicesVSResources.Type; | ||
public override bool IsFilterable => true; | ||
public override bool IsSortable => true; | ||
public override double MinWidth => 350; | ||
|
||
public override bool TryCreateColumnContent( | ||
ITableEntryHandle entry, | ||
bool singleColumnView, | ||
out FrameworkElement? content) | ||
{ | ||
if (!entry.TryGetValue(Type, out NamingStyleSetting setting)) | ||
{ | ||
content = null; | ||
return false; | ||
} | ||
|
||
var viewModel = new NamingStylesTypeViewModel(setting); | ||
var control = new NamingStylesTypeControl(viewModel); | ||
content = control; | ||
return true; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...re/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesLocationControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.NamingStylesLocationControl" | ||
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:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:namingStyleViewModel="clr-namespace:Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel" | ||
d:DataContext="{d:DesignInstance Type=namingStyleViewModel:NamingStylesLocationViewModel}" | ||
mc:Ignorable="d" | ||
x:ClassModifier="internal"> | ||
<Grid x:Name="RootGrid"> | ||
<Label x:Name="NamingStyleLocationLabel" | ||
Content="{Binding LocationValue}" | ||
ToolTip="{Binding LocationToolTip}" | ||
AutomationProperties.Name="{Binding LocationAutomationName}" /> | ||
</Grid> | ||
</UserControl> |
21 changes: 21 additions & 0 deletions
21
...Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesLocationControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Windows.Controls; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View | ||
{ | ||
/// <summary> | ||
/// Interaction logic for NamingStylesLocationControl.xaml | ||
/// </summary> | ||
internal partial class NamingStylesLocationControl : UserControl | ||
{ | ||
public NamingStylesLocationControl(NamingStylesLocationViewModel viewModel) | ||
{ | ||
InitializeComponent(); | ||
DataContext = viewModel; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...re/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesSeverityControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.NamingStylesSeverityControl" | ||
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:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:namingStyleViewModel="clr-namespace:Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel" | ||
d:DataContext="{d:DesignInstance Type=namingStyleViewModel:NamingStylesSeverityViewModel}" | ||
mc:Ignorable="d" | ||
x:ClassModifier="internal"> | ||
<Grid x:Name="RootGrid"> | ||
<ComboBox x:Name="SeverityComboBox" | ||
ItemsSource="{Binding Severities}" | ||
SelectedValue="{Binding SelectedSeverityValue}" | ||
ToolTip="{Binding SeverityToolTip}" | ||
AutomationProperties.Name="{Binding SeverityAutomationName}" | ||
SelectionChanged="SeverityComboBox_SelectionChanged" /> | ||
</Grid> | ||
</UserControl> |
27 changes: 27 additions & 0 deletions
27
...Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesSeverityControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Windows.Controls; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View | ||
{ | ||
/// <summary> | ||
/// Interaction logic for NamingStylesSeverityControl.xaml | ||
/// </summary> | ||
internal partial class NamingStylesSeverityControl : UserControl | ||
{ | ||
private readonly NamingStylesSeverityViewModel _viewModel; | ||
|
||
public NamingStylesSeverityControl(NamingStylesSeverityViewModel viewModel) | ||
{ | ||
InitializeComponent(); | ||
_viewModel = viewModel; | ||
DataContext = viewModel; | ||
} | ||
|
||
private void SeverityComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
=> _viewModel.SelectionChanged(SeverityComboBox.SelectedIndex); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../Core/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesStyleControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.NamingStylesStyleControl" | ||
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:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:namingStyleViewModel="clr-namespace:Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel" | ||
d:DataContext="{d:DesignInstance Type=namingStyleViewModel:NamingStylesStyleViewModel}" | ||
mc:Ignorable="d" | ||
x:ClassModifier="internal"> | ||
<Grid x:Name="RootGrid"> | ||
<ComboBox x:Name="StyleComboBox" | ||
ItemsSource="{Binding StyleValues}" | ||
SelectedValue="{Binding SelectedStyleValue}" | ||
ToolTip="{Binding StyleToolTip}" | ||
AutomationProperties.Name="{Binding StyleAutomationName}" | ||
SelectionChanged="StyleComboBox_SelectionChanged"/> | ||
</Grid> | ||
</UserControl> |
27 changes: 27 additions & 0 deletions
27
...re/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesStyleControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Windows.Controls; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View | ||
{ | ||
/// <summary> | ||
/// Interaction logic for NamingStylesStyleControl.xaml | ||
/// </summary> | ||
internal partial class NamingStylesStyleControl : UserControl | ||
{ | ||
private readonly NamingStylesStyleViewModel _viewModel; | ||
|
||
public NamingStylesStyleControl(NamingStylesStyleViewModel viewModel) | ||
{ | ||
InitializeComponent(); | ||
_viewModel = viewModel; | ||
DataContext = viewModel; | ||
} | ||
|
||
private void StyleComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
=> _viewModel.SelectionChanged(StyleComboBox.SelectedIndex); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...o/Core/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesTypeControl.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View.NamingStylesTypeControl" | ||
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:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:namingStyleViewModel="clr-namespace:Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel" | ||
d:DataContext="{d:DesignInstance Type=namingStyleViewModel:NamingStylesTypeViewModel}" | ||
mc:Ignorable="d" | ||
x:ClassModifier="internal"> | ||
<Grid x:Name="RootGrid"> | ||
<Label x:Name="NamingStyleTypeLabel" | ||
Content="{Binding TypeValue}" | ||
ToolTip="{Binding TypeToolTip}" | ||
AutomationProperties.Name="{Binding TypeAutomationName}" /> | ||
</Grid> | ||
</UserControl> |
21 changes: 21 additions & 0 deletions
21
...ore/Def/EditorConfigSettings/NamingStyle/View/ColumnViews/NamingStylesTypeControl.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Windows.Controls; | ||
using Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.ViewModel; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.EditorConfigSettings.NamingStyle.View | ||
{ | ||
/// <summary> | ||
/// Interaction logic for NamingStylesTypeControl.xaml | ||
/// </summary> | ||
internal partial class NamingStylesTypeControl : UserControl | ||
{ | ||
public NamingStylesTypeControl(NamingStylesTypeViewModel viewModel) | ||
{ | ||
InitializeComponent(); | ||
DataContext = viewModel; | ||
} | ||
} | ||
} |
Oops, something went wrong.