From 68d57236597b4068e0cb0a013b85536699099fb4 Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Mon, 2 Aug 2021 15:02:53 -0300 Subject: [PATCH 1/8] tentativa 1 --- .../UIAutomationClient/MS/Internal/Automation/Schema.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs index e8cacb27ce6..33e54b06396 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs @@ -209,9 +209,9 @@ internal static object ConvertToElementArray(object value) return els; } - private enum HeadingLevel + private enum AutomationHeadingLevel { - None = 80050, + None = 0, Level1, Level2, Level3, @@ -288,7 +288,7 @@ private enum HeadingLevel new AutomationPropertyInfo( null, AutomationElement.ItemStatusProperty, typeof(string), "" ), new AutomationPropertyInfo( null, AutomationElement.SizeOfSetProperty, typeof(int), -1 ), new AutomationPropertyInfo( null, AutomationElement.PositionInSetProperty, typeof(int), -1 ), - new AutomationPropertyInfo( null, AutomationElement.HeadingLevelProperty, typeof(HeadingLevel), HeadingLevel.None ), + new AutomationPropertyInfo( null, AutomationElement.HeadingLevelProperty, typeof(AutomationHeadingLevel),AutomationHeadingLevel.None ), new AutomationPropertyInfo( convertToBool, AutomationElement.IsDialogProperty, typeof(bool), false ), // Pattern Available properties From 6a5d38f57205b01e380b5f32def7d67d4cf8c59f Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Mon, 2 Aug 2021 15:14:11 -0300 Subject: [PATCH 2/8] tentativa 2 --- .../UIAutomationClient-ref.baseline.txt | 4 ++- .../MS/Internal/Automation/Schema.cs | 30 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt index fcc74cf8643..dee0c3be876 100644 --- a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt +++ b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt @@ -1 +1,3 @@ -Total Issues: 0 +Compat issues with assembly UIAutomationClient: +TypesMustExist : Type 'System.Windows.Automation.AutomationHeadingLevel' does not exist in the implementation but it does exist in the contract. +Total Issues: 1 diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs index 33e54b06396..e843bb962cd 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs @@ -18,6 +18,23 @@ using System.Diagnostics; using MS.Internal.Automation; +namespace System.Windows.Automation +{ + public enum AutomationHeadingLevel + { + None = 0, + Level1, + Level2, + Level3, + Level4, + Level5, + Level6, + Level7, + Level8, + Level9, + } +} + namespace MS.Internal.Automation { // Disable warning for obsolete types. These are scheduled to be removed in M8.2 so @@ -209,19 +226,6 @@ internal static object ConvertToElementArray(object value) return els; } - private enum AutomationHeadingLevel - { - None = 0, - Level1, - Level2, - Level3, - Level4, - Level5, - Level6, - Level7, - Level8, - Level9, - } // Delegate versions of the above... private static AutomationPropertyConverter convertToBool = new AutomationPropertyConverter(ConvertToBool); From bb455ee7b4758bee6e442a11ef94ca1bce7ce271 Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Mon, 2 Aug 2021 15:23:00 -0300 Subject: [PATCH 3/8] tentativa 3, dont compile because automationheadinglevel is already defined in presentation core --- .../Automation/AutomationHeadingLevel.cs | 69 +++++++++++++++++++ .../UIAutomationClient.csproj | 1 + 2 files changed, 70 insertions(+) create mode 100644 src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs new file mode 100644 index 00000000000..c9632f6f3f5 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs @@ -0,0 +1,69 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// +// +// +// Description: Enumeration for possible values of AutomationProperties.HeadingLevel +// + +namespace System.Windows.Automation +{ + /// + /// Describes the heading level of a control + /// + public enum AutomationHeadingLevel + { + /// + /// The element does not have a heading level + /// + None = 0, + + /// + /// The element has a heading level of 1 + /// + Level1, + + /// + /// The element has a heading level of 2 + /// + Level2, + + /// + /// The element has a heading level of 3 + /// + Level3, + + /// + /// The element has a heading level of 4 + /// + Level4, + + /// + /// The element has a heading level of 5 + /// + Level5, + + /// + /// The element has a heading level of 6 + /// + Level6, + + /// + /// The element has a heading level of 7 + /// + Level7, + + /// + /// The element has a heading level of 8 + /// + Level8, + + /// + /// The element has a heading level of 9 + /// + Level9, + } + +} \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj index 2ccf4270b24..7d75e4f8bb6 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj @@ -61,6 +61,7 @@ + From df74d660ee8e67a361b80efd3e48567201d02af3 Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Mon, 2 Aug 2021 15:51:10 -0300 Subject: [PATCH 4/8] tentativa 4, referenciando, erro de compilacao --- .../UIAutomation/UIAutomationClient/UIAutomationClient.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj index 7d75e4f8bb6..60a990f7f61 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj @@ -61,7 +61,6 @@ - @@ -93,6 +92,7 @@ + From 9cab65f957cfa3a4e46e9ed30e83ab400453565a Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Mon, 2 Aug 2021 16:11:46 -0300 Subject: [PATCH 5/8] tentativa 5, compila, mas nao funciona, com apicompat error --- .../MS/Internal/Automation/Schema.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs index e843bb962cd..2b188b85c07 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs @@ -18,22 +18,6 @@ using System.Diagnostics; using MS.Internal.Automation; -namespace System.Windows.Automation -{ - public enum AutomationHeadingLevel - { - None = 0, - Level1, - Level2, - Level3, - Level4, - Level5, - Level6, - Level7, - Level8, - Level9, - } -} namespace MS.Internal.Automation { From e89bd21ea670e118590bffb118987d1641338683 Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Tue, 3 Aug 2021 17:20:32 -0300 Subject: [PATCH 6/8] this one works --- .../UIAutomationClient-ref.baseline.txt | 4 +- .../Automation/AutomationHeadingLevel.cs | 69 ------------------- .../UIAutomationClient.csproj | 2 +- 3 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs diff --git a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt index dee0c3be876..fcc74cf8643 100644 --- a/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt +++ b/src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/UIAutomationClient-ref.baseline.txt @@ -1,3 +1 @@ -Compat issues with assembly UIAutomationClient: -TypesMustExist : Type 'System.Windows.Automation.AutomationHeadingLevel' does not exist in the implementation but it does exist in the contract. -Total Issues: 1 +Total Issues: 0 diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs deleted file mode 100644 index c9632f6f3f5..00000000000 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationHeadingLevel.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// -// -// -// Description: Enumeration for possible values of AutomationProperties.HeadingLevel -// - -namespace System.Windows.Automation -{ - /// - /// Describes the heading level of a control - /// - public enum AutomationHeadingLevel - { - /// - /// The element does not have a heading level - /// - None = 0, - - /// - /// The element has a heading level of 1 - /// - Level1, - - /// - /// The element has a heading level of 2 - /// - Level2, - - /// - /// The element has a heading level of 3 - /// - Level3, - - /// - /// The element has a heading level of 4 - /// - Level4, - - /// - /// The element has a heading level of 5 - /// - Level5, - - /// - /// The element has a heading level of 6 - /// - Level6, - - /// - /// The element has a heading level of 7 - /// - Level7, - - /// - /// The element has a heading level of 8 - /// - Level8, - - /// - /// The element has a heading level of 9 - /// - Level9, - } - -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj index 60a990f7f61..111b3157ea6 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj @@ -92,10 +92,10 @@ - + From b24406d4b57d42660342d326e48d48d13b07907c Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Thu, 5 Aug 2021 16:26:06 -0300 Subject: [PATCH 7/8] using headinglevel enum --- .../MS/Internal/Automation/Schema.cs | 4 +- .../System/Windows/Automation/HeadingLevel.cs | 70 +++++++++++++++++++ .../UIAutomationTypes.csproj | 1 + .../ref/UIAutomationTypes.cs | 13 ++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs index 2b188b85c07..82684e34f7f 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs @@ -147,6 +147,7 @@ internal static AutomationPatternInfo [ ] GetPatternInfoTable() private static object ConvertToExpandCollapseState(object value) { return (ExpandCollapseState)value; } private static object ConvertToOrientationType(object value) { return (OrientationType)value; } private static object ConvertToDockPosition(object value) { return (DockPosition)value; } + private static object ConvertToAutomationHeadingLevel(object value) { return (HeadingLevel)value; } private static object ConvertToRect(object value) { @@ -226,6 +227,7 @@ internal static object ConvertToElementArray(object value) private static AutomationPropertyConverter convertToElementArray = new AutomationPropertyConverter(ConvertToElementArray); private static AutomationPropertyConverter convertToControlType = new AutomationPropertyConverter(ConvertToControlType); private static AutomationPropertyConverter convertToCultureInfo = new AutomationPropertyConverter(ConvertToCultureInfo); + private static AutomationPropertyConverter convertToAutomationHeadingLevel = new AutomationPropertyConverter(ConvertToAutomationHeadingLevel); #endregion Private Methods @@ -276,7 +278,7 @@ internal static object ConvertToElementArray(object value) new AutomationPropertyInfo( null, AutomationElement.ItemStatusProperty, typeof(string), "" ), new AutomationPropertyInfo( null, AutomationElement.SizeOfSetProperty, typeof(int), -1 ), new AutomationPropertyInfo( null, AutomationElement.PositionInSetProperty, typeof(int), -1 ), - new AutomationPropertyInfo( null, AutomationElement.HeadingLevelProperty, typeof(AutomationHeadingLevel),AutomationHeadingLevel.None ), + new AutomationPropertyInfo( convertToAutomationHeadingLevel, AutomationElement.HeadingLevelProperty, typeof(HeadingLevel), HeadingLevel.None ), new AutomationPropertyInfo( convertToBool, AutomationElement.IsDialogProperty, typeof(bool), false ), // Pattern Available properties diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs new file mode 100644 index 00000000000..74c1d42ad85 --- /dev/null +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs @@ -0,0 +1,70 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// +// +// +// Description: Enumeration for possible values of AutomationProperties.HeadingLevel +// + +namespace System.Windows.Automation +{ + /// + /// Describes the heading level of a control + /// + public enum HeadingLevel + { + /// + /// The element does not have a heading level + /// + None = 80050, + + /// + /// The element has a heading level of 1 + /// + Level1, + + /// + /// The element has a heading level of 2 + /// + Level2, + + /// + /// The element has a heading level of 3 + /// + Level3, + + /// + /// The element has a heading level of 4 + /// + Level4, + + /// + /// The element has a heading level of 5 + /// + Level5, + + /// + /// The element has a heading level of 6 + /// + Level6, + + /// + /// The element has a heading level of 7 + /// + Level7, + + /// + /// The element has a heading level of 8 + /// + Level8, + + /// + /// The element has a heading level of 9 + /// + Level9, + } + +} \ No newline at end of file diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj index 62fa3358271..498573fd0fd 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj @@ -50,6 +50,7 @@ + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs index 316b97ba15a..79ef92a40c5 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs @@ -289,6 +289,19 @@ public enum OrientationType Horizontal = 1, Vertical = 2, } + public enum HeadingLevel + { + None = 80050, + Level1, + Level2, + Level3, + Level4, + Level5, + Level6, + Level7, + Level8, + Level9, + } public partial class ProxyAssemblyNotLoadedException : System.Exception { public ProxyAssemblyNotLoadedException() { } From a5581b9af78e197c627088948944d1470d1180d4 Mon Sep 17 00:00:00 2001 From: Felipe da Conceicao Guimaraes Date: Fri, 6 Aug 2021 12:47:29 -0300 Subject: [PATCH 8/8] last version for pr --- .../MS/Internal/Automation/Schema.cs | 32 ++++++++++++++- .../System/Windows/Automation/HeadingLevel.cs | 2 +- .../Windows/Automation/PropertyCondition.cs | 40 +++++++++++++++++++ .../UIAutomationClient.csproj | 1 + .../ref/UIAutomationClient.cs | 13 ++++++ .../UIAutomationTypes.csproj | 1 - .../ref/UIAutomationTypes.cs | 13 ------ 7 files changed, 85 insertions(+), 17 deletions(-) rename src/Microsoft.DotNet.Wpf/src/UIAutomation/{UIAutomationTypes => UIAutomationClient}/System/Windows/Automation/HeadingLevel.cs (98%) diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs index 82684e34f7f..38c2f02e4ad 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Schema.cs @@ -147,7 +147,6 @@ internal static AutomationPatternInfo [ ] GetPatternInfoTable() private static object ConvertToExpandCollapseState(object value) { return (ExpandCollapseState)value; } private static object ConvertToOrientationType(object value) { return (OrientationType)value; } private static object ConvertToDockPosition(object value) { return (DockPosition)value; } - private static object ConvertToAutomationHeadingLevel(object value) { return (HeadingLevel)value; } private static object ConvertToRect(object value) { @@ -211,6 +210,35 @@ internal static object ConvertToElementArray(object value) return els; } + private static object ConvertToAutomationHeadingLevel(object value) + { + var headingLevel = (HeadingLevel)value; + switch(headingLevel) + { + case HeadingLevel.None: + return AutomationHeadingLevel.None; + case HeadingLevel.Level1: + return AutomationHeadingLevel.Level1; + case HeadingLevel.Level2: + return AutomationHeadingLevel.Level2; + case HeadingLevel.Level3: + return AutomationHeadingLevel.Level3; + case HeadingLevel.Level4: + return AutomationHeadingLevel.Level4; + case HeadingLevel.Level5: + return AutomationHeadingLevel.Level5; + case HeadingLevel.Level6: + return AutomationHeadingLevel.Level6; + case HeadingLevel.Level7: + return AutomationHeadingLevel.Level7; + case HeadingLevel.Level8: + return AutomationHeadingLevel.Level8; + case HeadingLevel.Level9: + return AutomationHeadingLevel.Level9; + default: + return AutomationHeadingLevel.None; + } + } // Delegate versions of the above... private static AutomationPropertyConverter convertToBool = new AutomationPropertyConverter(ConvertToBool); @@ -278,7 +306,7 @@ internal static object ConvertToElementArray(object value) new AutomationPropertyInfo( null, AutomationElement.ItemStatusProperty, typeof(string), "" ), new AutomationPropertyInfo( null, AutomationElement.SizeOfSetProperty, typeof(int), -1 ), new AutomationPropertyInfo( null, AutomationElement.PositionInSetProperty, typeof(int), -1 ), - new AutomationPropertyInfo( convertToAutomationHeadingLevel, AutomationElement.HeadingLevelProperty, typeof(HeadingLevel), HeadingLevel.None ), + new AutomationPropertyInfo( convertToAutomationHeadingLevel, AutomationElement.HeadingLevelProperty, typeof(AutomationHeadingLevel),AutomationHeadingLevel.None ), new AutomationPropertyInfo( convertToBool, AutomationElement.IsDialogProperty, typeof(bool), false ), // Pattern Available properties diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/HeadingLevel.cs similarity index 98% rename from src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs rename to src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/HeadingLevel.cs index 74c1d42ad85..ca6d18f9eba 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/System/Windows/Automation/HeadingLevel.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/HeadingLevel.cs @@ -14,7 +14,7 @@ namespace System.Windows.Automation /// /// Describes the heading level of a control /// - public enum HeadingLevel + internal enum HeadingLevel { /// /// The element does not have a heading level diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/PropertyCondition.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/PropertyCondition.cs index 0ebcac2433d..2c3eb8a13ca 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/PropertyCondition.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/PropertyCondition.cs @@ -173,6 +173,46 @@ void Init(AutomationProperty property, object val, PropertyConditionFlags flags { val = ((CultureInfo)val).LCID; } + else if (val is AutomationHeadingLevel) + { + AutomationHeadingLevel automationHeadingLevel = (AutomationHeadingLevel)(val); + switch(automationHeadingLevel) + { + case AutomationHeadingLevel.None: + val = HeadingLevel.None; + break; + case AutomationHeadingLevel.Level1: + val = HeadingLevel.Level1; + break; + case AutomationHeadingLevel.Level2: + val = HeadingLevel.Level2; + break; + case AutomationHeadingLevel.Level3: + val = HeadingLevel.Level3; + break; + case AutomationHeadingLevel.Level4: + val = HeadingLevel.Level4; + break; + case AutomationHeadingLevel.Level5: + val = HeadingLevel.Level5; + break; + case AutomationHeadingLevel.Level6: + val = HeadingLevel.Level6; + break; + case AutomationHeadingLevel.Level7: + val = HeadingLevel.Level7; + break; + case AutomationHeadingLevel.Level8: + val = HeadingLevel.Level8; + break; + case AutomationHeadingLevel.Level9: + val = HeadingLevel.Level9; + break; + default: + val = HeadingLevel.None; + break; + } + } _property = property; _val = val; diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj index 111b3157ea6..8fddd9cdc0b 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/UIAutomationClient.csproj @@ -70,6 +70,7 @@ + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/ref/UIAutomationClient.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/ref/UIAutomationClient.cs index 2923ac6b042..45001f544f6 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/ref/UIAutomationClient.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/ref/UIAutomationClient.cs @@ -282,6 +282,19 @@ public partial struct GridPatternInformation public int RowCount { get { throw null; } } } } + internal enum HeadingLevel + { + None = 80050, + Level1, + Level2, + Level3, + Level4, + Level5, + Level6, + Level7, + Level8, + Level9, + } public partial class InvokePattern : System.Windows.Automation.BasePattern { internal InvokePattern() { } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj index 498573fd0fd..62fa3358271 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/UIAutomationTypes.csproj @@ -50,7 +50,6 @@ - diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs index 79ef92a40c5..316b97ba15a 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationTypes/ref/UIAutomationTypes.cs @@ -289,19 +289,6 @@ public enum OrientationType Horizontal = 1, Vertical = 2, } - public enum HeadingLevel - { - None = 80050, - Level1, - Level2, - Level3, - Level4, - Level5, - Level6, - Level7, - Level8, - Level9, - } public partial class ProxyAssemblyNotLoadedException : System.Exception { public ProxyAssemblyNotLoadedException() { }