[Foundation] Move NSAttributedStringDocumentAttributes.ViewSize to shared code.
This property has also been added on macOS (where it didn't exist before), since both documentation and headers reveal it's available there.
This commit is contained in:
Родитель
40c3b428ec
Коммит
82126c0ed2
|
@ -41,23 +41,6 @@ namespace Foundation {
|
|||
|
||||
public partial class NSAttributedStringDocumentAttributes : DictionaryContainer {
|
||||
#if !MONOMAC && !COREBUILD
|
||||
public CGSize? ViewSize {
|
||||
get {
|
||||
NSObject value;
|
||||
Dictionary.TryGetValue (NSAttributedStringDocumentAttributeKey.NSViewSizeDocumentAttribute, out value);
|
||||
var size = value as NSValue;
|
||||
if (size != null)
|
||||
return size.CGSizeValue;
|
||||
return null;
|
||||
}
|
||||
set {
|
||||
if (value is null)
|
||||
RemoveValue (NSAttributedStringDocumentAttributeKey.NSViewSizeDocumentAttribute);
|
||||
else
|
||||
Dictionary [NSAttributedStringDocumentAttributeKey.NSViewSizeDocumentAttribute] = NSValue.FromCGSize (value.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public float? ViewZoom {
|
||||
get {
|
||||
return GetFloatValue (NSAttributedStringDocumentAttributeKey.NSViewZoomDocumentAttribute);
|
||||
|
|
|
@ -157,6 +157,15 @@ namespace Foundation {
|
|||
}
|
||||
#endif // !__MACOS__
|
||||
|
||||
public CGSize? ViewSize {
|
||||
get {
|
||||
return GetCGSizeValue (NSAttributedStringDocumentAttributeKey.NSViewSizeDocumentAttribute);
|
||||
}
|
||||
set {
|
||||
SetCGSizeValue (NSAttributedStringDocumentAttributeKey.NSViewSizeDocumentAttribute, value);
|
||||
}
|
||||
}
|
||||
|
||||
#if !TVOS && !WATCH
|
||||
// documentation is unclear if an NSString or an NSUrl should be used...
|
||||
// but providing an `NSString` throws a `NSInvalidArgumentException Reason: (null) is not a file URL`
|
||||
|
|
Загрузка…
Ссылка в новой задаче