From 82dfd4fb59edfe6babefec02e3bad10888759424 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 21 Aug 2018 00:00:32 +0200 Subject: [PATCH] [AppKit] Xcode 10 beta 6 support. (#4653) --- src/AppKit/Enums.cs | 8 ++++++++ src/appkit.cs | 10 ++++++++++ src/foundation.cs | 7 +++++++ tests/xtro-sharpie/macOS-AppKit.todo | 4 ---- 4 files changed, 25 insertions(+), 4 deletions(-) delete mode 100644 tests/xtro-sharpie/macOS-AppKit.todo diff --git a/src/AppKit/Enums.cs b/src/AppKit/Enums.cs index 92bd8d4a6f..db15b7ed77 100644 --- a/src/AppKit/Enums.cs +++ b/src/AppKit/Enums.cs @@ -2898,4 +2898,12 @@ namespace AppKit { Disabled, Rollover, } + + [Mac (10,14, onlyOn64: true)] + [Native] + public enum NSWorkspaceAuthorizationType : long { + CreateSymbolicLink, + SetAttributes, + ReplaceFile, + } } diff --git a/src/appkit.cs b/src/appkit.cs index 36a0e305cd..55d5c8eb8c 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -21879,8 +21879,18 @@ namespace AppKit { [Field ("NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification")] [Notification] NSString DisplayOptionsDidChangeNotification { get; } + + [Mac (10,14, onlyOn64: true)] + [Export ("requestAuthorizationOfType:completionHandler:")] + void RequestAuthorization (NSWorkspaceAuthorizationType type, Action completionHandler); } + [Mac (10,14, onlyOn64: true)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSWorkspaceAuthorization { + } + [BaseType (typeof (NSObject))] [ThreadSafe] // NSRunningApplication is documented to be thread-safe. partial interface NSRunningApplication { diff --git a/src/foundation.cs b/src/foundation.cs index 07b9557381..33b12bab19 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -13480,6 +13480,13 @@ namespace Foundation [Mac (10, 8), Export ("trashItemAtURL:resultingItemURL:error:")] bool TrashItem (NSUrl url, out NSUrl resultingItemUrl, out NSError error); + +#if MONOMAC + [Mac (10,14, onlyOn64: true)] + [Static] + [Export ("fileManagerWithAuthorization:")] + NSFileManager FromAuthorization (NSWorkspaceAuthorization authorization); +#endif } [NoWatch, NoTV, Mac (10,13), iOS (11,0)] diff --git a/tests/xtro-sharpie/macOS-AppKit.todo b/tests/xtro-sharpie/macOS-AppKit.todo deleted file mode 100644 index b18474f8dc..0000000000 --- a/tests/xtro-sharpie/macOS-AppKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-enum! NSWorkspaceAuthorizationType not bound -!missing-selector! +NSFileManager::fileManagerWithAuthorization: not bound -!missing-selector! NSWorkspace::requestAuthorizationOfType:completionHandler: not bound -!missing-type! NSWorkspaceAuthorization not bound