From 547bb73ab90681492f2de1bdf1f650b4efa9955b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 23 Nov 2022 21:39:27 +0100 Subject: [PATCH] [Foundation] Move NSAttributedStringDocumentAttributes.Timeout to shared code. --- src/Foundation/NSAttributedString.mac.cs | 4 ---- .../NSAttributedStringDocumentAttributes.cs | 17 +++++++++++++++++ src/appkit.cs | 3 --- src/xkit.cs | 3 +++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Foundation/NSAttributedString.mac.cs b/src/Foundation/NSAttributedString.mac.cs index 8e0944df66..1d6945b8a3 100644 --- a/src/Foundation/NSAttributedString.mac.cs +++ b/src/Foundation/NSAttributedString.mac.cs @@ -138,10 +138,6 @@ namespace Foundation } public partial class NSAttributedStringDocumentAttributes : DictionaryContainer { - public float? Timeout { - get { return GetFloatValue (NSStringAttributeKey.NSTimeoutDocumentOption); } - set { SetNumberValue (NSStringAttributeKey.NSTimeoutDocumentOption, (float?)value); } - } } } diff --git a/src/Foundation/NSAttributedStringDocumentAttributes.cs b/src/Foundation/NSAttributedStringDocumentAttributes.cs index 057dd40133..2506a9898f 100644 --- a/src/Foundation/NSAttributedStringDocumentAttributes.cs +++ b/src/Foundation/NSAttributedStringDocumentAttributes.cs @@ -361,6 +361,23 @@ namespace Foundation { } #endif // !__MACOS__ +#if __MACOS__ +#if NET + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] +#endif // NET + public float? Timeout { + get { + return GetFloatValue (NSAttributedStringDocumentReadingOptionKey.NSTimeoutDocumentOption); + } + set { + SetNumberValue (NSAttributedStringDocumentReadingOptionKey.NSTimeoutDocumentOption, value); + } + } +#endif // !__MACOS__ + #endif // !COREBUILD } } diff --git a/src/appkit.cs b/src/appkit.cs index 5c7d39b7f9..f4f449a877 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -15524,9 +15524,6 @@ namespace AppKit { NSString TextEffect { get; } // Internal - [Internal, Field ("NSTimeoutDocumentOption")] - NSString NSTimeoutDocumentOption { get; } - [Internal, Field ("NSFileTypeDocumentOption")] NSString NSFileTypeDocumentOption { get; } diff --git a/src/xkit.cs b/src/xkit.cs index 1db716e792..4d15e75ff4 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -4411,5 +4411,8 @@ namespace UIKit { [Internal, Field ("NSTextSizeMultiplierDocumentOption")] NSString NSTextSizeMultiplierDocumentOption { get; } + [NoiOS, NoTV, NoWatch, NoMacCatalyst] + [Internal, Field ("NSTimeoutDocumentOption")] + NSString NSTimeoutDocumentOption { get; } } }