From 02818182f1d26b3c671af59290e9c9b7a9cc0d66 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 22 Sep 2016 19:11:50 +0200 Subject: [PATCH] [Foundation] Add a few missing NSAttributedString methods to watchOS. Fixes #44455. (#880) https://bugzilla.xamarin.com/show_bug.cgi?id=44455 --- src/Foundation/NSAttributedString.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Foundation/NSAttributedString.cs b/src/Foundation/NSAttributedString.cs index 3cc33a7076..2877d2664a 100644 --- a/src/Foundation/NSAttributedString.cs +++ b/src/Foundation/NSAttributedString.cs @@ -25,9 +25,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // - -#if !WATCH // This file needs some work before it can get included in WatchOS - using System; using XamCore.CoreText; using XamCore.ObjCRuntime; @@ -98,7 +95,9 @@ namespace XamCore.Foundation { NSLigatureType ligature, float kerning, NSUnderlineStyle underlineStyle, +#if !WATCH NSShadow shadow, +#endif float strokeWidth, NSUnderlineStyle strikethroughStyle) { @@ -127,9 +126,11 @@ namespace XamCore.Foundation { if (underlineStyle != NSUnderlineStyle.None){ attr.UnderlineStyle = underlineStyle; } +#if !WATCH if (shadow != null){ attr.Shadow = shadow; } +#endif if (strokeWidth != 0){ attr.StrokeWidth = strokeWidth; } @@ -149,10 +150,16 @@ namespace XamCore.Foundation { NSLigatureType ligatures = NSLigatureType.Default, float kerning = 0, NSUnderlineStyle underlineStyle = NSUnderlineStyle.None, +#if !WATCH NSShadow shadow = null, +#endif float strokeWidth = 0, NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None) - : this (str, ToDictionary (font, foregroundColor, backgroundColor, strokeColor, paragraphStyle, ligatures, kerning, underlineStyle, shadow, strokeWidth, strikethroughStyle)) + : this (str, ToDictionary (font, foregroundColor, backgroundColor, strokeColor, paragraphStyle, ligatures, kerning, underlineStyle, +#if !WATCH + shadow, +#endif + strokeWidth, strikethroughStyle)) { } @@ -170,5 +177,3 @@ namespace XamCore.Foundation { #endif } } - -#endif // !WATCH