Skip to content

[XKit] Fix creating NSTextLists with custom formats in .NET. Fixes #15766. - #17123

Merged
rolfbjarne merged 3 commits into
dotnet:mainfrom
rolfbjarne:nstestlists-issue-15766
Jan 10, 2023
Merged

[XKit] Fix creating NSTextLists with custom formats in .NET. Fixes #15766.#17123
rolfbjarne merged 3 commits into
dotnet:mainfrom
rolfbjarne:nstestlists-issue-15766

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

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 #15766.

…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.
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Dec 23, 2022
@rolfbjarne rolfbjarne changed the title [XKit] Fix creating NSTextLists with customf formats in .NET. Fixes #15766. [XKit] Fix creating NSTextLists with custom formats in .NET. Fixes #15766. Dec 23, 2022
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 53c8e1ae104098bc15315b91d312fd6ab3c979c4 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

📚 [PR Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent XAMBOT-1164.Monterey'
Hash: 53c8e1ae104098bc15315b91d312fd6ab3c979c4 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [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
Hash: 53c8e1ae104098bc15315b91d312fd6ab3c979c4 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 23 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 53c8e1ae104098bc15315b91d312fd6ab3c979c4 [PR build]

@rolfbjarne
rolfbjarne merged commit 8e98350 into dotnet:main Jan 10, 2023
@rolfbjarne
rolfbjarne deleted the nstestlists-issue-15766 branch January 10, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug If an issue is a bug or a pull request a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] Cannot create custom NSTextList any more in .NET6

4 participants