Skip to content

Commit 2ca1aaf

Browse files
committed
Changing DataGridItemAutomationPeer::GetNameCore & fixing DATAGRIDROWHEADER_stateNormalEditingRowFocused
1 parent f4b87e1 commit 2ca1aaf

12 files changed

+78
-13
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridAutomationPeer.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ protected override IList<AutomationPeer> GetChildrenCore()
184184
/// <returns>The string that contains the name.</returns>
185185
protected override string GetClassNameCore()
186186
{
187-
return Owner.GetType().Name;
187+
string classNameCore = Owner.GetType().Name;
188+
#if DEBUG_AUTOMATION
189+
Debug.WriteLine("DataGridAutomationPeer.GetClassNameCore returns " + classNameCore);
190+
#endif
191+
return classNameCore;
188192
}
189193

190194
/// <summary>
@@ -212,6 +216,10 @@ protected override string GetNameCore()
212216
}
213217
}
214218

219+
#if DEBUG_AUTOMATION
220+
Debug.WriteLine("DataGridAutomationPeer.GetNameCore returns " + name);
221+
#endif
222+
215223
return name;
216224
}
217225

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridCellAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using System.Collections.Generic;
67
using Microsoft.Toolkit.Uwp.UI.Controls;
78
using Microsoft.Toolkit.Uwp.UI.Controls.DataGridInternals;
@@ -107,7 +108,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
107108
/// <returns>The string that contains the name.</returns>
108109
protected override string GetClassNameCore()
109110
{
110-
return Owner.GetType().Name;
111+
string classNameCore = Owner.GetType().Name;
112+
#if DEBUG_AUTOMATION
113+
System.Diagnostics.Debug.WriteLine("DataGridCellAutomationPeer.GetClassNameCore returns " + classNameCore);
114+
#endif
115+
return classNameCore;
111116
}
112117

113118
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridColumnHeaderAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using System.ComponentModel;
67
using Microsoft.Toolkit.Uwp.UI.Controls;
78
using Microsoft.Toolkit.Uwp.UI.Controls.DataGridInternals;
@@ -50,7 +51,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
5051
/// <returns>The string that contains the name.</returns>
5152
protected override string GetClassNameCore()
5253
{
53-
return Owner.GetType().Name;
54+
string classNameCore = Owner.GetType().Name;
55+
#if DEBUG_AUTOMATION
56+
System.Diagnostics.Debug.WriteLine("DataGridColumnHeaderAutomationPeer.GetClassNameCore returns " + classNameCore);
57+
#endif
58+
return classNameCore;
5459
}
5560

5661
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridColumnHeadersPresenterAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using Microsoft.Toolkit.Uwp.UI.Controls.Primitives;
67
using Windows.UI.Xaml.Automation.Peers;
78

@@ -37,7 +38,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
3738
/// <returns>The string that contains the name.</returns>
3839
protected override string GetClassNameCore()
3940
{
40-
return Owner.GetType().Name;
41+
string classNameCore = Owner.GetType().Name;
42+
#if DEBUG_AUTOMATION
43+
System.Diagnostics.Debug.WriteLine("DataGridColumnHeadersPresenterAutomationPeer.GetClassNameCore returns " + classNameCore);
44+
#endif
45+
return classNameCore;
4146
}
4247

4348
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridDetailsPresenterAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using Microsoft.Toolkit.Uwp.UI.Controls.Primitives;
67
using Windows.UI.Xaml.Automation.Peers;
78

@@ -37,7 +38,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
3738
/// <returns>The string that contains the name.</returns>
3839
protected override string GetClassNameCore()
3940
{
40-
return this.Owner.GetType().Name;
41+
string classNameCore = Owner.GetType().Name;
42+
#if DEBUG_AUTOMATION
43+
System.Diagnostics.Debug.WriteLine("DataGridDetailsPresenterAutomationPeer.GetClassNameCore returns " + classNameCore);
44+
#endif
45+
return classNameCore;
4146
}
4247

4348
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridGroupItemAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using System;
67
using System.Collections.Generic;
78
using System.Diagnostics;
@@ -200,7 +201,11 @@ protected override IList<AutomationPeer> GetChildrenCore()
200201
/// <returns>The string that contains the name.</returns>
201202
protected override string GetClassNameCore()
202203
{
203-
return this.OwningRowGroupHeaderPeer != null ? this.OwningRowGroupHeaderPeer.GetClassName() : string.Empty;
204+
string classNameCore = this.OwningRowGroupHeaderPeer != null ? this.OwningRowGroupHeaderPeer.GetClassName() : string.Empty;
205+
#if DEBUG_AUTOMATION
206+
Debug.WriteLine("DataGridGroupItemAutomationPeer.GetClassNameCore returns " + classNameCore);
207+
#endif
208+
return classNameCore;
204209
}
205210

