示例#1
0
        static void ApplyBridge(string key, IntPtr pdfObject, IntPtr info)
        {
            var data     = (Tuple <ApplyCallback, object>)GCHandle.FromIntPtr(info).Target;
            var callback = data.Item1;

            callback(key, CGPDFObject.FromHandle(pdfObject), data.Item2);
        }
示例#2
0
        static unsafe bool ApplyBlockHandler(IntPtr block, nint index, IntPtr value, IntPtr info)
        {
            var del = (ApplyCallback)((BlockLiteral *)block)->Target;

            if (del != null)
            {
                return(del(index, CGPDFObject.FromHandle(value), info == IntPtr.Zero ? null : GCHandle.FromIntPtr(info).Target));
            }

            return(false);
        }
示例#3
0
        static bool ApplyBlockHandler(IntPtr block, nint index, IntPtr value, IntPtr info)
        {
            var del = BlockLiteral.GetTarget <ApplyCallback> (block);

            if (del is not null)
            {
                return(del(index, CGPDFObject.FromHandle(value), info == IntPtr.Zero ? null : GCHandle.FromIntPtr(info).Target));
            }

            return(false);
        }
示例#4
0
        public bool TryPop(out CGPDFObject value)
        {
            IntPtr ip;

            if (CGPDFScannerPopObject(Handle, out ip))
            {
                value = new CGPDFObject(ip);
                return(true);
            }
            else
            {
                value = null;
                return(false);
            }
        }
示例#5
0
        static void ApplyBridge(string key, IntPtr pdfObject, IntPtr info)
        {
            Action <string, object> callback = (Action <string, object>)GCHandle.FromIntPtr(info).Target;

            callback(key, CGPDFObject.FromHandle(pdfObject));
        }