internal static CfxFileDialogCallback Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxFileDialogCallback)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxFileDialogCallback(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
internal static CfxFileDialogCallback Wrap(IntPtr nativePtr) { if(nativePtr == IntPtr.Zero) return null; lock(weakCache) { var wrapper = (CfxFileDialogCallback)weakCache.Get(nativePtr); if(wrapper == null) { wrapper = new CfxFileDialogCallback(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return wrapper; } }