예제 #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);
        }
예제 #2
0
 public static void SetTime(this ICefValue @this, DateTime value)
 {
     SetTime(_ => @this.SetBinary(_), value);
 }
예제 #3
0
 public static void SetInt64(this ICefValue @this, long value)
 {
     SetInt64(_ => @this.SetBinary(_), value);
 }