Пример #1
0
        // Token: 0x06000BF5 RID: 3061 RVA: 0x00042B70 File Offset: 0x00040D70
        public virtual object pmethod_2149(Class_285 arg_0, Type arg_1, object obje_0, Class_418 arg_2)
        {
            DataTable dataTable = obje_0 as DataTable;

            if (dataTable == null)
            {
                dataTable = ((arg_1 == typeof(DataTable)) ? new DataTable() : ((DataTable)Activator.CreateInstance(arg_1)));
            }
            if (arg_0.prop_9 == Class_508.PropertyName)
            {
                dataTable.TableName = (string)arg_0.prop_10;
                Class_302.tmethod_2152(arg_0);
            }
            if (arg_0.prop_9 != Class_508.StartArray)
            {
                throw Class_417.xmethod_3101(arg_0, "Unexpected JSON token when reading DataTable. Expected StartArray, got {0}.".FormatWith(CultureInfo.InvariantCulture, arg_0.prop_9));
            }
            Class_302.tmethod_2152(arg_0);
            while (arg_0.prop_9 != Class_508.EndArray)
            {
                Class_302.smethod_2150(arg_0, dataTable);
                Class_302.tmethod_2152(arg_0);
            }
            return(dataTable);
        }
Пример #2
0
        // Token: 0x06000BF7 RID: 3063 RVA: 0x00042DC4 File Offset: 0x00040FC4
        private static Type xmethod_2151(Class_285 arg_0)
        {
            Class_508 class_ = arg_0.prop_9;

            switch (class_)
            {
            case Class_508.StartArray:
            {
                Class_302.tmethod_2152(arg_0);
                if (arg_0.prop_9 == Class_508.StartObject)
                {
                    return(typeof(DataTable));
                }
                Type type = Class_302.xmethod_2151(arg_0);
                return(type.MakeArrayType());
            }

            case Class_508.Integer:
            case Class_508.Float:
            case Class_508.String:
            case Class_508.Boolean:
            case Class_508.Date:
            case Class_508.Bytes:
                return(arg_0.prop_11);

            case Class_508.Null:
            case Class_508.Undefined:
                return(typeof(string));
            }
            throw Class_417.xmethod_3101(arg_0, "Unexpected JSON token when reading DataTable: {0}".FormatWith(CultureInfo.InvariantCulture, class_));
        }
Пример #3
0
        // Token: 0x06000BF6 RID: 3062 RVA: 0x00042C28 File Offset: 0x00040E28
        private static void smethod_2150(Class_285 arg_0, DataTable arg_1)
        {
            DataRow dataRow = arg_1.NewRow();

            Class_302.tmethod_2152(arg_0);
            while (arg_0.prop_9 == Class_508.PropertyName)
            {
                string text = (string)arg_0.prop_10;
                Class_302.tmethod_2152(arg_0);
                DataColumn dataColumn = arg_1.Columns[text];
                if (dataColumn == null)
                {
                    Type dataType = Class_302.xmethod_2151(arg_0);
                    dataColumn = new DataColumn(text, dataType);
                    arg_1.Columns.Add(dataColumn);
                }
                if (dataColumn.DataType == typeof(DataTable))
                {
                    if (arg_0.prop_9 == Class_508.StartArray)
                    {
                        Class_302.tmethod_2152(arg_0);
                    }
                    DataTable dataTable = new DataTable();
                    while (arg_0.prop_9 != Class_508.EndArray)
                    {
                        Class_302.smethod_2150(arg_0, dataTable);
                        Class_302.tmethod_2152(arg_0);
                    }
                    dataRow[text] = dataTable;
                }
                else if (dataColumn.DataType.IsArray && dataColumn.DataType != typeof(byte[]))
                {
                    if (arg_0.prop_9 == Class_508.StartArray)
                    {
                        Class_302.tmethod_2152(arg_0);
                    }
                    List <object> list = new List <object>();
                    while (arg_0.prop_9 != Class_508.EndArray)
                    {
                        list.Add(arg_0.prop_10);
                        Class_302.tmethod_2152(arg_0);
                    }
                    Array array = Array.CreateInstance(dataColumn.DataType.GetElementType(), list.Count);
                    Array.Copy(list.ToArray(), array, list.Count);
                    dataRow[text] = array;
                }
                else
                {
                    dataRow[text] = (arg_0.prop_10 ?? DBNull.Value);
                }
                Class_302.tmethod_2152(arg_0);
            }
            dataRow.EndEdit();
            arg_1.Rows.Add(dataRow);
        }
Пример #4
0
        // Token: 0x06000BEF RID: 3055 RVA: 0x000428A4 File Offset: 0x00040AA4
        public virtual void cmethod_2144(Class_296 arg_0, object obje_0, Class_418 arg_1)
        {
            DataSet   dataSet = (DataSet)obje_0;
            Class_441 class_  = arg_1.prop_14 as Class_441;
            Class_302 class_2 = new Class_302();

            arg_0.kmethod_2007();
            foreach (object obj in dataSet.Tables)
            {
                DataTable dataTable = (DataTable)obj;
                arg_0.gmethod_2013((class_ != null) ? class_.smethod_3590(dataTable.TableName) : dataTable.TableName);
                class_2.tmethod_2132(arg_0, dataTable, arg_1);
            }
            arg_0.lmethod_2008();
        }
Пример #5
0
        // Token: 0x06000BF0 RID: 3056 RVA: 0x00042958 File Offset: 0x00040B58
        public virtual object vmethod_2145(Class_285 arg_0, Type arg_1, object obje_0, Class_418 arg_2)
        {
            DataSet   dataSet = (arg_1 == typeof(DataSet)) ? new DataSet() : ((DataSet)Activator.CreateInstance(arg_1));
            Class_302 class_  = new Class_302();

            this.kmethod_2147(arg_0);
            while (arg_0.prop_9 == Class_508.PropertyName)
            {
                DataTable dataTable = dataSet.Tables[(string)arg_0.prop_10];
                bool      flag      = dataTable != null;
                dataTable = (DataTable)class_.gmethod_2133(arg_0, typeof(DataTable), dataTable, arg_2);
                if (!flag)
                {
                    dataSet.Tables.Add(dataTable);
                }
                this.kmethod_2147(arg_0);
            }
            return(dataSet);
        }