コード例 #1
0
        public static NameValueCollection ToNameValueCollection(cef_string_multimap *multimap)
        {
            var result = new NameValueCollection(StringComparer.CurrentCultureIgnoreCase);

            if (multimap == null)
            {
                return(result);
            }

            var size = libcef.string_multimap_size(multimap);

            var n_key   = new cef_string_t();
            var n_value = new cef_string_t();

            for (var i = 0; i < size; i++)
            {
                libcef.string_multimap_key(multimap, i, &n_key);
                libcef.string_multimap_value(multimap, i, &n_value);

                result.Add(cef_string_t.ToString(&n_key), cef_string_t.ToString(&n_value));
            }

            libcef.string_clear(&n_key);
            libcef.string_clear(&n_value);

            return(result);
        }
コード例 #2
0
 private void Dispose(bool disposing)
 {
     if (this.handle != null)
     {
         NativeMethods.cef_string_multimap_free(this.handle);
         this.handle = null;
     }
 }
コード例 #3
0
ファイル: cef_request_t.g.cs プロジェクト: mstroehle/lvcef
        public static void set_header_map(cef_request_t *self, cef_string_multimap *headerMap)
        {
            set_header_map_delegate d;
            var p = self->_set_header_map;

            if (p == _pb)
            {
                d = _db;
            }
            else
            {
                d = (set_header_map_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_header_map_delegate));
                if (_pb == IntPtr.Zero)
                {
                    _db = d; _pb = p;
                }
            }
            d(self, headerMap);
        }
コード例 #4
0
        public static void get_header_map(cef_response_t *self, cef_string_multimap *headerMap)
        {
            get_header_map_delegate d;
            var p = self->_get_header_map;

            if (p == _pe)
            {
                d = _de;
            }
            else
            {
                d = (get_header_map_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_header_map_delegate));
                if (_pe == IntPtr.Zero)
                {
                    _de = d; _pe = p;
                }
            }
            d(self, headerMap);
        }
コード例 #5
0
 public static extern void string_multimap_clear(cef_string_multimap *map);
コード例 #6
0
 public static extern int string_multimap_value(cef_string_multimap *map, int index, cef_string_t *value);
コード例 #7
0
 public static extern int string_multimap_enumerate(cef_string_multimap *map, cef_string_t *key, int value_index, cef_string_t *value);
コード例 #8
0
 public static extern int string_multimap_size(cef_string_multimap *map);
コード例 #9
0
 /// <summary>
 /// Set the header values.
 /// </summary>
 public void SetHeaderMap(cef_string_multimap *headerMap)
 {
     throw new NotImplementedException(); // TODO: CefRequest.SetHeaderMap
 }
 private static extern int string_multimap_enumerate_core(cef_string_multimap *map, cef_string_t *key, UIntPtr value_index, cef_string_t *value);
 public static int string_multimap_find_count(cef_string_multimap *map, cef_string_t *key)
 {
     return(checked ((int)string_multimap_find_count_core(map, key)));
 }
 private static extern UIntPtr string_multimap_find_count_core(cef_string_multimap *map, cef_string_t *key);
 public static int string_multimap_size(cef_string_multimap *map)
 {
     return(checked ((int)string_multimap_size_core(map)));
 }
 private static extern UIntPtr string_multimap_size_core(cef_string_multimap *map);
コード例 #15
0
 /// <summary>
 /// Allocate a new string multimap.
 /// </summary>
 public CefStringMultiMap()
 {
     this.handle = NativeMethods.cef_string_multimap_alloc();
 }
コード例 #16
0
 /// <summary>
 /// Allocate a new string multimap.
 /// </summary>
 public CefStringMultiMap()
 {
     this.handle = NativeMethods.cef_string_multimap_alloc();
 }
コード例 #17
0
        public static void send_http_response(cef_server_t *self, int connection_id, int response_code, cef_string_t *content_type, long content_length, cef_string_multimap *extra_headers)
        {
            send_http_response_delegate d;
            var p = self->_send_http_response;

            if (p == _pc)
            {
                d = _dc;
            }
            else
            {
                d = (send_http_response_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(send_http_response_delegate));
                if (_pc == IntPtr.Zero)
                {
                    _dc = d; _pc = p;
                }
            }
            d(self, connection_id, response_code, content_type, content_length, extra_headers);
        }
 public static int string_multimap_enumerate(cef_string_multimap *map, cef_string_t *key, int value_index, cef_string_t *value)
 {
     return(string_multimap_enumerate_core(map, key, checked ((UIntPtr)value_index), value));
 }
コード例 #19
0
 /// <summary>
 /// Get all response header fields.
 /// </summary>
 public void GetHeaderMap(cef_string_multimap *headerMap)
 {
     throw new NotImplementedException(); // TODO: CefResponse.GetHeaderMap
 }
 private static extern int string_multimap_key_core(cef_string_multimap *map, UIntPtr index, cef_string_t *key);
コード例 #21
0
 /// <summary>
 /// Set all values at one time.
 /// </summary>
 public void Set(cef_string_t *url, cef_string_t *method, cef_post_data_t *postData, cef_string_multimap *headerMap)
 {
     throw new NotImplementedException(); // TODO: CefRequest.Set
 }
 public static int string_multimap_key(cef_string_multimap *map, int index, cef_string_t *key)
 {
     return(string_multimap_key_core(map, checked ((UIntPtr)index), key));
 }
コード例 #23
0
 public static extern int string_multimap_find_count(cef_string_multimap *map, cef_string_t *key);
 private static extern int string_multimap_value_core(cef_string_multimap *map, UIntPtr index, cef_string_t *value);
コード例 #25
0
 public static extern int string_multimap_key(cef_string_multimap *map, int index, cef_string_t *key);
 public static int string_multimap_value(cef_string_multimap *map, int index, cef_string_t *value)
 {
     return(string_multimap_value_core(map, checked ((UIntPtr)index), value));
 }
コード例 #27
0
 public static extern int string_multimap_append(cef_string_multimap *map, cef_string_t *key, cef_string_t *value);
コード例 #28
0
 public static extern int cef_string_multimap_find_count(cef_string_multimap *map, /* const */ cef_string_t *key);
コード例 #29
0
 public static extern void string_multimap_free(cef_string_multimap *map);
コード例 #30
0
 public static extern int cef_string_multimap_append(cef_string_multimap *map, /* const */ cef_string_t *key, /* const */ cef_string_t *value);
コード例 #31
0
ファイル: cef_request_t.g.cs プロジェクト: mstroehle/lvcef
        public static void set(cef_request_t *self, cef_string_t *url, cef_string_t *method, cef_post_data_t *postData, cef_string_multimap *headerMap)
        {
            set_delegate d;
            var          p = self->_set;

            if (p == _pc)
            {
                d = _dc;
            }
            else
            {
                d = (set_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(set_delegate));
                if (_pc == IntPtr.Zero)
                {
                    _dc = d; _pc = p;
                }
            }
            d(self, url, method, postData, headerMap);
        }
コード例 #32
0
 private void Dispose(bool disposing)
 {
     if (this.handle != null)
     {
         NativeMethods.cef_string_multimap_free(this.handle);
         this.handle = null;
     }
 }