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); }
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); }
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); }
public bool TryPop(out CGPDFObject value) { IntPtr ip; if (CGPDFScannerPopObject(Handle, out ip)) { value = new CGPDFObject(ip); return(true); } else { value = null; return(false); } }
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)); }