[XKit] Fix creating NSTextLists with custom formats in .NET. Fixes #15766. - #17123
Conversation
…otnet#15766. In .NET, we changed the API for creating a NSTextList with a specified NSTextListMarkerFormats, making NSTextListMarkerFormats a strongly typed enum, and not allowing any other value except those in NSTextListMarkerFormats. This was a mistake, because NSTextList can be created with other format values than those available in NSTextListMarkerFormats. So fix this by: * Adding another NSTextListMarkerFormats enum value that specifies that the actual format is a custom one (NSTextListMarkerFormats.CustomString). * Resurface an 'NSTextListMarkerFormats(string)' constructor that can be used to create an NSTextListMarkerFormats with a custom string. * Add a NSTextListMarkerFormats.CustomMarkerFormat property that always retrieves the underlying string value for the format. * Add a NSTextListOptions.None enum value, which means no options (since NSTextListOptions is a set of flags, it should be possible to specify no flags). * Add two convenience constructors that don't take a NSTextListOptions value, defaulting to NSTextListOptions.None. * Add tests! Fixes dotnet#15766.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
📚 [PR Build] Artifacts 📚Artifacts were not provided. Pipeline on Agent XAMBOT-1164.Monterey' |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 223 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
In .NET, we changed the API for creating a NSTextList with a specified
NSTextListMarkerFormats, making NSTextListMarkerFormats a strongly typed enum,
and not allowing any other value except those in NSTextListMarkerFormats.
This was a mistake, because NSTextList can be created with other format values
than those available in NSTextListMarkerFormats.
So fix this by:
actual format is a custom one (NSTextListMarkerFormats.CustomString).
to create an NSTextListMarkerFormats with a custom string.
retrieves the underlying string value for the format.
NSTextListOptions is a set of flags, it should be possible to specify no
flags).
defaulting to NSTextListOptions.None.
Fixes #15766.