diff --git a/src/CoreText/CTParagraphStyle.cs b/src/CoreText/CTParagraphStyle.cs index 2f8ced8c49..ef07b02bb7 100644 --- a/src/CoreText/CTParagraphStyle.cs +++ b/src/CoreText/CTParagraphStyle.cs @@ -418,121 +418,99 @@ namespace CoreText { get {return (CTWritingDirection) GetByteValue (CTParagraphStyleSpecifier.BaseWritingDirection);} } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat FirstLineHeadIndent { #else - float + public float FirstLineHeadIndent { #endif - FirstLineHeadIndent { get { return GetFloatValue (CTParagraphStyleSpecifier.FirstLineHeadIndent); } } - unsafe -#if XAMCORE_4_0 - nfloat +#if NET + unsafe nfloat GetFloatValue (CTParagraphStyleSpecifier spec) #else - float + unsafe float GetFloatValue (CTParagraphStyleSpecifier spec) #endif - GetFloatValue (CTParagraphStyleSpecifier spec) { nfloat value; if (!CTParagraphStyleGetValueForSpecifier (Handle, spec, (nuint) sizeof (nfloat), &value)) throw new InvalidOperationException ("Unable to get property value."); - return -#if !XAMCORE_4_0 - (float) +#if NET + return value; +#else + return (float) value; #endif - value; } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat HeadIndent { #else - float + public float HeadIndent { #endif - HeadIndent { get { return GetFloatValue (CTParagraphStyleSpecifier.HeadIndent); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat TailIndent { #else - float + public float TailIndent { #endif - TailIndent { get { return GetFloatValue (CTParagraphStyleSpecifier.TailIndent); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat DefaultTabInterval { #else - float + public float DefaultTabInterval { #endif - DefaultTabInterval { get { return GetFloatValue (CTParagraphStyleSpecifier.DefaultTabInterval); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat LineHeightMultiple { #else - float + public float LineHeightMultiple { #endif - LineHeightMultiple { get { return GetFloatValue (CTParagraphStyleSpecifier.LineHeightMultiple); } } -public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat MaximumLineHeight { #else - float + public float MaximumLineHeight { #endif - MaximumLineHeight { get { return GetFloatValue (CTParagraphStyleSpecifier.MaximumLineHeight); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat MinimumLineHeight { #else - float + public float MinimumLineHeight { #endif - MinimumLineHeight { get { return GetFloatValue (CTParagraphStyleSpecifier.MinimumLineHeight); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat LineSpacing { #else - float + public float LineSpacing { #endif - LineSpacing { get { return GetFloatValue (CTParagraphStyleSpecifier.LineSpacing); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat ParagraphSpacing { #else - float + public float ParagraphSpacing { #endif - ParagraphSpacing { get { return GetFloatValue (CTParagraphStyleSpecifier.ParagraphSpacing); } } - public -#if XAMCORE_4_0 - nfloat +#if NET + public nfloat ParagraphSpacingBefore { #else - float + public float ParagraphSpacingBefore { #endif - ParagraphSpacingBefore { get { return GetFloatValue (CTParagraphStyleSpecifier.ParagraphSpacingBefore); } } #endregion diff --git a/src/CoreText/CTRunDelegate.cs b/src/CoreText/CTRunDelegate.cs index 192f931fd3..1c82ed10fe 100644 --- a/src/CoreText/CTRunDelegate.cs +++ b/src/CoreText/CTRunDelegate.cs @@ -82,7 +82,7 @@ namespace CoreText { { } -#if XAMCORE_4_0 +#if NET public virtual nfloat GetAscent () { return 0; diff --git a/src/CoreText/CTTypesetterOptionKeyCompat.cs b/src/CoreText/CTTypesetterOptionKeyCompat.cs index 37d83366e6..a7b02b5e73 100644 --- a/src/CoreText/CTTypesetterOptionKeyCompat.cs +++ b/src/CoreText/CTTypesetterOptionKeyCompat.cs @@ -7,7 +7,7 @@ // Copyright 2018 Microsoft Corporation. // -#if !XAMCORE_4_0 +#if !NET using System; using ObjCRuntime; using Foundation; @@ -15,11 +15,7 @@ using System.Runtime.Versioning; namespace CoreText { public static partial class CTTypesetterOptionKey { -#if !NET [Deprecated (PlatformName.iOS, 6, 0)] -#else - [UnsupportedOSPlatform ("ios6.0")] -#endif public static readonly NSString DisableBidiProcessing = _DisableBidiProcessing; public static readonly NSString ForceEmbeddingLevel = _ForceEmbeddingLevel; } diff --git a/src/coretext.cs b/src/coretext.cs index ab1d4c9fb6..9b5032ed54 100644 --- a/src/coretext.cs +++ b/src/coretext.cs @@ -79,7 +79,7 @@ namespace CoreText { [Deprecated (PlatformName.iOS, 6, 0)] [Field ("kCTTypesetterOptionDisableBidiProcessing")] -#if !XAMCORE_4_0 +#if !NET [Internal] NSString _DisableBidiProcessing { get; } #else @@ -87,7 +87,7 @@ namespace CoreText { #endif [Field ("kCTTypesetterOptionForcedEmbeddingLevel")] -#if !XAMCORE_4_0 +#if !NET [Internal] NSString _ForceEmbeddingLevel { get; } #else diff --git a/tests/monotouch-test/CoreText/RunTest.cs b/tests/monotouch-test/CoreText/RunTest.cs index 073078a10a..f3ab526cff 100644 --- a/tests/monotouch-test/CoreText/RunTest.cs +++ b/tests/monotouch-test/CoreText/RunTest.cs @@ -5,6 +5,7 @@ using System; using CoreGraphics; using CoreText; using Foundation; +using ObjCRuntime; using NUnit.Framework; using MonoTouchFixtures.CoreGraphics; @@ -25,19 +26,31 @@ namespace MonoTouchFixtures.CoreText { Width = false; } +#if NET + public override nfloat GetAscent () +#else public override float GetAscent () +#endif { Ascent = true; return base.GetAscent (); } +#if NET + public override nfloat GetDescent () +#else public override float GetDescent () +#endif { Descent = true; return base.GetDescent (); } +#if NET + public override nfloat GetWidth () +#else public override float GetWidth () +#endif { Width = true; return base.GetWidth ();