Define a class using an XML file?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonah Olsson

    #1

    Define a class using an XML file?

    Dear Sirs,

    I'm looking for a way to define a class using an XML file. Since I'm
    building a Web Service to be used by several customers I want to be able to
    easily change the class below without having to change the actual code. This
    class is also used in the communication with the customer's SQL server.

    Thanks for any kind of help.

    Regards,
    Jonah Olsson

    Public Class MemberData

    Private _EmailGUID As String
    Private _Email As String
    Private _FirstName As String
    Private _LastName As String
    Private _Title As String
    Private _Company As String
    Private _Address As String
    Private _PostalCode As Integer
    Private _City As String
    Private _Phone As String
    Private _Active As Integer
    Private _RegDate As DateTime
    Private _ChangeDate As DateTime
    Private _SoftBounces As Integer
    Private _HardBounces As Integer
    Private _GroupIDs As String

    Public Sub New()
    MyBase.New()

    _EmailGUID = ""
    _Email = ""
    _FirstName = ""
    _LastName = ""
    _Title = ""
    _Company = ""
    _Address = ""
    _PostalCode = 0
    _City = ""
    _Phone = ""
    _Active = 0
    _RegDate = Nothing
    _ChangeDate = Nothing
    _GroupIDs = ""

    End Sub

    Public Property EmailGUID() As String
    Get
    Return _EmailGUID
    End Get
    Set(ByVal Value As String)
    If ((Value Is Nothing) OrElse (Value.Length = 0)) Then
    Throw New Exception("The email address identifier cannot be
    empty")
    End If
    _EmailGUID = Value
    End Set
    End Property

    Public Property Email() As String
    Get
    Return _Email
    End Get
    Set(ByVal Value As String)
    If ((Value Is Nothing) OrElse (Value.Length = 0)) Then
    Throw New Exception("The email address cannot be empty")
    End If
    _Email = Value
    End Set
    End Property

    [...]

    End Class



Working...