/// <summary> /// Sets the value at the specified index. Returns true (1) if the value was /// set successfully. If |value| represents simple data then the underlying /// data will be copied and modifications to |value| will not modify this /// object. If |value| represents complex data (binary, dictionary or list) /// then the underlying data will be referenced and modifications to |value| /// will modify this object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public bool SetValue(int index, CfxValue value) { return 0 != CfxApi.cfx_list_value_set_value(NativePtr, index, CfxValue.Unwrap(value)); }
protected override void ExecuteInTargetProcess(RemoteConnection connection) { __retval = RemoteProxy.Wrap(CfxValue.Create()); }
/// <summary> /// Set the |value| associated with preference |name|. Returns true (1) if the /// value is set successfully and false (0) otherwise. If |value| is NULL the /// preference will be restored to its default value. If setting the preference /// fails then |error| will be populated with a detailed description of the /// problem. This function must be called on the browser process UI thread. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>. /// </remarks> public bool SetPreference(string name, CfxValue value, ref string error) { var name_pinned = new PinnedString(name); var error_pinned = new PinnedString(error); IntPtr error_str = error_pinned.Obj.PinnedPtr; int error_length = error_pinned.Length; var __retval = CfxApi.cfx_request_context_set_preference(NativePtr, name_pinned.Obj.PinnedPtr, name_pinned.Length, CfxValue.Unwrap(value), ref error_str, ref error_length); name_pinned.Obj.Free(); if(error_str != error_pinned.Obj.PinnedPtr) { if(error_length > 0) { error = System.Runtime.InteropServices.Marshal.PtrToStringUni(error_str, error_length); // free the native string? } else { error = null; } } error_pinned.Obj.Free(); return 0 != __retval; }
/// <summary> /// Sets the value at the specified key. Returns true (1) if the value was set /// successfully. If |value| represents simple data then the underlying data /// will be copied and modifications to |value| will not modify this object. If /// |value| represents complex data (binary, dictionary or list) then the /// underlying data will be referenced and modifications to |value| will modify /// this object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>. /// </remarks> public bool SetValue(string key, CfxValue value) { var key_pinned = new PinnedString(key); var __retval = CfxApi.cfx_dictionary_value_set_value(NativePtr, key_pinned.Obj.PinnedPtr, key_pinned.Length, CfxValue.Unwrap(value)); key_pinned.Obj.Free(); return 0 != __retval; }