Skip to content

Commit 3fd722a

Browse files
Removed most of the common dialogs from the accessibility test applicaiton because we don't own them (dotnet#5537)
We don't own UI in these dialogs, there is no reason to test them with in our applicaiton as we can't fix issues in these dialogs. We have a little more control over the printing-related dialogs, so I kept them.
1 parent abd4bfb commit 3fd722a

File tree

7 files changed

+28
-315
lines changed

7 files changed

+28
-315
lines changed

src/System.Windows.Forms/tests/AccessibilityTests/AccessibilityTests.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<UsingToolXliff>false</UsingToolXliff>
1010
</PropertyGroup>
1111

12-
13-
1412
<ItemGroup>
1513
<ProjectReference Include="..\..\src\System.Windows.Forms.csproj" />
1614
</ItemGroup>

src/System.Windows.Forms/tests/AccessibilityTests/DialogsTesting.Designer.cs

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/System.Windows.Forms/tests/AccessibilityTests/DialogsTesting.resx

Lines changed: 0 additions & 120 deletions
This file was deleted.

src/System.Windows.Forms/tests/AccessibilityTests/Main.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/System.Windows.Forms/tests/AccessibilityTests/Main.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,43 @@ public Main()
1515

1616
private void Button1_Click(object sender, EventArgs e)
1717
{
18-
Commontrol1 commontrol1 = new Commontrol1();
18+
Commontrol1 commontrol1 = new();
1919
commontrol1.Show();
2020
}
2121

2222
private void Button2_Click(object sender, EventArgs e)
2323
{
24-
CommonControl2 commonControl2 = new CommonControl2();
24+
CommonControl2 commonControl2 = new();
2525
commonControl2.Show();
2626
}
2727

2828
private void Button3_Click(object sender, EventArgs e)
2929
{
30-
DataControls dataControls = new DataControls();
30+
DataControls dataControls = new();
3131
dataControls.Show();
3232
}
3333

3434
private void Button4_Click(object sender, EventArgs e)
3535
{
36-
DialogsTesting dialogsTesting = new DialogsTesting();
37-
dialogsTesting.Show();
36+
TaskDialogTesting TaskDialogTesting = new();
37+
TaskDialogTesting.ShowEventsDemoTaskDialog();
3838
}
3939

4040
private void Button5_Click(object sender, EventArgs e)
4141
{
42-
MenuForm menuForm = new MenuForm();
42+
MenuForm menuForm = new();
4343
menuForm.Show();
4444
}
4545

4646
private void Button6_Click(object sender, EventArgs e)
4747
{
48-
PrintingTesting printingTesting = new PrintingTesting();
48+
PrintingTesting printingTesting = new();
4949
printingTesting.Show();
5050
}
5151

5252
private void Button7_Click(object sender, EventArgs e)
5353
{
54-
RemainingControls remainingControls = new RemainingControls();
54+
RemainingControls remainingControls = new();
5555
remainingControls.Show();
5656
}
5757

@@ -63,13 +63,13 @@ private void Button8_Click(object sender, EventArgs e)
6363

6464
private void btnDataBindingExample_Click(object sender, EventArgs e)
6565
{
66-
DataBindingExample dataBindingExample = new DataBindingExample();
66+
DataBindingExample dataBindingExample = new();
6767
dataBindingExample.Show();
6868
}
6969

7070
private void customAccessiblePropertiesButton_Click(object sender, EventArgs e)
7171
{
72-
CustomAccessiblePropertiesForm cusAcccName = new CustomAccessiblePropertiesForm();
72+
CustomAccessiblePropertiesForm cusAcccName = new();
7373
cusAcccName.StartPosition = FormStartPosition.CenterParent;
7474
cusAcccName.Show();
7575
}

src/System.Windows.Forms/tests/AccessibilityTests/PrintingTesting.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,37 @@ public PrintingTesting()
1616

1717
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
1818
{
19-
Font font = new Font("Times New Roman", 12);
20-
Brush bru = Brushes.Blue;
19+
using Font font = new("Times New Roman", 12);
2120
for (int i = 1; i <= 5; i++)
2221
{
23-
e.Graphics.DrawString(this.txtPrint.Text.ToString(), font, bru, i * 20, i * 20);
22+
e.Graphics.DrawString(txtPrint.Text.ToString(), font, Brushes.Blue, i * 20, i * 20);
2423
}
2524
}
2625

26+
// Printer settings dialog belongs to ComDlg32 - PageSetupDlgW
2727
private void BtnSetting_Click(object sender, EventArgs e)
2828
{
2929
pageSetupDialog1.Document = printDocument1;
30-
this.pageSetupDialog1.ShowDialog();
30+
pageSetupDialog1.ShowDialog();
3131
}
3232

3333
private void BtnPreView_Click(object sender, EventArgs e)
3434
{
35-
this.printPreviewDialog1.ShowDialog();
35+
printPreviewDialog1.ShowDialog();
3636
}
3737

38+
// Print dialog belongs to ComDlg32 - PrintDlgEx
3839
private void BtnPrint_Click(object sender, EventArgs e)
3940
{
40-
if (this.printDialog1.ShowDialog() == DialogResult.OK)
41+
if (printDialog1.ShowDialog() == DialogResult.OK)
4142
{
42-
this.printDocument1.Print();
43+
printDocument1.Print();
4344
}
4445
}
4546

4647
private void Button1_Click(object sender, EventArgs e)
4748
{
48-
this.printPreviewControl1.Document = this.printDocument1;
49+
printPreviewControl1.Document = this.printDocument1;
4950
}
5051
}
5152
}

0 commit comments

Comments
 (0)