public static void Initialize() { if (AppKitLibrary != IntPtr.Zero) { return; } AppKitLibrary = NS.LoadLibrary("/System/Library/Frameworks/AppKit.framework/AppKit"); FoundationLibrary = NS.LoadLibrary("/System/Library/Frameworks/Foundation.framework/Foundation"); CoreTextLibrary = NS.LoadLibrary(CoreTextPath); }
public static IntPtr GetStringConstant(IntPtr handle, string symbol) { var indirect = NS.GetSymbol(handle, symbol); if (indirect == IntPtr.Zero) { return(IntPtr.Zero); } var actual = Marshal.ReadIntPtr(indirect); if (actual == IntPtr.Zero) { return(IntPtr.Zero); } return(actual); }