Ejemplo n.º 1
0
 internal static CfxResourceBundle Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxResourceBundle)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxResourceBundle(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns the global resource bundle instance.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_resource_bundle_capi.h">cef/include/capi/cef_resource_bundle_capi.h</see>.
 /// </remarks>
 public static CfxResourceBundle GetGlobal()
 {
     return(CfxResourceBundle.Wrap(CfxApi.ResourceBundle.cfx_resource_bundle_get_global()));
 }
Ejemplo n.º 3
0
 internal static CfxResourceBundle Wrap(IntPtr nativePtr)
 {
     if(nativePtr == IntPtr.Zero) return null;
     lock(weakCache) {
         var wrapper = (CfxResourceBundle)weakCache.Get(nativePtr);
         if(wrapper == null) {
             wrapper = new CfxResourceBundle(nativePtr);
             weakCache.Add(wrapper);
         } else {
             CfxApi.cfx_release(nativePtr);
         }
         return wrapper;
     }
 }