Ejemplo n.º 1
0
        public JSValue(CefListValue value)
        {
            if (value == null)
            {
                return;
            }

            var result = new List <Object>();

            for (var i = 0; i < value.Count; i++)
            {
                switch (value.GetValueType(i))
                {
                case CefValueType.List:
                    result.Add(new JSValue(value.GetList(i)).Value);
                    break;

                case CefValueType.Binary:
                    result.Add(new JSValue(value.GetBinary(i)).Value);
                    break;

                case CefValueType.String:
                    result.Add(value.GetString(i));
                    break;

                case CefValueType.Double:
                    result.Add(value.GetDouble(i));
                    break;

                case CefValueType.Int:
                    result.Add(value.GetInt(i));
                    break;

                case CefValueType.Bool:
                    result.Add(value.GetBool(i));
                    break;

                case CefValueType.Dictionary:
                    result.Add(new JSValue(value.GetDictionary(i)).Value);
                    break;

                default:
                    result.Add(null);
                    break;
                }
            }

            this.Value = result.ToArray();
        }