Ejemplo n.º 1
0
        public static void SetTime <TIndex>(this ICefValue @this, DateTime value, TIndex index = default(TIndex))
        {
            SetTime(_ =>
            {
                var valueType = @this.GetValueType();
                switch (valueType)
                {
                case CefValueType.List:
                    using (var listValue = @this.GetList())
                    {
                        if (typeof(TIndex) == typeof(int))
                        {
                            listValue.SetBinary((int)Convert.ChangeType(index, typeof(int)), _);
                        }
                    }
                    break;

                case CefValueType.Dictionary:
                    using (var dictValue = @this.GetDictionary())
                    {
                        if (typeof(TIndex) == typeof(string))
                        {
                            dictValue.SetBinary((string)Convert.ChangeType(index, typeof(string)), _);
                        }
                    }
                    break;

                default:
                    @this.SetBinary(_);
                    break;
                }
            }, value);
        }
Ejemplo n.º 2
0
 public static void SetTime(this ICefValue @this, DateTime value)
 {
     SetTime(_ => @this.SetBinary(_), value);
 }
Ejemplo n.º 3
0
 public static void SetInt64(this ICefValue @this, long value)
 {
     SetInt64(_ => @this.SetBinary(_), value);
 }