예제 #1
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                await iprot.ReadStructBeginAsync(cancellationToken);

                while (true)
                {
                    field = await iprot.ReadFieldBeginAsync(cancellationToken);

                    if (field.Type == TType.Stop)
                    {
                        break;
                    }

                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.String)
                        {
                            Version = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                SettingItems = new List <Ruyi.SDK.CommonType.SettingItem>();
                                TList _list4 = await iprot.ReadListBeginAsync(cancellationToken);

                                for (int _i5 = 0; _i5 < _list4.Count; ++_i5)
                                {
                                    Ruyi.SDK.CommonType.SettingItem _elem6;
                                    _elem6 = new Ruyi.SDK.CommonType.SettingItem();
                                    await _elem6.ReadAsync(iprot, cancellationToken);

                                    SettingItems.Add(_elem6);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    default:
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                        break;
                    }

                    await iprot.ReadFieldEndAsync(cancellationToken);
                }

                await iprot.ReadStructEndAsync(cancellationToken);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
예제 #2
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                await iprot.ReadStructBeginAsync(cancellationToken);

                while (true)
                {
                    field = await iprot.ReadFieldBeginAsync(cancellationToken);

                    if (field.Type == TType.Stop)
                    {
                        break;
                    }

                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            CateNode = new CategoryNode();
                            await CateNode.ReadAsync(iprot, cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Map)
                        {
                            {
                                SettingCategories = new Dictionary <string, Ruyi.SDK.CommonType.SettingCategory>();
                                TMap _map8 = await iprot.ReadMapBeginAsync(cancellationToken);

                                for (int _i9 = 0; _i9 < _map8.Count; ++_i9)
                                {
                                    string _key10;
                                    Ruyi.SDK.CommonType.SettingCategory _val11;
                                    _key10 = await iprot.ReadStringAsync(cancellationToken);

                                    _val11 = new Ruyi.SDK.CommonType.SettingCategory();
                                    await _val11.ReadAsync(iprot, cancellationToken);

                                    SettingCategories[_key10] = _val11;
                                }
                                await iprot.ReadMapEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Map)
                        {
                            {
                                SettingItems = new Dictionary <string, Ruyi.SDK.CommonType.SettingItem>();
                                TMap _map12 = await iprot.ReadMapBeginAsync(cancellationToken);

                                for (int _i13 = 0; _i13 < _map12.Count; ++_i13)
                                {
                                    string _key14;
                                    Ruyi.SDK.CommonType.SettingItem _val15;
                                    _key14 = await iprot.ReadStringAsync(cancellationToken);

                                    _val15 = new Ruyi.SDK.CommonType.SettingItem();
                                    await _val15.ReadAsync(iprot, cancellationToken);

                                    SettingItems[_key14] = _val15;
                                }
                                await iprot.ReadMapEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    default:
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                        break;
                    }

                    await iprot.ReadFieldEndAsync(cancellationToken);
                }

                await iprot.ReadStructEndAsync(cancellationToken);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
예제 #3
0
파일: NodeList.cs 프로젝트: subor/sdk
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                await iprot.ReadStructBeginAsync(cancellationToken);

                while (true)
                {
                    field = await iprot.ReadFieldBeginAsync(cancellationToken);

                    if (field.Type == TType.Stop)
                    {
                        break;
                    }

                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.List)
                        {
                            {
                                SettingCategories = new List <Ruyi.SDK.CommonType.SettingCategory>();
                                TList _list18 = await iprot.ReadListBeginAsync(cancellationToken);

                                for (int _i19 = 0; _i19 < _list18.Count; ++_i19)
                                {
                                    Ruyi.SDK.CommonType.SettingCategory _elem20;
                                    _elem20 = new Ruyi.SDK.CommonType.SettingCategory();
                                    await _elem20.ReadAsync(iprot, cancellationToken);

                                    SettingCategories.Add(_elem20);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                SettingItems = new List <Ruyi.SDK.CommonType.SettingItem>();
                                TList _list21 = await iprot.ReadListBeginAsync(cancellationToken);

                                for (int _i22 = 0; _i22 < _list21.Count; ++_i22)
                                {
                                    Ruyi.SDK.CommonType.SettingItem _elem23;
                                    _elem23 = new Ruyi.SDK.CommonType.SettingItem();
                                    await _elem23.ReadAsync(iprot, cancellationToken);

                                    SettingItems.Add(_elem23);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    default:
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                        break;
                    }

                    await iprot.ReadFieldEndAsync(cancellationToken);
                }

                await iprot.ReadStructEndAsync(cancellationToken);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }