示例#1
0
 internal static CfxPrintJobCallback Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxPrintJobCallback)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxPrintJobCallback(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
示例#2
0
 internal static CfxPrintJobCallback Wrap(IntPtr nativePtr)
 {
     if(nativePtr == IntPtr.Zero) return null;
     lock(weakCache) {
         var wrapper = (CfxPrintJobCallback)weakCache.Get(nativePtr);
         if(wrapper == null) {
             wrapper = new CfxPrintJobCallback(nativePtr);
             weakCache.Add(wrapper);
         } else {
             CfxApi.cfx_release(nativePtr);
         }
         return wrapper;
     }
 }