internal static CfxPostDataElement Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxPostDataElement)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxPostDataElement(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
/// <summary> /// Create a new CfxPostDataElement object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public static CfxPostDataElement Create() { return(CfxPostDataElement.Wrap(CfxApi.PostDataElement.cfx_post_data_element_create())); }
/// <summary> /// Add the specified post data element. Returns true (1) if the add succeeds. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public bool AddElement(CfxPostDataElement element) { return(0 != CfxApi.cfx_post_data_add_element(NativePtr, CfxPostDataElement.Unwrap(element))); }
/// <summary> /// Remove the specified post data element. Returns true (1) if the removal /// succeeds. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>. /// </remarks> public bool RemoveElement(CfxPostDataElement element) { return(0 != CfxApi.cfx_post_data_remove_element(NativePtr, CfxPostDataElement.Unwrap(element))); }