Created
March 31, 2017 16:19
-
-
Save chamons/0c3eca631f9cae8ec215240219177e41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class NSOpenPanelPatch | |
{ | |
static readonly IntPtr selIsAccessoryViewDisclosedHandle = Selector.GetHandle ("isAccessoryViewDisclosed"); | |
static readonly IntPtr selSetAccessoryViewDisclosed_Handle = Selector.GetHandle ("setAccessoryViewDisclosed:"); | |
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] | |
public extern static bool bool_objc_msgSend (IntPtr receiver, IntPtr selector); | |
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] | |
public extern static void void_objc_msgSend_bool (IntPtr receiver, IntPtr selector, bool arg1); | |
public static bool GetAccessoryViewDisclosed (this NSOpenPanel p) | |
{ | |
global::AppKit.NSApplication.EnsureUIThread (); | |
return bool_objc_msgSend (p.Handle, selIsAccessoryViewDisclosedHandle); | |
} | |
public static void SetAccessoryViewDisclosed (this NSOpenPanel p, bool v) | |
{ | |
void_objc_msgSend_bool (p.Handle, selSetAccessoryViewDisclosed_Handle, v); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment