コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: CefStringMap.cs プロジェクト: PlumpMath/cefglue-5
 private void Dispose(bool disposing)
 {
     if (this.handle != null)
     {
         NativeMethods.cef_string_map_free(this.handle);
         this.handle = null;
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public static extern int string_map_size(cef_string_map *map);
コード例 #6
0
 /// <summary>
 /// Returns a map of all element attributes.
 /// </summary>
 public void GetElementAttributes(cef_string_map *attrMap)
 {
     throw new NotImplementedException(); // TODO: CefDomNode.GetElementAttributes
 }
コード例 #7
0
ファイル: CefStringMap.cs プロジェクト: PlumpMath/cefglue-5
 public CefStringMap()
 {
     this.handle = NativeMethods.cef_string_map_alloc();
 }
コード例 #8
0
 public static extern void string_map_free(cef_string_map *map);
コード例 #9
0
 public static extern int string_map_append(cef_string_map *map, cef_string_t *key, cef_string_t *value);
コード例 #10
0
 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));
 }
コード例 #11
0
 private static extern int string_map_value_core(cef_string_map *map, UIntPtr index, cef_string_t *value);
コード例 #12
0
 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));
 }
コード例 #13
0
 private static extern int string_map_key_core(cef_string_map *map, UIntPtr index, cef_string_t *key);
コード例 #14
0
 public static int string_map_size(cef_string_map *map)
 {
     return(checked ((int)string_map_size_core(map)));
 }
コード例 #15
0
 private static extern UIntPtr string_map_size_core(cef_string_map *map);
コード例 #16
0
 public static extern int string_map_key(cef_string_map *map, int index, cef_string_t *key);
コード例 #17
0
 public static extern int string_map_value(cef_string_map *map, int index, cef_string_t *value);
コード例 #18
0
 private void Dispose(bool disposing)
 {
     if (this.handle != null)
     {
         NativeMethods.cef_string_map_free(this.handle);
         this.handle = null;
     }
 }
コード例 #19
0
 public static extern void string_map_clear(cef_string_map *map);
コード例 #20
0
 public CefStringMap()
 {
     this.handle = NativeMethods.cef_string_map_alloc();
 }
コード例 #21
0
 public static extern int cef_string_map_append(cef_string_map *map, /* const */ cef_string_t *key, /* const */ cef_string_t *value);
コード例 #22
0
 /// <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
 }