Пример #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));
        }