/// <summary>
        /// Returns the value at the specified key as type dictionary. The returned
        /// value will reference existing data and modifications to the value will
        /// modify this object.
        /// </summary>
        public CefDictionaryValue GetDictionary(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_dictionary(_self, &n_key);

                return(CefDictionaryValue.FromNative(n_result));
            }
        }
        /// <summary>
        /// Sets the value at the specified key as type dict. 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 SetDictionary(string key, CefDictionaryValue value)
        {
            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_dictionary(_self, &n_key, value.ToNative()) != 0);
            }
        }
Пример #3
0
 /// <summary>
 /// Sets the value at the specified index as type dict. 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 SetDictionary(int index, CefDictionaryValue value)
 {
     return(cef_list_value_t.set_dictionary(_self, index, value.ToNative()) != 0);
 }
Пример #4
0
 /// <summary>
 /// Returns the value at the specified index as type dictionary. The returned
 /// value will reference existing data and modifications to the value will
 /// modify this object.
 /// </summary>
 public CefDictionaryValue GetDictionary(int index)
 {
     return(CefDictionaryValue.FromNativeOrNull(
                cef_list_value_t.get_dictionary(_self, index)
                ));
 }
Пример #5
0
 /// <summary>
 /// Sets the underlying value as type dict. Returns true if the value was set
 /// successfully. This object keeps a reference to |value| and ownership of the
 /// underlying data remains unchanged.
 /// </summary>
 public bool SetDictionary(CefDictionaryValue value)
 {
     return(cef_value_t.set_dictionary(_self, value.ToNative()) != 0);
 }
Пример #6
0
 /// <summary>
 /// Returns the underlying value as type dictionary. The returned reference may
 /// become invalid if the value is owned by another object or if ownership is
 /// transferred to another object in the future. To maintain a reference to
 /// the value after assigning ownership to a dictionary or list pass this
 /// object to the SetValue() method instead of passing the returned reference
 /// to SetDictionary().
 /// </summary>
 public CefDictionaryValue GetDictionary()
 {
     return(CefDictionaryValue.FromNative(
                cef_value_t.get_dictionary(_self)
                ));
 }
 /// <summary>
 /// Returns a writable copy of this object. If |exclude_empty_children| is true
 /// any empty dictionaries or lists will be excluded from the copy.
 /// </summary>
 public CefDictionaryValue Copy(bool excludeEmptyChildren)
 {
     return(CefDictionaryValue.FromNative(
                cef_dictionary_value_t.copy(_self, excludeEmptyChildren ? 1 : 0)
                ));
 }
 /// <summary>
 /// Returns true if this object and |that| object have an equivalent underlying
 /// value but are not necessarily the same object.
 /// </summary>
 public bool IsEqual(CefDictionaryValue that)
 {
     return(cef_dictionary_value_t.is_equal(_self, that.ToNative()) != 0);
 }
 /// <summary>
 /// Returns true if this object and |that| object have the same underlying
 /// data. If true modifications to this object will also affect |that| object
 /// and vice-versa.
 /// </summary>
 public bool IsSame(CefDictionaryValue that)
 {
     return(cef_dictionary_value_t.is_same(_self, that.ToNative()) != 0);
 }
 /// <summary>
 /// Creates a new object that is not owned by any other object.
 /// </summary>
 public static CefDictionaryValue Create()
 {
     return(CefDictionaryValue.FromNative(
                cef_dictionary_value_t.create()
                ));
 }
Пример #11
0
        /// <summary>
        /// Returns all preferences as a dictionary. If |include_defaults| is true then
        /// preferences currently at their default value will be included. The returned
        /// object contains a copy of the underlying preference values and
        /// modifications to the returned object will not modify the underlying
        /// preference values. This method must be called on the browser process UI
        /// thread.
        /// </summary>
        public CefDictionaryValue GetAllPreferences(bool includeDefaults)
        {
            var n_result = cef_request_context_t.get_all_preferences(_self, includeDefaults ? 1 : 0);

            return(CefDictionaryValue.FromNative(n_result));
        }