VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "AddressType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2017 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation  :  by Liquid XML Data Binder 15.0.1.7161
'* Using Schema: D:\Development2017\Liquid\Tools\DataBindingSamples\Samples\SimpleHierarchy\Schema\SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarForename As String 
Private mvarSurname As String 
Private mvarAddresLine1 As String 
Private mvarAddresLine2 As String 
Private mvarIsValidAddresLine3 As Boolean 
Private mvarAddresLine3 As String 
Private mvarIsValidAddresLine4 As Boolean 
Private mvarAddresLine4 As String 
Private mvarAddresLine5 As String 
Private mvarPostCode As String 
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS

' Add Additional Variable Declarations...

' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS

Implements LtXmlComLib15.XmlObjectBase
Implements LtXmlComLib15.XmlGeneratedClass

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Public Property Get ElementName() As String
    ElementName = m_elementName
End Property

' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get Forename As String 
    Forename = mvarForename
End Property

Public Property Let Forename(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 1, value
    mvarForename = value
    
End Property
' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get Surname As String 
    Surname = mvarSurname
End Property

Public Property Let Surname(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 2, value
    mvarSurname = value
    
End Property
' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get AddresLine1 As String 
    AddresLine1 = mvarAddresLine1
End Property

Public Property Let AddresLine1(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 3, value
    mvarAddresLine1 = value
    
End Property
' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get AddresLine2 As String 
    AddresLine2 = mvarAddresLine2
End Property

Public Property Let AddresLine2(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 4, value
    mvarAddresLine2 = value
    
End Property
' Summary:
'       Represents an optional Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is optional, initially it is not valid. 
Public Property Get AddresLine3 As String 
    if mvarIsValidAddresLine3 = false then
        Err.Raise ERR_INVALID_STATE, "AddressType.AddresLine3", "The Property AddresLine3 is not valid. Set AddresLine3Valid = true"
    end if
    AddresLine3 = mvarAddresLine3
End Property

Public Property Let AddresLine3(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 5, value
    mvarIsValidAddresLine3 = true
    mvarAddresLine3 = value
End Property

' Summary:
'       Indicates if AddresLine3 contains a valid value.
' Remarks:
'       true if the value for AddresLine3 is valid, false if not. 
'       If this is set to true then the property is considered valid, and assigned its
'       default value (). 
'       If its set to false then its made invalid, and subsequent calls to get AddresLine3
'       will raise an exception. 
Public Property Get IsValidAddresLine3 As Boolean 
    IsValidAddresLine3 = mvarIsValidAddresLine3
End Property
            
Public Property Let IsValidAddresLine3(ByVal value As Boolean)
    if value <> mvarIsValidAddresLine3 then
        mvarAddresLine3 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
        mvarIsValidAddresLine3 = value
    End if
End Property

' Summary:
'       Represents an optional Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is optional, initially it is not valid. 
Public Property Get AddresLine4 As String 
    if mvarIsValidAddresLine4 = false then
        Err.Raise ERR_INVALID_STATE, "AddressType.AddresLine4", "The Property AddresLine4 is not valid. Set AddresLine4Valid = true"
    end if
    AddresLine4 = mvarAddresLine4
End Property

Public Property Let AddresLine4(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 6, value
    mvarIsValidAddresLine4 = true
    mvarAddresLine4 = value
End Property

' Summary:
'       Indicates if AddresLine4 contains a valid value.
' Remarks:
'       true if the value for AddresLine4 is valid, false if not. 
'       If this is set to true then the property is considered valid, and assigned its
'       default value (). 
'       If its set to false then its made invalid, and subsequent calls to get AddresLine4
'       will raise an exception. 
Public Property Get IsValidAddresLine4 As Boolean 
    IsValidAddresLine4 = mvarIsValidAddresLine4
End Property
            
Public Property Let IsValidAddresLine4(ByVal value As Boolean)
    if value <> mvarIsValidAddresLine4 then
        mvarAddresLine4 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
        mvarIsValidAddresLine4 = value
    End if
End Property

' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get AddresLine5 As String 
    AddresLine5 = mvarAddresLine5
End Property

Public Property Let AddresLine5(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 7, value
    mvarAddresLine5 = value
    
End Property
' Summary:
'       Represents a mandatory Element in the XML document
'       
' Remarks:
'        
'       This property is represented as an Element in the XML. 
'       It is mandatory and therefore must be populated within the XML. 
'       It is defaulted to . 
Public Property Get PostCode As String 
    PostCode = mvarPostCode
End Property

Public Property Let PostCode(ByVal value As String)
    ' Apply whitespace rules appropriately
    value = LtXmlComLib15.WhitespaceUtils.PreserveWhitespace(value)
    g_ClsDataAddressType.CheckElementRestriction 8, value
    mvarPostCode = value
    
End Property
    

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib15.XmlFormatting = LtXmlComLib15.XmlFormatting_Indented, Optional encoding As LtXmlComLib15.XmlEncoding = LtXmlComLib15.XmlEncoding_UTF8, Optional EOL As LtXmlComLib15.EOLType = LtXmlComLib15.EOLType.EOLType_CRLF, Optional context As LtXmlComLib15.XmlSerializationContext = Nothing)
    RegisterProduct
    LtXmlComLib15.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib15.XmlFormatting = LtXmlComLib15.XmlFormatting_Indented, Optional EOL As LtXmlComLib15.EOLType = LtXmlComLib15.EOLType.EOLType_LF, Optional context As LtXmlComLib15.XmlSerializationContext = Nothing) As String
    RegisterProduct
    ToXml = LtXmlComLib15.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib15.XmlFormatting = LtXmlComLib15.XmlFormatting_Indented, Optional encoding As LtXmlComLib15.XmlEncoding = LtXmlComLib15.XmlEncoding_UTF8, Optional EOL As LtXmlComLib15.EOLType = LtXmlComLib15.EOLType.EOLType_LF, Optional context As LtXmlComLib15.XmlSerializationContext = Nothing) As Variant
    RegisterProduct
    ToXmlStream = LtXmlComLib15.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib15.XmlSerializationContext = Nothing)
    RegisterProduct
    LtXmlComLib15.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib15.XmlSerializationContext = Nothing)
    RegisterProduct
    LtXmlComLib15.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods  ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Summary:
'       Constructor for AddressType
' Remarks:
'       The class is created with all the mandatory fields populated with the
'       default data.  
'       All Collection object are created. 
'           However any 1-n relationships (these are represented as collections) are
'       empty. To comply with the schema these must be populated before the xml
'       obtained from ToXml is valid against the schema D:\Development2017\Liquid\Tools\DataBindingSamples\Samples\SimpleHierarchy\Schema\SimpleHierarchy.xsd 
Private Sub Class_Initialize()
    m_elementName = "AddressType"
    XmlGeneratedClass_Init
End Sub



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
    m_ElementName = vNewValue
End Sub

Private Property Get XmlObjectBase_ElementName() As String
    XmlObjectBase_ElementName = m_ElementName
End Property

Private Property Get XmlObjectBase_TargetNamespace() As String
    XmlObjectBase_TargetNamespace = ""
End Property

Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
    XmlObjectBase_IsSuitableSubstitution = false
    if InterfaceName = "AddressType" _
        then XmlObjectBase_IsSuitableSubstitution = true
End Function

Private Property Get XmlObjectBase_Namespace() As String
    XmlObjectBase_Namespace = ""
End Property

Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib15.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
    Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib15.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib15.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
    XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib15.XmlTextWriter, ByVal context As LtXmlComLib15.XmlSerializationContext)
    XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

' Summary:
'       Initializes the class
' Remarks:
'       The Creates all the mandatory fields (populated with the default data) 
'       All Collection object are created.
'       However any 1-n relationships (these are represented as collections) are
'       empty. To comply with the schema these must be populated before the xml
'       obtained from ToXml is valid against the schema D:\Development2017\Liquid\Tools\DataBindingSamples\Samples\SimpleHierarchy\Schema\SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
    mvarForename = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarSurname = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarAddresLine1 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarAddresLine2 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarAddresLine3 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarIsValidAddresLine3 = false
    mvarAddresLine4 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarIsValidAddresLine4 = false
    mvarAddresLine5 = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    mvarPostCode = LtXmlComLib15.Conversions.stringFromString("", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve)
    



    ' Force Init ClassInfo
    Dim classInfo As LtXmlComLib15.ClassInfo
    Set classInfo = XmlGeneratedClass_ClassInfo

' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS

' Add Additional Init Settings...

' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS

End Sub 

Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib15.ClassInfo
    If g_ClsDataAddressType Is Nothing Then
        Set g_ClsDataAddressType = New LtXmlComLib15.ClassInfo
        
        g_ClsDataAddressType.GroupType = LtXmlComLib15.XmlGroupType.Sequence
        g_ClsDataAddressType.ElementType = LtXmlComLib15.XmlElementType.Element
        g_ClsDataAddressType.ElementName = "AddressType"
        g_ClsDataAddressType.ElementNamespaceURI = ""
        g_ClsDataAddressType.FromXmlFailIfAttributeUnknown = true
        g_ClsDataAddressType.IsClassDerived = false
        g_ClsDataAddressType.PrimitiveDataType = LtXmlComLib15.XmlDataType.type_none
        g_ClsDataAddressType.PrimitiveFormatOverride = ""
        g_ClsDataAddressType.OutputPrimitiveClassAsTextProperty = False
        Set g_ClsDataAddressType.ClassFactory = General.CF
        
        g_ClsDataAddressType.AddElmSeqPrimMnd "Forename", "", "Forename", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimMnd "Surname", "", "Surname", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine1", "", "AddresLine1", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine2", "", "AddresLine2", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimOpt "AddresLine3", "", "AddresLine3", "IsValidAddresLine3", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimOpt "AddresLine4", "", "AddresLine4", "IsValidAddresLine4", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine5", "", "AddresLine5", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
        g_ClsDataAddressType.AddElmSeqPrimMnd "PostCode", "", "PostCode", XmlDataType.type_string, "", LtXmlComLib15.WhitespaceRule.WhitespaceRule_Preserve, "", "-1", "-1", "", "", "", "", "-1"
    End If
    Set XmlGeneratedClass_ClassInfo = g_ClsDataAddressType
End Property

' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS

' Add Additional Methods/Properties Here...

' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS