diff --git a/src/CoreServices/LaunchServices.cs b/src/CoreServices/LaunchServices.cs index 00a407a42e1d..533e53e6db63 100644 --- a/src/CoreServices/LaunchServices.cs +++ b/src/CoreServices/LaunchServices.cs @@ -95,12 +95,18 @@ public static class LaunchServices #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyDefaultApplicationURLForURL (IntPtr inUrl, LSRoles inRole, /*out*/ IntPtr outError); #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif public static NSUrl? GetDefaultApplicationUrlForUrl (NSUrl url, LSRoles roles = LSRoles.All) { @@ -114,12 +120,18 @@ public static class LaunchServices #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyDefaultApplicationURLForContentType (IntPtr inContentType, LSRoles inRole, /*out*/ IntPtr outError); #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif public static NSUrl? GetDefaultApplicationUrlForContentType (string contentType, LSRoles roles = LSRoles.All) { @@ -131,9 +143,21 @@ public static class LaunchServices ); } +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyApplicationURLsForURL (IntPtr inUrl, LSRoles inRole); +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif public static NSUrl [] GetApplicationUrlsForUrl (NSUrl url, LSRoles roles = LSRoles.All) { if (url is null) @@ -172,12 +196,18 @@ public static bool CanUrlAcceptUrl (NSUrl itemUrl, NSUrl targetUrl, #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyApplicationURLsForBundleIdentifier (IntPtr inBundleIdentifier, /*out*/ IntPtr outError); #if NET [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] #endif public static NSUrl [] GetApplicationUrlsForBundleIdentifier (string bundleIdentifier) { @@ -234,9 +264,21 @@ public static LSResult Register (NSUrl url, bool update) #region Working with Role Handlers +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyAllRoleHandlersForContentType (IntPtr inContentType, LSRoles inRole); +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif public static string?[]? GetAllRoleHandlersForContentType (string contentType, LSRoles roles = LSRoles.All) { if (contentType is null) @@ -247,9 +289,21 @@ public static LSResult Register (NSUrl url, bool update) ); } +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif [DllImport (Constants.CoreServicesLibrary)] static extern IntPtr LSCopyDefaultRoleHandlerForContentType (IntPtr inContentType, LSRoles inRole); +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif public static string GetDefaultRoleHandlerForContentType (string contentType, LSRoles roles = LSRoles.All) { if (contentType is null) @@ -260,10 +314,22 @@ public static string GetDefaultRoleHandlerForContentType (string contentType, LS ); } +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif [DllImport (Constants.CoreServicesLibrary)] static extern LSResult LSSetDefaultRoleHandlerForContentType (IntPtr inContentType, LSRoles inRole, IntPtr inHandlerBundleID); +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif // NOTE: intentionally swapped handlerBundleId and roles parameters for a nicer API public static LSResult SetDefaultRoleHandlerForContentType (string contentType, string handlerBundleId, LSRoles roles = LSRoles.All) @@ -330,9 +396,21 @@ public static string GetDefaultHandlerForUrlScheme (string urlScheme) ); } +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif [DllImport (Constants.CoreServicesLibrary)] static extern LSResult LSSetDefaultHandlerForURLScheme (IntPtr inUrlScheme, IntPtr inHandlerBundleId); +#if NET + [SupportedOSPlatform ("macos")] + [ObsoletedOSPlatform ("macos14.0")] +#else + [Deprecated (PlatformName.MacOSX, 14, 0)] +#endif public static LSResult SetDefaultHandlerForUrlScheme (string urlScheme, string handlerBundleId) { if (urlScheme is null) diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreServices.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreServices.todo deleted file mode 100644 index 6f6314385d71..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreServices.todo +++ /dev/null @@ -1,8 +0,0 @@ -!deprecated-attribute-missing! LSCopyAllRoleHandlersForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyApplicationURLsForBundleIdentifier missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyApplicationURLsForURL missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultApplicationURLForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultApplicationURLForURL missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultRoleHandlerForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSSetDefaultHandlerForURLScheme missing a [Deprecated] attribute -!deprecated-attribute-missing! LSSetDefaultRoleHandlerForContentType missing a [Deprecated] attribute diff --git a/tests/xtro-sharpie/macOS-CoreServices.todo b/tests/xtro-sharpie/macOS-CoreServices.todo deleted file mode 100644 index 6f6314385d71..000000000000 --- a/tests/xtro-sharpie/macOS-CoreServices.todo +++ /dev/null @@ -1,8 +0,0 @@ -!deprecated-attribute-missing! LSCopyAllRoleHandlersForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyApplicationURLsForBundleIdentifier missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyApplicationURLsForURL missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultApplicationURLForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultApplicationURLForURL missing a [Deprecated] attribute -!deprecated-attribute-missing! LSCopyDefaultRoleHandlerForContentType missing a [Deprecated] attribute -!deprecated-attribute-missing! LSSetDefaultHandlerForURLScheme missing a [Deprecated] attribute -!deprecated-attribute-missing! LSSetDefaultRoleHandlerForContentType missing a [Deprecated] attribute