/// <summary> /// Returns the value at the specified key as type binary. /// </summary> public CefBinaryValue GetBinary(string key) { fixed(char *key_str = key) { var n_key = new cef_string_t(key_str, key != null ? key.Length : 0); var n_result = cef_dictionary_value_t.get_binary(_self, &n_key); return(CefBinaryValue.FromNative(n_result)); } }
/// <summary> /// Sets the value at the specified key as type binary. Returns true if the /// value was set successfully. If |value| is currently owned by another object /// then the value will be copied and the |value| reference will not change. /// Otherwise, ownership will be transferred to this object and the |value| /// reference will be invalidated. /// </summary> public bool SetBinary(string key, CefBinaryValue value) { //FIXME: what means reference will be invalidated ? if (value == null) throw new ArgumentNullException("value"); fixed(char *key_str = key) { var n_key = new cef_string_t(key_str, key != null ? key.Length : 0); return(cef_dictionary_value_t.set_binary(_self, &n_key, value.ToNative()) != 0); } }
/// <summary> /// Creates a new object that is not owned by any other object. The specified /// |data| will be copied. /// </summary> public static CefBinaryValue Create(byte[] data) { if (data == null) { throw new ArgumentNullException("data"); fixed(byte *data_ptr = data) { var value = cef_binary_value_t.create(data_ptr, (UIntPtr)data.LongLength); return(CefBinaryValue.FromNative(value)); } }
/// <summary> /// Sets the value at the specified key as type binary. Returns true if the /// value was set successfully. If |value| is currently owned by another object /// then the value will be copied and the |value| reference will not change. /// Otherwise, ownership will be transferred to this object and the |value| /// reference will be invalidated. /// </summary> public bool SetBinary(string key, CefBinaryValue value) { //FIXME: what means reference will be invalidated ? if (value == null) throw new ArgumentNullException("value"); fixed (char* key_str = key) { var n_key = new cef_string_t(key_str, key != null ? key.Length : 0); return cef_dictionary_value_t.set_binary(_self, &n_key, value.ToNative()) != 0; } }
/// <summary> /// Sets the value at the specified index as type binary. Returns true if the /// value was set successfully. After calling this method the |value| object /// will no longer be valid. If |value| is currently owned by another object /// then the value will be copied and the |value| reference will not change. /// Otherwise, ownership will be transferred to this object and the |value| /// reference will be invalidated. /// </summary> public bool SetBinary(int index, CefBinaryValue value) { return cef_list_value_t.set_binary(_self, index, value.ToNative()) != 0; }
/// <summary> /// Returns a copy of this object. The data in this object will also be copied. /// </summary> public CefBinaryValue Copy() { var value = cef_binary_value_t.copy(_self); return(CefBinaryValue.FromNative(value)); }
/// <summary> /// Sets the value at the specified index as type binary. Returns true if the /// value was set successfully. After calling this method the |value| object /// will no longer be valid. If |value| is currently owned by another object /// then the value will be copied and the |value| reference will not change. /// Otherwise, ownership will be transferred to this object and the |value| /// reference will be invalidated. /// </summary> public bool SetBinary(int index, CefBinaryValue value) { return(cef_list_value_t.set_binary(_self, index, value.ToNative()) != 0); }
/// <summary> /// Returns the value at the specified index as type binary. /// </summary> public CefBinaryValue GetBinary(int index) { return(CefBinaryValue.FromNativeOrNull( cef_list_value_t.get_binary(_self, index) )); }