使类可序列化

时间:2013-02-06 22:51:37

标签: vb.net serialization

我搜索如何使这个类可序列化为服务(SOAP)

<Serializable()> _
    Public Class Items

        Inherits StringEnumBase(Of Items)
        Public Sub New(ByVal StrValue As String)
            MyBase.New(StrValue)
        End Sub

        <Description("item 1")> Public Shared ReadOnly ITEM1 As New Items("ValueOfItem1")
        <Description("item 2")> Public Shared ReadOnly ITEM2 As New Items("ValueOfItem2")
        <Description("item 3")> Public Shared ReadOnly ITEM3 As New Items("ValueOfItem3")

    End Class

1 个答案:

答案 0 :(得分:8)

属性没问题,但它必须有一个公共无参数构造函数。