206211
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridItemAutomationPeer.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using System;
67
using System.Collections.Generic;
78
using Microsoft.Toolkit.Uwp.UI.Controls;
@@ -151,7 +152,11 @@ protected override IList<AutomationPeer> GetChildrenCore()
151152
/// <returns>The string that contains the name.</returns>
152153
protected override string GetClassNameCore()
153154
{
154-
return (this.OwningRowPeer != null) ? this.OwningRowPeer.GetClassName() : string.Empty;
155+
string classNameCore = (this.OwningRowPeer != null) ? this.OwningRowPeer.GetClassName() : string.Empty;
156+
#if DEBUG_AUTOMATION
157+
System.Diagnostics.Debug.WriteLine("DataGridItemAutomationPeer.GetClassNameCore returns " + classNameCore);
158+
#endif
159+
return classNameCore;
155160
}
156161

157162
/// <summary>
@@ -219,11 +224,18 @@ protected override string GetNameCore()
219224
string owningRowPeerName = this.OwningRowPeer.GetName();
220225
if (!string.IsNullOrEmpty(owningRowPeerName))
221226
{
227+
#if DEBUG_AUTOMATION
228+
System.Diagnostics.Debug.WriteLine("DataGridItemAutomationPeer.GetNameCore returns " + owningRowPeerName);
229+
#endif
222230
return owningRowPeerName;
223231
}
224232
}
225233

226-
return string.Empty;
234+
string name = UI.Controls.Properties.Resources.DataGridRowAutomationPeer_ItemType;
235+
#if DEBUG_AUTOMATION
236+
System.Diagnostics.Debug.WriteLine("DataGridItemAutomationPeer.GetNameCore returns " + name);
237+
#endif
238+
return name;
227239
}
228240

229241
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridRowAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using Microsoft.Toolkit.Uwp.UI.Controls;
67
using Windows.UI.Xaml.Automation.Peers;
78

@@ -37,7 +38,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
3738
/// <returns>The string that contains the name.</returns>
3839
protected override string GetClassNameCore()
3940
{
40-
return Owner.GetType().Name;
41+
string classNameCore = Owner.GetType().Name;
42+
#if DEBUG_AUTOMATION
43+
System.Diagnostics.Debug.WriteLine("DataGridRowAutomationPeer.GetClassNameCore returns " + classNameCore);
44+
#endif
45+
return classNameCore;
4146
}
4247

4348
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridRowGroupHeaderAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using Microsoft.Toolkit.Uwp.UI.Controls;
67
using Windows.UI.Xaml.Automation.Peers;
78

@@ -37,7 +38,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
3738
/// <returns>The string that contains the name.</returns>
3839
protected override string GetClassNameCore()
3940
{
40-
return Owner.GetType().Name;
41+
string classNameCore = Owner.GetType().Name;
42+
#if DEBUG_AUTOMATION
43+
System.Diagnostics.Debug.WriteLine("DataGridRowGroupHeaderAutomationPeer.GetClassNameCore returns " + classNameCore);
44+
#endif
45+
return classNameCore;
4146
}
4247
}
4348
}

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/Automation/DataGridRowHeaderAutomationPeer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
// #define DEBUG_AUTOMATION
56
using Microsoft.Toolkit.Uwp.UI.Controls.Primitives;
67
using Windows.UI.Xaml.Automation.Peers;
78

@@ -45,7 +46,11 @@ protected override AutomationControlType GetAutomationControlTypeCore()
4546
/// <returns>The string that contains the name.</returns>
4647
protected override string GetClassNameCore()
4748
{
48-
return Owner.GetType().Name;
49+
string classNameCore = Owner.GetType().Name;
50+
#if DEBUG_AUTOMATION
51+
System.Diagnostics.Debug.WriteLine("DataGridRowHeaderAutomationPeer.GetClassNameCore returns " + classNameCore);
52+
#endif
53+
return classNameCore;
4954
}
5055

5156
/// <summary>

0 commit comments

Comments
 (0)