In This Topic
    MyRootObject.vb
    In This Topic
    Option Explicit On
    Option Strict On
    
    Imports System
    Imports System.Xml
    
    '**********************************************************************************************
    '* Copyright (c) 2001-2023 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 19.0.14.11049
    '* Using Schema: Cardinality.xsd
    '**********************************************************************************************
    
    Namespace CardinalityLib
    
        ''' <summary>
        ''' This class represents the Element MyRootObject
        ''' </summary>
        <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _
                                                        LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _
                                                        "MyRootObject", "", true, false, false)> _
        Public Partial Class MyRootObject
            Inherits CardinalityLib.XmlCommonBase
    
            #Region "Constructors"
            ''' <summary>
            '''    Constructor for MyRootObject
            ''' </summary>
            ''' <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 Cardinality.xsd
            ''' </remarks>
            Public Sub New()
                _elementName = "MyRootObject"
                Init()
            End Sub
            
            Public Sub New(ByVal elementName As String)
                _elementName = elementName
                Init()
            End Sub
            #End Region
    
            #Region "Initialization methods for the class"
            ''' <summary>
            '''    Initializes the class
            ''' </summary>
            ''' <remarks>
            '''    This 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 Cardinality.xsd.
            ''' </remarks>
            Protected Overrides Sub Init()
                CardinalityLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place
                _ASimpleStringMandatoryElement = ""
                _ASimpleDateMandatoryElement = New LiquidTechnologies.Runtime.XmlDateTime(LiquidTechnologies.Runtime.XmlDateTime.DateType.date)
                _AComplexMandatoryElement = new CardinalityLib.AComplexMandatoryElement("AComplexMandatoryElement")
                _ASimpleStringOptionalElement = Nothing
                _ASimpleDateOptionalElement = Nothing
                _AComplexOptionalElement = Nothing
                _ASimpleStringCollectionElement = new CardinalityLib.XmlSimpleTypeCollection(Of String)("ASimpleStringCollectionElement", "", LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, 0, -1, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, new LiquidTechnologies.Runtime.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1))
                _ASimpleDateCollectionElement = new CardinalityLib.XmlSimpleTypeCollection(Of LiquidTechnologies.Runtime.XmlDateTime)("ASimpleDateCollectionElement", "", LiquidTechnologies.Runtime.Conversions.ConversionType.type_date, 0, -1, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, new LiquidTechnologies.Runtime.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1))
                _AComplexCollectionElement = new CardinalityLib.XmlObjectCollection(Of CardinalityLib.AComplexCollectionElement)("AComplexCollectionElement", "", 0, -1, false)
    
    ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional initialization code here...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
            End Sub
    
            #End Region
    
            #Region "ICloneable Interface"
            ''' <summary>
            '''    Allows the class to be copied
            ''' </summary>
            ''' <remarks>
            '''    Performs a 'deep copy' of all the data in the class (and its children)
            ''' </remarks>
            Public Overrides Function Clone() As Object
                Dim newObject As New CardinalityLib.MyRootObject(_elementName)
                Dim o As Object
                newObject._ASimpleStringMandatoryElement = _ASimpleStringMandatoryElement
                newObject._ASimpleDateMandatoryElement = CType(_ASimpleDateMandatoryElement.Clone(), LiquidTechnologies.Runtime.XmlDateTime)
                newObject._AComplexMandatoryElement = Nothing
                If Not _AComplexMandatoryElement Is Nothing Then
                    newObject._AComplexMandatoryElement = CType(_AComplexMandatoryElement.Clone(), CardinalityLib.AComplexMandatoryElement)
                End If
                newObject._ASimpleStringOptionalElement = _ASimpleStringOptionalElement
                If _ASimpleDateOptionalElement Is Nothing Then
                    newObject._ASimpleDateOptionalElement = Nothing
                Else
                    newObject._ASimpleDateOptionalElement = CType(_ASimpleDateOptionalElement.Clone(), LiquidTechnologies.Runtime.XmlDateTime)
                End If
                newObject._AComplexOptionalElement = Nothing
                if Not _AComplexOptionalElement Is Nothing Then
                    newObject._AComplexOptionalElement = CType(_AComplexOptionalElement.Clone(), CardinalityLib.AComplexOptionalElement)
                End If
                For Each o in _ASimpleStringCollectionElement
                    newObject._ASimpleStringCollectionElement.Add(CType(o, String))
                Next o
                For Each o in _ASimpleDateCollectionElement
                    newObject._ASimpleDateCollectionElement.Add(CType(CType(o, LiquidTechnologies.Runtime.XmlDateTime).Clone(), LiquidTechnologies.Runtime.XmlDateTime))
                Next o
                For Each o In _AComplexCollectionElement
                    newObject._AComplexCollectionElement.Add(CType(CType(o, CardinalityLib.AComplexCollectionElement).Clone(), CardinalityLib.AComplexCollectionElement))
                Next o
    
                o = Nothing
    
    ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional clone code here...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
                Return newObject
            End Function
            #End Region
    
            #Region "Member variables"
    
            Protected Overrides Readonly Property TargetNamespace() As String
                Get 
                    Return ""
                End Get
            End Property
    
            #Region "Attribute - ASimpleStringMandatoryElement"
            ''' <summary>
            ''' Represents a mandatory Element in the XML document
            ''' </summary>
            ''' <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 "".
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("ASimpleStringMandatoryElement", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _
            Public Property ASimpleStringMandatoryElement() As String
                Get 
                    Return _ASimpleStringMandatoryElement
                End Get
                Set(ByVal value As String)
                    ' Apply whitespace rules appropriately
                    value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) 
                    _ASimpleStringMandatoryElement = value 
                End Set
            End Property
            Protected _ASimpleStringMandatoryElement As String
    
            #End Region
        
            #Region "Attribute - ASimpleDateMandatoryElement"
            ''' <summary>
            ''' Represents a mandatory Element in the XML document
            ''' </summary>
            ''' <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 New LiquidTechnologies.Runtime.XmlDateTime(LiquidTechnologies.Runtime.XmlDateTime.DateType.date).
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("ASimpleDateMandatoryElement", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_date, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _
            Public Property ASimpleDateMandatoryElement() As LiquidTechnologies.Runtime.XmlDateTime
                Get 
                    Return _ASimpleDateMandatoryElement
                End Get
                Set(ByVal value As LiquidTechnologies.Runtime.XmlDateTime)
                    _ASimpleDateMandatoryElement.SetDateTime(value, _ASimpleDateMandatoryElement.Type) 
                End Set
            End Property
            Protected _ASimpleDateMandatoryElement As LiquidTechnologies.Runtime.XmlDateTime
    
            #End Region
        
            #Region "Attribute - AComplexMandatoryElement"
            ''' <summary>
            ''' Represents a mandatory Element in the XML document
            ''' </summary>
            ''' <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 Nothing an exception is raised.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqClsMnd("AComplexMandatoryElement", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, GetType(CardinalityLib.AComplexMandatoryElement), true)> _
            Public Property AComplexMandatoryElement() As CardinalityLib.AComplexMandatoryElement
                Get 
                    Return _AComplexMandatoryElement
                End Get
                Set(ByVal value As CardinalityLib.AComplexMandatoryElement)
                    Throw_IfPropertyIsNull(value, "AComplexMandatoryElement")
                    If Not value Is Nothing Then
                        SetElementName(value, "AComplexMandatoryElement")
                    End If
                    _AComplexMandatoryElement = value 
                End Set
            End Property
            Protected _AComplexMandatoryElement As CardinalityLib.AComplexMandatoryElement
            
            #End Region
        
            #Region "Attribute - ASimpleStringOptionalElement"
            ''' <summary>
            ''' Represents an optional Element in the XML document
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' It is optional, initially it is not valid.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimOpt("ASimpleStringOptionalElement", "", True, Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _
            Public Property ASimpleStringOptionalElement() As String
                Get
                    Return _ASimpleStringOptionalElement
                End Get
                Set(ByVal value As String)
                    If value Is Nothing Then
                        _ASimpleStringOptionalElement = Nothing
                    Else
                        ' Apply whitespace rules appropriately
                        value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) 
                        _ASimpleStringOptionalElement = value
                    End If
                End Set
            End Property
            Protected _ASimpleStringOptionalElement As String
            #End Region
        
            #Region "Attribute - ASimpleDateOptionalElement"
            ''' <summary>
            ''' Represents an optional Element in the XML document
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' It is optional, initially it is not valid.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimOpt("ASimpleDateOptionalElement", "", True, Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_date, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _
            Public Property ASimpleDateOptionalElement() As LiquidTechnologies.Runtime.XmlDateTime
                Get
                    Return _ASimpleDateOptionalElement
                End Get
                Set(ByVal value As LiquidTechnologies.Runtime.XmlDateTime)
                    If value Is Nothing Then
                        _ASimpleDateOptionalElement = Nothing
                    Else
                        If _ASimpleDateOptionalElement Is Nothing Then
                            _ASimpleDateOptionalElement = New LiquidTechnologies.Runtime.XmlDateTime(LiquidTechnologies.Runtime.XmlDateTime.DateType.date)
                        End If
                        _ASimpleDateOptionalElement.SetDateTime(value, _ASimpleDateOptionalElement.Type)
                    End If
                End Set
            End Property
            Protected _ASimpleDateOptionalElement As LiquidTechnologies.Runtime.XmlDateTime
            #End Region
        
            #Region "Attribute - AComplexOptionalElement"
            ''' <summary>
            ''' Represents an optional Element in the XML document
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' It is optional, initially it is Nothing.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqClsOpt("AComplexOptionalElement", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, GetType(CardinalityLib.AComplexOptionalElement))> _
            Public Property AComplexOptionalElement() As CardinalityLib.AComplexOptionalElement
                Get 
                    Return _AComplexOptionalElement
                End Get
                Set(ByVal value As CardinalityLib.AComplexOptionalElement)
                    If value Is Nothing Then
                        _AComplexOptionalElement = Nothing
                    Else
                        SetElementName(value, "AComplexOptionalElement")
                        _AComplexOptionalElement = value 
                    End If
                End Set
            End Property
            Protected _AComplexOptionalElement As CardinalityLib.AComplexOptionalElement
            
            #End Region
        
            #Region "Attribute - ASimpleStringCollectionElement"
            ''' <summary>
            ''' A collection of Strings
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' This collection may contain 0 to Many Strings.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimCol("ASimpleStringCollectionElement", "")> _
            Public Readonly Property ASimpleStringCollectionElement() As CardinalityLib.XmlSimpleTypeCollection(Of String)
                Get 
                    Return _ASimpleStringCollectionElement
                End Get
            End Property
    
            Protected _ASimpleStringCollectionElement As CardinalityLib.XmlSimpleTypeCollection(Of String)
    
            #End Region
        
            #Region "Attribute - ASimpleDateCollectionElement"
            ''' <summary>
            ''' A collection of LiquidTechnologies.Runtime.XmlDateTimes
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' This collection may contain 0 to Many LiquidTechnologies.Runtime.XmlDateTimes.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqPrimCol("ASimpleDateCollectionElement", "")> _
            Public Readonly Property ASimpleDateCollectionElement() As CardinalityLib.XmlSimpleTypeCollection(Of LiquidTechnologies.Runtime.XmlDateTime)
                Get 
                    Return _ASimpleDateCollectionElement
                End Get
            End Property
    
            Protected _ASimpleDateCollectionElement As CardinalityLib.XmlSimpleTypeCollection(Of LiquidTechnologies.Runtime.XmlDateTime)
    
            #End Region
        
            #Region "Attribute - AComplexCollectionElement"
            ''' <summary>
            ''' A collection of AComplexCollectionElements
            ''' </summary>
            ''' <remarks>
            ''' This property is represented as an Element in the XML.
            ''' This collection may contain 0 to Many objects.
            ''' </remarks>
            <LiquidTechnologies.Runtime.ElementInfoSeqClsCol("AComplexCollectionElement", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element)> _
            Public Readonly Property AComplexCollectionElement() As CardinalityLib.XmlObjectCollection(Of CardinalityLib.AComplexCollectionElement)
                Get 
                    Return _AComplexCollectionElement 
                End Get
            End Property
            Protected _AComplexCollectionElement As CardinalityLib.XmlObjectCollection(Of CardinalityLib.AComplexCollectionElement)
            
            #End Region
        
            #Region "Attribute - Namespace"
            Public Overrides Readonly Property [Namespace]() As String
                Get 
                    Return ""
                End Get
            End Property
            #End Region
    
            #Region "Attribute - GetBase"
            Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase
                Return Me
            End Function
            #End Region
            #End Region
    
    
    ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
    
    ' Add Additional Methods and members here...
    
    ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
        End Class
    End Namespace