示例#1
0
        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);
        }
示例#2
0
        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);
        }