Пример #1
0
        public static cef_string_list *From(string[] list)
        {
            var result = libcef.string_list_alloc();

            if (list != null && list.Length > 0)
            {
                for (var i = 0; i < list.Length; i++)
                {
                    var item = list[i];
                    fixed(char *item_str = item)
                    {
                        var n_item = new cef_string_t(item_str, item != null ? item.Length : 0);

                        libcef.string_list_append(result, &n_item);
                    }
                }
            }

            return(result);
        }
Пример #2
0
        public static cef_string_multimap *From(NameValueCollection collection)
        {
            var result = libcef.string_multimap_alloc();

            foreach (string key in collection)
            {
                fixed(char *key_ptr = key)
                {
                    var n_key = new cef_string_t(key_ptr, key.Length);

                    foreach (var value in collection.GetValues(key))
                    {
                        fixed(char *value_ptr = value)
                        {
                            var n_value = new cef_string_t(value_ptr, value.Length);

                            libcef.string_multimap_append(result, &n_key, &n_value);
                        }
                    }
                }
            }

            return(result);
        }