vbAccelerator - Contents of code file: Test_Address.cls

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Address"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Implements IXMLPropertyBag

Private Type tAddress
   bIsNew         As Boolean
   bIsDirty       As Boolean
   bIsDeleted     As Boolean
   sAddressLine1  As String
   sAddressLine2  As String
   sCity          As String
   sState         As String
   sZipCode       As String
End Type

Private m_tAddress As tAddress

Private Sub Class_Initialize()
   m_tAddress.bIsNew = True
End Sub

Private Sub IXMLPropertyBag_ReadProperties(ByVal PropertyBag As
 vbalXMLPBag6.XMLPropertyBag)

   With PropertyBag
      m_tAddress.sAddressLine1 = .ReadProperty("AddressLine1")
      m_tAddress.sAddressLine2 = .ReadProperty("AddressLine2")
      m_tAddress.sCity = .ReadProperty("City")
      m_tAddress.sState = .ReadProperty("State")
      m_tAddress.sZipCode = .ReadProperty("ZipCode")

      m_tAddress.bIsDeleted = .ReadProperty("IsDeleted", False)
      m_tAddress.bIsDirty = .ReadProperty("IsDirty", False)
      m_tAddress.bIsNew = .ReadProperty("IsNew", False)

   End With

End Sub

Private Sub IXMLPropertyBag_WriteProperties(ByVal PropertyBag As
 vbalXMLPBag6.XMLPropertyBag)

   With PropertyBag
      .WriteProperty "AddressLine1", m_tAddress.sAddressLine1
      .WriteProperty "AddressLine2", m_tAddress.sAddressLine2
      .WriteProperty "City", m_tAddress.sCity
      .WriteProperty "State", m_tAddress.sState
      .WriteProperty "ZipCode", m_tAddress.sZipCode

      .WriteProperty "IsDeleted", m_tAddress.bIsDeleted, False
      .WriteProperty "IsDirty", m_tAddress.bIsDirty, False
      .WriteProperty "IsNew", m_tAddress.bIsNew, False

   End With

End Sub

Public Property Let AddressLine1(ByVal sValue As String)

   m_tAddress.sAddressLine1 = sValue

End Property

Public Property Get AddressLine1() As String

   AddressLine1 = m_tAddress.sAddressLine1

End Property

Public Property Let AddressLine2(ByVal sValue As String)

   m_tAddress.sAddressLine2 = sValue

End Property

Public Property Get AddressLine2() As String

   AddressLine2 = m_tAddress.sAddressLine2

End Property

Public Property Let City(ByVal sValue As String)

   m_tAddress.sCity = sValue

End Property

Public Property Get City() As String

   City = m_tAddress.sCity

End Property

Public Property Let State(ByVal sValue As String)

   m_tAddress.sState = sValue

End Property

Public Property Get State() As String

   State = m_tAddress.sState

End Property

Public Property Let ZipCode(ByVal sValue As String)

   m_tAddress.sZipCode = sValue

End Property

Public Property Get ZipCode() As String

   ZipCode = m_tAddress.sZipCode

End Property

Public Property Get IsDirty() As Boolean

   IsDirty = m_tAddress.bIsDirty

End Property

Public Property Get IsNew() As Boolean

   IsNew = m_tAddress.bIsNew

End Property