Skip to content

[AppKit] Implement manual bindings for notification event args properties that use literal strings.#25273

Open
rolfbjarne wants to merge 3 commits intomainfrom
dev/rolf/appkit-constant-strings
Open

[AppKit] Implement manual bindings for notification event args properties that use literal strings.#25273
rolfbjarne wants to merge 3 commits intomainfrom
dev/rolf/appkit-constant-strings

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

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

rolfbjarne and others added 3 commits April 28, 2026 10:33
…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>
Copilot AI review requested due to automatic review settings April 28, 2026 11:28
@rolfbjarne rolfbjarne requested a review from dalexsoto as a code owner April 28, 2026 11:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cs event-args properties with manual C# implementations that read Notification.UserInfo using literal string keys.
  • Adds new AppKit partial NSNotificationEventArgs classes implementing the affected properties.
  • Adds a macOS test suite covering both populated and null userInfo cases, 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.

Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
Comment thread tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #e3cc5cf] Build passed (Build packages) ✅

Pipeline on Agent
Hash: e3cc5cf3c122f1ec848919ddaf265bb7d31fbe9b [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #e3cc5cf] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: e3cc5cf3c122f1ec848919ddaf265bb7d31fbe9b [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: e3cc5cf3c122f1ec848919ddaf265bb7d31fbe9b [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #e3cc5cf] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: e3cc5cf3c122f1ec848919ddaf265bb7d31fbe9b [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [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
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: e3cc5cf3c122f1ec848919ddaf265bb7d31fbe9b [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) April 29, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants