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); } }
/// <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())); }
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; } }