-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BGen] Simplify BindAs for smart enums. (#22222)
This changes does two things: 1. Adds a GetValue internal helper for non value backend smart enums. 2. Uses the GetValue functions as the builder for the NSArray. The new method (1) is only added to those smart enums that use a none value type backing field that looks like the following: ```csharp internal static ASAuthorizationProviderAuthorizationOperation GetValue (NativeHandle handle) { using var str = Runtime.GetNSObject<NSString> (handle); return GetValue (str); } ``` This is later used to retrieve the enum values from the handle in a BindAs decorated method/property. This is very similar to what we did in #22216 and has the same performance considerations (there is no performance change after C# 11 and later). --------- Co-authored-by: GitHub Actions Autoformatter <[email protected]>
- Loading branch information
1 parent
ed11d0e
commit 82d877a
Showing
6 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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
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
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
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
82d877a
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.
✅ [CI Build #82d877a] Build passed (CodeQL) ✅
Pipeline on Agent
Hash: 82d877aadc1fb0ffd950c1a0f0043efae7cd9851 [CI build]