[AppKit] Implement manual bindings for notification event args properties that use literal strings.#25273
[AppKit] Implement manual bindings for notification event args properties that use literal strings.#25273rolfbjarne wants to merge 3 commits intomainfrom
Conversation
…ties that use literal strings. Implement manual bindings for the following properties, because they use literal string keys instead of constant strings: - NSViewColumnMoveEventArgs.OldColumn / NewColumn - NSViewColumnResizeEventArgs.Column / OldWidth - NSOutlineViewItemEventArgs.Item - NSTextViewDidChangeSelectionEventArgs.OldSelectedCharacterRange - NSTextViewWillChangeNotifyingTextViewEventArgs.OldView / NewView - NSControlTextEditingEventArgs.FieldEditor - NSTextAlternativesSelectedAlternativeStringEventArgs.AlternativeString - NSMenuItemIndexEventArgs.MenuItemIndex - NSMenuItemEventArgs.MenuItem - NSWorkspaceFileOperationEventArgs.FileType - NSTextDidEndEditingEventArgs.Movement Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add tests for all the manually-bound notification event args properties, testing both the case where userInfo contains the expected key and the case where userInfo is null. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Implements manual bindings for several AppKit NSNotificationEventArgs properties whose userInfo keys are documented as literal strings (not exported constant keys), and adds tests validating the behavior.
Changes:
- Replaces a set of
appkit.csevent-args properties with manual C# implementations that readNotification.UserInfousing literal string keys. - Adds new AppKit partial
NSNotificationEventArgsclasses implementing the affected properties. - Adds a macOS test suite covering both populated and
nulluserInfocases, and updates the xtro-sharpie ignore list accordingly.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore | Removes ignore entries that should no longer be reported once manual bindings exist. |
| tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs | Adds tests validating the new manual event-args property bindings. |
| src/frameworks.sources | Includes the new AppKit source files in the build. |
| src/appkit.cs | Removes generated [Export] property declarations in favor of manual bindings. |
| src/AppKit/NSWorkspaceFileOperationEventArgs.cs | Manual binding for FileType via "NSOperationNumber" key. |
| src/AppKit/NSViewColumnResizeEventArgs.cs | Manual bindings for Column and OldWidth via "NSTableColumn" / "NSOldWidth" keys. |
| src/AppKit/NSViewColumnMoveEventArgs.cs | Manual bindings for OldColumn / NewColumn via "NSOldColumn" / "NSNewColumn" keys. |
| src/AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs | Manual bindings for OldView / NewView via "NSOldNotifyingTextView" / "NSNewNotifyingTextView" keys. |
| src/AppKit/NSTextViewDidChangeSelectionEventArgs.cs | Manual binding for OldSelectedCharacterRange via "NSOldSelectedCharacterRange" key. |
| src/AppKit/NSTextDidEndEditingEventArgs.cs | Manual binding for Movement via "NSTextMovement" key. |
| src/AppKit/NSTextAlternativesSelectedAlternativeStringEventArgs.cs | Manual binding for AlternativeString via "NSAlternativeString" key. |
| src/AppKit/NSOutlineViewItemEventArgs.cs | Manual binding for Item via "NSObject" key. |
| src/AppKit/NSMenuItemIndexEventArgs.cs | Manual binding for MenuItemIndex via "NSMenuItemIndex" key. |
| src/AppKit/NSMenuItemEventArgs.cs | Manual binding for MenuItem via "MenuItem" key. |
| src/AppKit/NSControlTextEditingEventArgs.cs | Manual binding for FieldEditor via "NSFieldEditor" key. |
✅ [PR Build #e3cc5cf] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #e3cc5cf] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #e3cc5cf] Build passed (Build macOS tests) ✅Pipeline on Agent |
🚀 [CI Build #e3cc5cf] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 156 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Implement manual bindings for the following properties, because they use
literal string keys instead of constant strings:
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com