List(OF)到ArrayList [英] List(OF) to ArrayList

查看:64
本文介绍了List(OF)到ArrayList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了ArrayLists之外,需要此结构,但不知道如何将所有内容汇总到父类JSON_SendMktBasket中.

Need this structure except with ArrayLists but don't know how to roll up everything into the parent class JSON_SendMktBasket.

我有一个看起来像这样的结构:

I had a structure that looked like this:

      私有类JSON_SendmktBasket
       在购物篮帖子中发送
      公开产品列表(属于产品)
      公开摘要作为列表(摘要)
      公共折扣资产作为字符串
   结束类
   私人班级总结
       '由JSON_SendmktBasket使用
      公开总计As String
      公用小计为字符串
   结束类
   私人类产品
       '由JSON_SendmktBasket使用
      公开索引为String
      公开描述为String
      公用scanCode为字符串
      公开价格为String
      公共数量作为字符串
      作为列表的公共折扣(折扣)
   结束类
   私人舱位折扣
       '按产品类别使用
      公共DiscountId作为String
      公开金额为字符串
      公共折扣设置为字符串
   结束课程我已将所有的List切换为ArrayList,但是如何使用ArrayList添加嵌入式的Class类型.当我使用Jaso.net反序列化功能插入响应时,需要对结构进行良好定义 进入班级. TIA哈里

       Private Class JSON_SendmktBasket
        'Sent in the marketbasket post
        Public products As List(Of Products)
        Public summary As List(Of Summary)
        Public discountAssets As String
    End Class
    Private Class Summary
        'Used by JSON_SendmktBasket
        Public total As String
        Public subTotal As String
    End Class
    Private Class Products
        'Used by JSON_SendmktBasket
        Public index As String
        Public description As String
        Public scanCode As String
        Public price As String
        Public quantity As String
        Public discounts As List(Of Discounts)
    End Class
    Private Class Discounts
        'Used by Products class
        Public discountId As String
        Public amount As String
        Public discountAsset As String
    End Class   I've switched all the List of s to ArrayLists but how can I add the embedded Class types using ArrayLists.   the structure needs to be well defined as I using a Jaso.net deserialize function to insert the response into the class.  TIA Harry

推荐答案

我已将的所有List切换为ArrayList,但是如何使用ArrayList添加嵌入式的Class类型.当我使用Jaso.net反序列化函数将响应插入到类中时,必须对结构进行良好定义. TIA哈里

I've switched all the List of s to ArrayLists but how can I add the embedded Class types using ArrayLists.   the structure needs to be well defined as I using a Jaso.net deserialize function to insert the response into the class.  TIA Harry

一切都已经汇总到JSON_SendmktBasket对象中.该类的产品"和摘要"属性分别是产品"和摘要"对象的集合.就像产品"类的折扣"属性一样, 折扣"对象的集合.还是卷起"是什么意思?

Everything is already rolled up into the JSON_SendmktBasket object. The 'products' and 'summary' properties of that class are collections of 'Products' and 'Summary' objects respectively.  Just like the 'discounts' property of the 'Products' class is a collection of 'Discounts' objects.   Or do you mean something else by 'rolled up'?


这篇关于List(OF)到ArrayList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