-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Convert IRawElementProviderSimple to Cswin32 #10177
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/System.Windows.Forms.Primitives/src/Interop/OleAut32/Interop.VARIANT.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Interop/UiaCore/Interop.StubFragmentRoot.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Control.ControlAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Windows/Win32/PInvoke.UiaRaiseNotificationEvent.cs
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIA_PATTERN_ID.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/AccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Button.ButtonAccessibleObject.cs
Show resolved
Hide resolved
...itTests/System/Windows/Forms/AccessibleObjects/TabControl.TabControlAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/System/Windows/Forms/AccessibleObjects/TextBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...tests/UnitTests/System/Windows/Forms/AccessibleObjects/ToolStripItemAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...tests/UnitTests/System/Windows/Forms/AccessibleObjects/ToolStripItemAccessibleObjectTests.cs
Show resolved
Hide resolved
...ndows/Forms/AccessibleObjects/UpDownBase.UpDownButtons.UpDownButtonsAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/Interop/OleAut32/Interop.VARIANT.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Automation/UiaTextProvider.cs
Show resolved
Hide resolved
e6588ca
to
c6dd5be
Compare
e8dfb70
to
2a1d70c
Compare
Tanya-Solyanik
previously approved these changes
Nov 3, 2023
src/System.Windows.Forms.Primitives/src/Windows/Win32/UI/Accessibility/UIAHelper.cs
Outdated
Show resolved
Hide resolved
Tanya-Solyanik
approved these changes
Nov 3, 2023
gpetrou
pushed a commit
to gpetrou/winforms
that referenced
this pull request
Nov 3, 2023
* Convert IRawElementProviderSimple to Cswin32 * Add tests and fix XAccessibleObjectTests * more test updates * Use Cswin32 definition of ProviderOptions * Remove s_notificationEventAvailable from AccessibleObject and only use OS check * Preserve sig and update Interop.AccessibleObject tests * Place 1709 OSCheck inside PInvoke * Remove nint -> VARIANT operator and return VT_I4 VARIANTs for handles * use IUnknown* -> VARIANT explicit operator * Add VARIANT.True and VARIANT.False * Add WindowHandleToVariant helper method * address other feedback * remove unused variable * remove unused using * Update VARIANT.True and VARIANT.False * Update new file TreeViewLabelEditAccessibleObjectTests * clean up * Add more detail doc and add debug assert * Remove locale from link
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #9795
This change converts
IRawElementProviderSimple
to use Cswin32 definition. This interface includes definition ofGetPropertyValue
, which now returnsVARIANT
instead ofobject
, so the bulk of this change involves casting what was returned fromGetPropertyValue
to typeVARIANT
in XAccessibleObject. Note we cannot directly cast enums/structs toVARIANT
so these need to be first casted to what they really represent e.g.int
ornint
before casting toVARIANT
.Other changes include:
UiaDisconnectProvider
,UiaHostProviderFromHwnd
,UiaRaiseAutomationEvent
,UiaRaiseAutomationPropertyChangedEvent
,UiaRaiseNotificationEvent
,UiaRaiseStructureChangedEvent
,UiaReturnRawElementProvider
to Cswin32IsWindows10_1709OrGreater()
API sinceUiaRaiseNotificationEvent
requires it. We didn't have this check before, so I also kept old definition ofUiaRaiseNotificationEvent
in cases where the OS version requirement is not metSafeArrayScope
that takes an array and add testGetPropertyValue
no longer returnsobject
I tried to separate the test changes from the actual changes to make this somewhat easier to digest for review.
Microsoft Reviewers: Open in CodeFlow