Skip to content

Commit

Permalink
Accessibility fixes for Naming Styles
Browse files Browse the repository at this point in the history
  • Loading branch information
David Poeschl authored and dpoeschl committed Mar 20, 2017
1 parent 8e5a0b0 commit 0b0cea2
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 6 deletions.
63 changes: 63 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -876,4 +876,25 @@ Additional information: {1}</value>
<data name="Unfortunately_a_process_used_by_Visual_Studio_has_encountered_an_unrecoverable_error_We_recommend_saving_your_work_and_then_closing_and_restarting_Visual Studio" xml:space="preserve">
<value>Unfortunately, a process used by Visual Studio has encountered an unrecoverable error. We recommend saving your work, and then closing and restarting Visual Studio.</value>
</data>
<data name="Add_a_symbol_specification" xml:space="preserve">
<value>Add a symbol specification</value>
</data>
<data name="Remove_symbol_specification" xml:space="preserve">
<value>Remove symbol specification</value>
</data>
<data name="Add_item" xml:space="preserve">
<value>Add item</value>
</data>
<data name="Edit_item" xml:space="preserve">
<value>Edit item</value>
</data>
<data name="Remove_item" xml:space="preserve">
<value>Remove item</value>
</data>
<data name="Add_a_naming_rule" xml:space="preserve">
<value>Add a naming rule</value>
</data>
<data name="Remove_naming_rule" xml:space="preserve">
<value>Remove naming rule</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="EditButton_Click" Height="Auto" Width="Auto" Margin="5, 0, 0, 0"
AutomationProperties.Name="{Binding ElementName=dialog, Path=EditButtonAutomationText}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Center"
Expand All @@ -149,6 +150,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="RemoveButton_Click" Height="Auto" Width="Auto" Margin="5, 0, 0, 0"
AutomationProperties.Name="{Binding ElementName=dialog, Path=RemoveButtonAutomationText}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Center"
Expand All @@ -173,7 +175,7 @@
Grid.Row="1"
DockPanel.Dock="Left"
Click="AddButton_Click"
AutomationProperties.Name="{Binding AddItemAutomationText}"
AutomationProperties.Name="{Binding ElementName=dialog, Path=AddItemAutomationText}"
AutomationProperties.AutomationId="Add"
Height="24" Width="24"
Margin="0 7 0 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ internal partial class ManageNamingStylesInfoDialog : DialogWindow
public string OK => ServicesVSResources.OK;
public string Cancel => ServicesVSResources.Cancel;
public string CannotBeDeletedExplanation => ServicesVSResources.This_item_cannot_be_deleted_because_it_is_used_by_an_existing_Naming_Rule;
public string AddItemAutomationText => ServicesVSResources.Add_item;
public string EditButtonAutomationText => ServicesVSResources.Edit_item;
public string RemoveButtonAutomationText => ServicesVSResources.Remove_item;

internal ManageNamingStylesInfoDialog(IManageNamingStylesInfoDialogViewModel viewModel)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
SelectedItem="{Binding SelectedSpecification, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Left"
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}">
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}"
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.SymbolSpecificationAutomationText}">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Setter Property="AutomationProperties.Name" Value="{Binding Name}" />
Expand All @@ -182,7 +183,8 @@
SelectedItem="{Binding SelectedStyle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Left"
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}">
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}"
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.NamingStyleAutomationText}">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Setter Property="AutomationProperties.Name" Value="{Binding Name}" />
Expand All @@ -205,7 +207,8 @@
Visibility="{Binding NotificationsAvailable, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Left"
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}">
ToolTip="{Binding Path=SelectedItem.Name, RelativeSource={RelativeSource Self}}"
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.SeverityAutomationText}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid>
Expand Down Expand Up @@ -244,7 +247,7 @@
HorizontalContentAlignment="Center"
HorizontalAlignment="Center"
VerticalAlignment="Center"
AutomationProperties.Name="{Binding RemoveAutomationText}">
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.RemoveAutomationText}">
<imaging:CrispImage Moniker="{x:Static imagecatalog:KnownMonikers.DeleteListItem}" />
</Button>
</DataTemplate>
Expand All @@ -258,7 +261,7 @@
Margin="7">
<Button Name="AddButton"
Click="AddButton_Click"
AutomationProperties.Name="{Binding AddRuleAutomationText}"
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.AddRuleAutomationText}"
AutomationProperties.AutomationId="Add"
Height="24" Width="24"
Margin="0 0 0 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ internal partial class NamingStyleOptionPageControl : AbstractOptionPageControl
public static string RequiredStyleHeader => ServicesVSResources.Required_Style;
public static string SeverityHeader => ServicesVSResources.Severity;
public static string ExplanatoryText => ServicesVSResources.For_a_given_symbol_only_the_topmost_rule_with_a_matching_Specification_will_be_applied_Violation_of_that_rules_Required_Style_will_be_reported_at_the_chosen_Severity_level;
public static string AddRuleAutomationText => ServicesVSResources.Add_a_naming_rule;
public static string RemoveAutomationText => ServicesVSResources.Remove_naming_rule;
public static string SymbolSpecificationAutomationText => ServicesVSResources.Symbol_Specification;
public static string NamingStyleAutomationText => ServicesVSResources.Naming_Style;
public static string SeverityAutomationText => ServicesVSResources.Severity;

private NamingStyleOptionPageViewModel _viewModel;
private readonly string _languageName;
Expand Down

0 comments on commit 0b0cea2

Please sign in to comment.