public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { BaseInfo = new ModuleBaseInfo(); BaseInfo.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.List) { { Settings = new List <SettingItem>(); TList _list33 = iprot.ReadListBegin(); for (int _i34 = 0; _i34 < _list33.Count; ++_i34) { SettingItem _elem35; _elem35 = new SettingItem(); _elem35.Read(iprot); Settings.Add(_elem35); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.List) { { Categories = new List <SettingCategory>(); TList _list36 = iprot.ReadListBegin(); for (int _i37 = 0; _i37 < _list36.Count; ++_i37) { SettingCategory _elem38; _elem38 = new SettingCategory(); _elem38.Read(iprot); Categories.Add(_elem38); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }
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) { BaseInfo = new ModuleBaseInfo(); await BaseInfo.ReadAsync(iprot, cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.List) { { Settings = new List <SettingItem>(); TList _list33 = await iprot.ReadListBeginAsync(cancellationToken); for (int _i34 = 0; _i34 < _list33.Count; ++_i34) { SettingItem _elem35; _elem35 = new SettingItem(); await _elem35.ReadAsync(iprot, cancellationToken); Settings.Add(_elem35); } await iprot.ReadListEndAsync(cancellationToken); } } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.List) { { Categories = new List <SettingCategory>(); TList _list36 = await iprot.ReadListBeginAsync(cancellationToken); for (int _i37 = 0; _i37 < _list36.Count; ++_i37) { SettingCategory _elem38; _elem38 = new SettingCategory(); await _elem38.ReadAsync(iprot, cancellationToken); Categories.Add(_elem38); } 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(); } }