public static Dictionary <string, string> ToDictionary(cef_string_map *map) { if (map == null) { return(null); } var result = new Dictionary <string, string>(); var count = libcef.string_map_size(map); if (count == 0) { return(result); } cef_string_t n_value = new cef_string_t(); for (var i = 0; i < count; i++) { libcef.string_map_key(map, i, &n_value); // FIXME: do not ignore return value of libcef.string_map_key var key = cef_string_t.ToString(&n_value); libcef.string_map_value(map, i, &n_value); // FIXME: do not ignore return value of libcef.string_map_value var value = cef_string_t.ToString(&n_value); result.Add(key, value); } libcef.string_clear(&n_value); return(result); }
private void Dispose(bool disposing) { if (this.handle != null) { NativeMethods.cef_string_map_free(this.handle); this.handle = null; } }
public static void get_switches(cef_command_line_t *self, cef_string_map *switches) { get_switches_delegate d; var p = self->_get_switches; if (p == _p10) { d = _d10; } else { d = (get_switches_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_switches_delegate)); if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; } } d(self, switches); }
public static void get_element_attributes(cef_domnode_t *self, cef_string_map *attrMap) { get_element_attributes_delegate d; var p = self->_get_element_attributes; if (p == _p19) { d = _d19; } else { d = (get_element_attributes_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_element_attributes_delegate)); if (_p19 == IntPtr.Zero) { _d19 = d; _p19 = p; } } d(self, attrMap); }
public static extern int string_map_size(cef_string_map *map);
/// <summary> /// Returns a map of all element attributes. /// </summary> public void GetElementAttributes(cef_string_map *attrMap) { throw new NotImplementedException(); // TODO: CefDomNode.GetElementAttributes }
public CefStringMap() { this.handle = NativeMethods.cef_string_map_alloc(); }
public static extern void string_map_free(cef_string_map *map);
public static extern int string_map_append(cef_string_map *map, cef_string_t *key, cef_string_t *value);
public static int string_map_value(cef_string_map *map, int index, cef_string_t *value) { return(string_map_value_core(map, checked ((UIntPtr)index), value)); }
private static extern int string_map_value_core(cef_string_map *map, UIntPtr index, cef_string_t *value);
public static int string_map_key(cef_string_map *map, int index, cef_string_t *key) { return(string_map_key_core(map, checked ((UIntPtr)index), key)); }
private static extern int string_map_key_core(cef_string_map *map, UIntPtr index, cef_string_t *key);
public static int string_map_size(cef_string_map *map) { return(checked ((int)string_map_size_core(map))); }
private static extern UIntPtr string_map_size_core(cef_string_map *map);
public static extern int string_map_key(cef_string_map *map, int index, cef_string_t *key);
public static extern int string_map_value(cef_string_map *map, int index, cef_string_t *value);
public static extern void string_map_clear(cef_string_map *map);
public static extern int cef_string_map_append(cef_string_map *map, /* const */ cef_string_t *key, /* const */ cef_string_t *value);
/// <summary> /// Returns the map of switch names and values. If a switch has no value an /// empty string is returned. /// </summary> public void GetSwitches(cef_string_map *switches) { throw new NotImplementedException(); // TODO: CefCommandLine.GetSwitches }