From 6ef756a063f682bc8cebc323d4e2ffc53241c265 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Thu, 23 Feb 2017 17:22:25 -0900 Subject: [PATCH] Revert API breaking changes for non-XAMCORE_4_0 (#1747) * Move NSTouch ctor to code-behind and obsolete * Remove XAMCORE_4_0 check for NSTouch DisableDefaultCtor * Add NSTouch.cs to frameworks.sources * Skip NSSpellCheckerCanidates in typo test --- src/AppKit/NSTouch.cs | 12 ++++++++++++ src/appkit.cs | 4 ++++ src/frameworks.sources | 1 + tests/introspection/Mac/MacApiTypoTest.cs | 8 ++++++++ 4 files changed, 25 insertions(+) create mode 100644 src/AppKit/NSTouch.cs diff --git a/src/AppKit/NSTouch.cs b/src/AppKit/NSTouch.cs new file mode 100644 index 0000000000..55c5e1818d --- /dev/null +++ b/src/AppKit/NSTouch.cs @@ -0,0 +1,12 @@ +using System; + +namespace XamCore.AppKit { + public partial class NSTouch { +#if !XAMCORE_4_0 + [Obsolete ("This type is not meant to be user-created")] + public NSTouch () + { + } +#endif + } +} diff --git a/src/appkit.cs b/src/appkit.cs index 25e22b9ef0..0431838ab1 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -13678,7 +13678,11 @@ namespace XamCore.AppKit { bool IsAutomaticTextCompletionEnabled { get; } [Mac (10,12,1)] +#if XAMCORE_4_0 [Async (ResultTypeName="NSSpellCheckerCandidates")] +#else + [Async (ResultTypeName="NSSpellCheckerCanidates")] +#endif [Export ("requestCandidatesForSelectedRange:inString:types:options:inSpellDocumentWithTag:completionHandler:")] nint RequestCandidates (NSRange selectedRange, string stringToCheck, ulong checkingTypes, [NullAllowed] NSDictionary options, nint tag, [NullAllowed] Action completionHandler); diff --git a/src/frameworks.sources b/src/frameworks.sources index c883489ba3..2a0f4d137d 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -136,6 +136,7 @@ APPKIT_SOURCES = \ AppKit/NSTextField.cs \ AppKit/NSTextStorage.cs \ AppKit/NSToolbarItem.cs \ + AppKit/NSTouch.cs \ AppKit/NSTreeController.cs \ AppKit/NSView.cs \ AppKit/NSWindow.cs \ diff --git a/tests/introspection/Mac/MacApiTypoTest.cs b/tests/introspection/Mac/MacApiTypoTest.cs index e83059302e..40535c4a0e 100644 --- a/tests/introspection/Mac/MacApiTypoTest.cs +++ b/tests/introspection/Mac/MacApiTypoTest.cs @@ -36,5 +36,13 @@ namespace Introspection return String.Empty; return txt.Substring ((int)typoRange.Location, (int)typoRange.Length); } + + public override bool Skip (Type baseType, string typo) + { + if (baseType == typeof (NSSpellCheckerCanidates)) + return true; + + return base.Skip (baseType, typo); + } } }