@@ -72,7 +72,6 @@ public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfDataGridV
7272 Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , - 1 ) , accessibilityObject . Name ) ;
7373 }
7474
75- // Whether UIA row indexing is 1-based or 0-based, is controlled by the DataGridViewUIAStartRowCountAtZero switch
7675 [ Fact ]
7776 public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected ( )
7877 {
@@ -86,13 +85,12 @@ public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected()
8685 AccessibleObject accessibleObject2 = dataGridView . Rows [ 1 ] . AccessibilityObject ;
8786 AccessibleObject accessibleObject3 = dataGridView . Rows [ 2 ] . AccessibilityObject ;
8887
89- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject1 . Name ) ;
90- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 2 ) , accessibleObject2 . Name ) ;
91- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 3 ) , accessibleObject3 . Name ) ;
88+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , accessibleObject1 . Name ) ;
89+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject2 . Name ) ;
90+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 2 ) , accessibleObject3 . Name ) ;
9291 Assert . False ( dataGridView . IsHandleCreated ) ;
9392 }
9493
95- // Whether UIA row indexing is 1-based or 0-based, is controlled by the DataGridViewUIAStartRowCountAtZero switch
9694 [ Fact ]
9795 public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfFirstRowHidden ( )
9896 {
@@ -108,12 +106,11 @@ public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfFirstRowH
108106 AccessibleObject accessibleObject3 = dataGridView . Rows [ 2 ] . AccessibilityObject ;
109107
110108 Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , - 1 ) , accessibleObject1 . Name ) ;
111- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject2 . Name ) ;
112- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 2 ) , accessibleObject3 . Name ) ;
109+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , accessibleObject2 . Name ) ;
110+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject3 . Name ) ;
113111 Assert . False ( dataGridView . IsHandleCreated ) ;
114112 }
115113
116- // Whether UIA row indexing is 1-based or 0-based, is controlled by the DataGridViewUIAStartRowCountAtZero switch
117114 [ Fact ]
118115 public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfSecondRowHidden ( )
119116 {
@@ -128,13 +125,12 @@ public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfSecondRow
128125 AccessibleObject accessibleObject2 = dataGridView . Rows [ 1 ] . AccessibilityObject ;
129126 AccessibleObject accessibleObject3 = dataGridView . Rows [ 2 ] . AccessibilityObject ;
130127
131- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject1 . Name ) ;
128+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , accessibleObject1 . Name ) ;
132129 Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , - 1 ) , accessibleObject2 . Name ) ;
133- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 2 ) , accessibleObject3 . Name ) ;
130+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject3 . Name ) ;
134131 Assert . False ( dataGridView . IsHandleCreated ) ;
135132 }
136133
137- // Whether UIA row indexing is 1-based or 0-based, is controlled by the DataGridViewUIAStartRowCountAtZero switch
138134 [ Fact ]
139135 public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfLastRowHidden ( )
140136 {
@@ -149,8 +145,8 @@ public void DataGridViewRowAccessibleObject_Name_Get_ReturnsExpected_IfLastRowHi
149145 AccessibleObject accessibleObject2 = dataGridView . Rows [ 1 ] . AccessibilityObject ;
150146 AccessibleObject accessibleObject3 = dataGridView . Rows [ 2 ] . AccessibilityObject ;
151147
152- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject1 . Name ) ;
153- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 2 ) , accessibleObject2 . Name ) ;
148+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , accessibleObject1 . Name ) ;
149+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , accessibleObject2 . Name ) ;
154150 Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , - 1 ) , accessibleObject3 . Name ) ;
155151 Assert . False ( dataGridView . IsHandleCreated ) ;
156152 }
@@ -2388,17 +2384,17 @@ public void DataGridViewRowAccessibleObject_GetPropertyValue_ValueValuePropertyI
23882384 [ WinFormsFact ]
23892385 public void DataGridView_SwitchConfigured_AdjustsRowStartIndices ( )
23902386 {
2391- LocalAppContextSwitches . SetDataGridViewUIAStartRowCountAtZero ( true ) ;
2387+ AppContext . SetSwitch ( LocalAppContextSwitches . DataGridViewUIAStartRowCountAtOneSwitchName , true ) ;
23922388
23932389 using DataGridView dataGridView = new ( ) ;
23942390 dataGridView . Columns . Add ( new DataGridViewTextBoxColumn ( ) ) ;
23952391 dataGridView . Rows . Add ( new DataGridViewRow ( ) ) ;
23962392
2397- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , dataGridView . Rows [ 0 ] . AccessibilityObject . Name ) ;
2393+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , dataGridView . Rows [ 0 ] . AccessibilityObject . Name ) ;
23982394
2399- LocalAppContextSwitches . SetDataGridViewUIAStartRowCountAtZero ( false ) ;
2395+ AppContext . SetSwitch ( LocalAppContextSwitches . DataGridViewUIAStartRowCountAtOneSwitchName , false ) ;
24002396
2401- Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 1 ) , dataGridView . Rows [ 0 ] . AccessibilityObject . Name ) ;
2397+ Assert . Equal ( string . Format ( SR . DataGridView_AccRowName , 0 ) , dataGridView . Rows [ 0 ] . AccessibilityObject . Name ) ;
24022398 }
24032399
24042400 private class SubDataGridViewCell : DataGridViewCell
0 commit comments