Liquid XML Data Binder 2021
In This Topic
    Invoice.cls
    In This Topic
    VERSION 1.0 CLASS
    BEGIN
      MultiUse = -1  'True
      Persistable = 0  'NotPersistable
      DataBindingBehavior = 0  'vbNone
      DataSourceBehavior  = 0  'vbNone
      MTSTransactionMode  = 0  'NotAnMTSObject
    END
    Attribute VB_Name = "Invoice"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = True
    Attribute VB_PredeclaredId = False
    Attribute VB_Exposed = True
    Option Explicit
    '**********************************************************************************************
    '* Copyright (c) 2001-2021 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 17.0.1.9233
    '* Using Schema: SimpleHierarchy.xsd
    '**********************************************************************************************
    Private m_ElementName As String
    Private mvarInvoiceNo As Long 
    Private mvarDeliveryAddress As SimpleHiarchyLib.AddressType   
    Private mvarBillingAddress As SimpleHiarchyLib.AddressType   
    Private WithEvents mvarItem As SimpleHiarchyLib.ItemTypeCol 
    Private mvarPayment As SimpleHiarchyLib.Payment   
    ' ##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 LtXmlComLib19.XmlObjectBase
    Implements LtXmlComLib19.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 0. 
    Public Property Get InvoiceNo As Long 
        InvoiceNo = mvarInvoiceNo
    End Property
    
    Public Property Let InvoiceNo(ByVal value As Long)
        mvarInvoiceNo = 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. 
    '       If this property is set, then the object will be COPIED. If the property is set to null an exception is raised. 
    Public Property Get DeliveryAddress As SimpleHiarchyLib.AddressType
            Set DeliveryAddress = mvarDeliveryAddress
    End Property
    Public Property Set DeliveryAddress(Byval value As SimpleHiarchyLib.AddressType)
        LtXmlComLib19.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "DeliveryAddress"
        if not value is nothing then
            CastToXmlObjectBase(value).PrivateSetElementName "DeliveryAddress"
        end if
    '    LtXmlComLib19.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "DeliveryAddress"
        Set mvarDeliveryAddress = 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 null. 
    Public Property Get BillingAddress As SimpleHiarchyLib.AddressType 
        Set BillingAddress = mvarBillingAddress  
    End Property
    Public Property Set BillingAddress(ByVal value As SimpleHiarchyLib.AddressType)
        if value is Nothing then
            Set mvarBillingAddress = Nothing
        else
            CastToXmlObjectBase(value).PrivateSetElementName "BillingAddress"
    '       LtXmlComLib19.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "BillingAddress"
            Set mvarBillingAddress = value
        End If
    End Property
            
    ' Summary:
    '       A collection of Items
    '       
    ' Remarks:
    '        
    '       This property is represented as an Element in the XML. 
    '       This collection may contain 1 to Many objects. 
    Public Property Get Item As SimpleHiarchyLib.ItemTypeCol 
        Set Item = mvarItem
    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. 
    '       If this property is set, then the object will be COPIED. If the property is set to null an exception is raised. 
    Public Property Get Payment As SimpleHiarchyLib.Payment
            Set Payment = mvarPayment
    End Property
    Public Property Set Payment(Byval value As SimpleHiarchyLib.Payment)
        LtXmlComLib19.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "Payment"
        if not value is nothing then
            CastToXmlObjectBase(value).PrivateSetElementName "Payment"
        end if
    '    LtXmlComLib19.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "Payment"
        Set mvarPayment = value
    End Property
            
        
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib19.XmlFormatting = LtXmlComLib19.XmlFormatting_Indented, Optional encoding As LtXmlComLib19.XmlEncoding = LtXmlComLib19.XmlEncoding_UTF8, Optional EOL As LtXmlComLib19.EOLType = LtXmlComLib19.EOLType.EOLType_CRLF, Optional context As LtXmlComLib19.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib19.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
    End Sub
    Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib19.XmlFormatting = LtXmlComLib19.XmlFormatting_Indented, Optional EOL As LtXmlComLib19.EOLType = LtXmlComLib19.EOLType.EOLType_LF, Optional context As LtXmlComLib19.XmlSerializationContext = Nothing) As String
        RegisterProduct
        ToXml = LtXmlComLib19.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
    End Function
    Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib19.XmlFormatting = LtXmlComLib19.XmlFormatting_Indented, Optional encoding As LtXmlComLib19.XmlEncoding = LtXmlComLib19.XmlEncoding_UTF8, Optional EOL As LtXmlComLib19.EOLType = LtXmlComLib19.EOLType.EOLType_LF, Optional context As LtXmlComLib19.XmlSerializationContext = Nothing) As Variant
        RegisterProduct
        ToXmlStream = LtXmlComLib19.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
    End Function
    Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib19.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib19.XmlObjectBaseHelper.FromXml Me, xmlIn, context
    End Sub
    Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib19.XmlSerializationContext = Nothing)
        RegisterProduct
        LtXmlComLib19.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
    End Sub
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    '''''''''''''''''''''''''''''''''''' Private Methods  ''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    ' Summary:
    '       Constructor for Invoice
    ' 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 SimpleHierarchy.xsd 
    Private Sub Class_Initialize()
        m_elementName = "Invoice"
        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 = "Invoice" _
            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 LtXmlComLib19.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 LtXmlComLib19.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib19.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
        XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
    End Sub
    Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib19.XmlTextWriter, ByVal context As LtXmlComLib19.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 SimpleHierarchy.xsd.
    Private Sub XmlGeneratedClass_Init()
        mvarInvoiceNo = LtXmlComLib19.Conversions.ui4FromString("0", LtXmlComLib19.WhitespaceRule.WhitespaceRule_Collapse)
        Set mvarDeliveryAddress = CF.CreateNamedClass(ClsName_AddressType, "DeliveryAddress")
        Set mvarBillingAddress = Nothing
        Set mvarItem = CF.CreateClassCollection(ClsName_ItemTypeCol, "Item", "", 1, -1)
        Set mvarPayment = CF.CreateNamedClass(ClsName_Payment, "Payment")
        
    
    
    
        ' Force Init ClassInfo
        Dim classInfo As LtXmlComLib19.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 LtXmlComLib19.ClassInfo
        If g_ClsDataInvoice Is Nothing Then
            Set g_ClsDataInvoice = New LtXmlComLib19.ClassInfo
            
            g_ClsDataInvoice.GroupType = LtXmlComLib19.XmlGroupType.Sequence
            g_ClsDataInvoice.ElementType = LtXmlComLib19.XmlElementType.Element
            g_ClsDataInvoice.ElementName = "Invoice"
            g_ClsDataInvoice.ElementNamespaceURI = ""
            g_ClsDataInvoice.FromXmlFailIfAttributeUnknown = true
            g_ClsDataInvoice.IsClassDerived = false
            g_ClsDataInvoice.PrimitiveDataType = LtXmlComLib19.XmlDataType.type_none
            g_ClsDataInvoice.PrimitiveFormatOverride = ""
            g_ClsDataInvoice.OutputPrimitiveClassAsTextProperty = False
            Set g_ClsDataInvoice.ClassFactory = General.CF
            
            g_ClsDataInvoice.AddElmSeqPrimMnd "InvoiceNo", "", "InvoiceNo", XmlDataType.type_ui4, "", LtXmlComLib19.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
            g_ClsDataInvoice.AddElmSeqClsMnd "DeliveryAddress", "", "DeliveryAddress", LtXmlComLib19.XmlElementType.Element, true
            g_ClsDataInvoice.AddElmSeqClsOpt "BillingAddress", "", "BillingAddress", LtXmlComLib19.XmlElementType.Element, ClsName_AddressType
            g_ClsDataInvoice.AddElmSeqClsCol "Item", "", "Item", LtXmlComLib19.XmlElementType.Element
            g_ClsDataInvoice.AddElmSeqClsMnd "Payment", "", "Payment", LtXmlComLib19.XmlElementType.Element, true
        End If
        Set XmlGeneratedClass_ClassInfo = g_ClsDataInvoice
    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