Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address accessibility issues #2120

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<MicrosoftIdentityModelJsonWebTokensVersion>7.1.2</MicrosoftIdentityModelJsonWebTokensVersion>
<MicrosoftSourceLinkGitHubVersion>8.0.0</MicrosoftSourceLinkGitHubVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
<MicrosoftWebWebView2Version>1.0.2792.45</MicrosoftWebWebView2Version>
<SystemBuffersVersion>4.5.1</SystemBuffersVersion>
<SystemCollectionsImmutableVersion>8.0.0</SystemCollectionsImmutableVersion>
<SystemDiagnosticsDiagnosticSourceVersion>8.0.0</SystemDiagnosticsDiagnosticSourceVersion>
Expand Down
15 changes: 15 additions & 0 deletions src/PerfView/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class App
public static int Main(string[] args)
{
CommandProcessor = new CommandProcessor();
App.SetAccessibilitySwitchOverrides();

StreamWriter writerToCleanup = null; // If we create a log file, we need to clean it up.
int retCode = -1;
Expand Down Expand Up @@ -1079,6 +1080,20 @@ private static bool UserOKWithSymbolServerGui()
private static string m_SymbolPath;
private static string m_SourcePath;

/// <summary>
/// This enables using new accessibility features that were implemented on .NET Framework 4.7.1 or later
/// despite the application targeting an earlier framework version. This resolves a few accessibility issues
/// that were fixed in later versions of .NET Framework. For more information, see below:
/// https://learn.microsoft.com/en-us/dotnet/framework/whats-new/whats-new-in-accessibility#accessibility-switches
/// </summary>
private static void SetAccessibilitySwitchOverrides()
{
AppContext.SetSwitch("Switch.UseLegacyAccessibilityFeatures", false);
AppContext.SetSwitch("Switch.UseLegacyAccessibilityFeatures.2", false);
AppContext.SetSwitch("Switch.UseLegacyAccessibilityFeatures.3", false);
AppContext.SetSwitch("Switch.UseLegacyAccessibilityFeatures.4", false);
}

#region CreateConsole
[System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)]
private extern static int AllocConsole();
Expand Down
9 changes: 5 additions & 4 deletions src/PerfView/Dialogs/FileInputAndOutput.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Hyperlink Command="Help" CommandParameter="ProcessDumpTextBox">Help</Hyperlink>
</TextBlock>

<RichTextBox Grid.Row="0" Grid.Column="1" Margin="0,5,5,0" IsReadOnly="True" IsDocumentEnabled="True">
<RichTextBox Grid.Row="0" Grid.Column="1" Margin="0,5,5,0" IsReadOnly="True" IsDocumentEnabled="True" AutomationProperties.Name="Disk Size Analysis Help">
<RichTextBox.Document>
<FlowDocument>
<Paragraph Name="InstructionParagraph">
Expand All @@ -43,15 +43,16 @@

<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" KeyboardNavigation.IsTabStop="False"
Text="Input File:" ToolTip="The file/directory to open for analysis"/>
<TextBox Grid.Row="2" Grid.Column="1" Margin="0,0,5,0" Name="InputFileName" VerticalAlignment="Center" PreviewKeyDown="InputFileKeyDown" TextChanged="InputFileTextChanged" />
<TextBox Grid.Row="2" Grid.Column="1" Margin="0,0,5,0" Name="InputFileName" VerticalAlignment="Center" PreviewKeyDown="InputFileKeyDown" TextChanged="InputFileTextChanged" AutomationProperties.Name="Input File" />

<ListBox Grid.Row="3" Grid.Column="2" KeyboardNavigation.TabIndex="1" Margin="0,5,5,15" MinHeight="80" Name="Files"
PreviewKeyDown="ListBoxKeyDown" MouseDoubleClick="FilesDoubleClick" FontFamily="Courier New"
ToolTip="This shows all the files/directories that match the prefix in the InputFile text box."/>
ToolTip="This shows all the files/directories that match the prefix in the InputFile text box."
AutomationProperties.Name="Files"/>

<TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" KeyboardNavigation.IsTabStop="False"
Text="Output File:" ToolTip="The file name to put the resulting analysis."/>
<TextBox Grid.Row="4" Grid.Column="1" Margin="0,0,5,0" Name="OutputFileName" VerticalAlignment="Center" />
<TextBox Grid.Row="4" Grid.Column="1" Margin="0,0,5,0" Name="OutputFileName" VerticalAlignment="Center" AutomationProperties.Name="Output File" />

<StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal" FlowDirection="RightToLeft">
<Button Margin="10,5,10,5" Width="80" Content="OK" Click="OKClicked"/>
Expand Down
24 changes: 14 additions & 10 deletions src/PerfView/Dialogs/MemoryDataDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</Grid.RowDefinitions>

<!-- Help message at top -->
<RichTextBox Grid.Row="0" IsReadOnly="True" Background="{DynamicResource HelpRibbonBackground}" IsDocumentEnabled="True">
<RichTextBox Grid.Row="0" IsReadOnly="True" Background="{DynamicResource HelpRibbonBackground}" IsDocumentEnabled="True" AutomationProperties.Name="Memory data collection help">
<RichTextBox.Document>
<FlowDocument>
<Paragraph>
Expand All @@ -44,7 +44,7 @@
<TextBlock Grid.Column="0" Margin="5,0" Width="100" VerticalAlignment="Center" ToolTip="The file name of the process dump file from which to extract the GC heap.">
<Hyperlink Command="Help" CommandParameter="ProcessDumpTextBox">Process Dump File:</Hyperlink>
</TextBlock>
<TextBox Margin="0,5,5,0" Grid.Column="1" Name="ProcessDumpTextBox" VerticalAlignment="Center" KeyDown="ProcessDumpKeyDown" />
<TextBox Margin="0,5,5,0" Grid.Column="1" Name="ProcessDumpTextBox" VerticalAlignment="Center" KeyDown="ProcessDumpKeyDown" AutomationProperties.Name="Process Dump File" />
</Grid>

<!-- Option 2 capturing memory from active processes -->
Expand All @@ -65,20 +65,24 @@
<TextBlock Grid.Column="0" VerticalAlignment="Center" Margin="5,0,0,0" ToolTip="Only processes that match this RegEx filter pattern are displayed.">
<Hyperlink Command="Help" CommandParameter="ProcessFilterTextBox">Filter:</Hyperlink>
</TextBlock>
<TextBox KeyboardNavigation.TabIndex="0" VerticalAlignment="Center" Grid.Column="1" Width="100" Margin="5,0,0,0" Name="FilterTextBox" TextChanged="FilterTextChanged" PreviewKeyDown="FilterTextKeyDown"/>
<TextBox KeyboardNavigation.TabIndex="0" VerticalAlignment="Center" Grid.Column="1" Width="100" Margin="5,0,0,0" Name="FilterTextBox" TextChanged="FilterTextChanged" PreviewKeyDown="FilterTextKeyDown" AutomationProperties.Name="Process Filter"/>

<TextBlock Grid.Column="2" VerticalAlignment="Center" Margin="5,0,0,0" ToolTip="Normally only processed with GC heaps are displayed. Checking this shows all processes.">
<Hyperlink Command="Help" CommandParameter="AllProcsCheckBox">All Procs:</Hyperlink>
</TextBlock>
<CheckBox Grid.Column="3" Name="AllProcsCheckBox" VerticalAlignment="Center" IsChecked="true" Click="AllProcsClick" />
<CheckBox Grid.Column="3" Name="AllProcsCheckBox" VerticalAlignment="Center" IsChecked="true" Click="AllProcsClick" AutomationProperties.Name="All Processes" />

<TextBlock Grid.Column="4" Margin="15,0,0,0" VerticalAlignment="Center" Name="ElevateWarning">
Only Processes you have perission to inspect to are shown.
<Hyperlink Click="ElevateToAdminClick">Elevate to Admin</Hyperlink> to see all processes.
</TextBlock>
</Grid>
<ListBox KeyboardNavigation.TabIndex="1" Margin="5,28,5,12" MinHeight="80" Name="Processes" MouseDoubleClick="ProcessesMouseDoubleClick" SelectionChanged="Processes_SelectionChanged" FontFamily="Courier New" Grid.RowSpan="2">

<ListBox KeyboardNavigation.TabIndex="1" Margin="5,28,5,12" MinHeight="80" Name="Processes" MouseDoubleClick="ProcessesMouseDoubleClick" SelectionChanged="Processes_SelectionChanged" FontFamily="Courier New" Grid.RowSpan="2" AutomationProperties.Name="Processes">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="AutomationProperties.Name" Value="{Binding ShortDescription}" />
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Grid>

Expand All @@ -93,7 +97,7 @@
<TextBlock Grid.Column="0" Width="100" Margin="5,0" VerticalAlignment="Center" ToolTip="The name of the data file to create." >
<Hyperlink Command="Help" CommandParameter="GCHeapDataFileNameTextBox">Output Data File:</Hyperlink>
</TextBlock>
<TextBox Grid.Column="1" Name="DataFileNameTextBox" VerticalAlignment="Center" KeyDown="DataFileKeyDown" />
<TextBox Grid.Column="1" Name="DataFileNameTextBox" VerticalAlignment="Center" KeyDown="DataFileKeyDown" AutomationProperties.Name="Output Data Filename" />
<Button Grid.Column="2" Content="..." Width="25" Margin="5,5"
VerticalAlignment="Center" Click="DataFileButtonClick" ToolTip="Click to select the file name in a file chooser dialog." />
</Grid>
Expand Down Expand Up @@ -123,12 +127,12 @@
<TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="5,0,5,0" ToolTip="If the heap has more object than this (in Kilo objects) than this, only a sample is taken." >
<Hyperlink Command="Help" CommandParameter="MaxDumpTextBox">Max Dump<LineBreak/>K Objs:</Hyperlink>
</TextBlock>
<TextBox Grid.Column="2" Name="MaxDumpTextBox" VerticalAlignment="Center" Width="50" Margin="5,0"/>
<TextBox Grid.Column="2" Name="MaxDumpTextBox" VerticalAlignment="Center" Width="50" Margin="5,0" AutomationProperties.Name="Maximum dump size in kilo objects"/>

<TextBlock Grid.Column="3" VerticalAlignment="Center" Margin="5,0,2,0" ToolTip="If checked the process will be frozen during the dump.">
<Hyperlink Command="Help" CommandParameter="FreezeCheckBox">Freeze:</Hyperlink>
</TextBlock>
<CheckBox Grid.Column="4" Name="FreezeCheckBox" VerticalAlignment="Center" Margin="0,0,10,0"/>
<CheckBox Grid.Column="4" Name="FreezeCheckBox" VerticalAlignment="Center" Margin="0,0,10,0" AutomationProperties.Name="Freeze"/>

<!-- TODO FIX NOW Add DumpData back in.
<TextBlock Grid.Column="5" VerticalAlignment="Center" Margin="5,0,2,0" ToolTip="If checked the data in objects as well as the connectivity information is dumped.">
Expand All @@ -140,7 +144,7 @@
<TextBlock Grid.Column="7" VerticalAlignment="Center" Margin="5,0,2,0" ToolTip="If checked Dump will be in Clr Profiler format.">
<Hyperlink Command="Help" CommandParameter="SaveETLCheckBox">Save<LineBreak/>ETL:</Hyperlink>
</TextBlock>
<CheckBox Grid.Column="8" Name="SaveETLCheckBox" VerticalAlignment="Center" Margin="0,0,10,0"/>
<CheckBox Grid.Column="8" Name="SaveETLCheckBox" VerticalAlignment="Center" Margin="0,0,10,0" AutomationProperties.Name="Save ETL"/>

<Button Name="GCButton" Grid.Column="12" Margin="5,0,20,5" Width="60" VerticalAlignment="Center" Click="GCButtonClick"
ToolTip="Causes a GC to happen in the selected process">Force GC</Button>
Expand Down
Loading