Liquid XML Data Binder 2020
In This Topic
    MyRootObject.cs
    In This Topic
    ��using System;
    using System.Xml;
    
    /**********************************************************************************************
     * Copyright (c) 2001-2020 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: Cardinality.xsd
     **********************************************************************************************/
    
    namespace CardinalityLib
    {
        /// <summary>
        /// This class represents the Element MyRootObject
        /// </summary>
        [LiquidTechnologies.Runtime.Net45.XmlObjectInfo(LiquidTechnologies.Runtime.Net45.XmlObjectBase.XmlElementGroupType.Sequence,
                                                        LiquidTechnologies.Runtime.Net45.XmlObjectBase.XmlElementType.Element,
                                                        "MyRootObject", "", true, false, false)]
        public partial class MyRootObject : 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 MyRootObject()
            {
                _elementName = "MyRootObject";
                Init();
            }
            public MyRootObject(string elementName)
            {
                _elementName = elementName;
                Init();
            }
            #endregion
    
            #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 override void Init()
            {
                CardinalityLib.Registration.iRegistrationIndicator = 0; // causes registration to take place
                m_ASimpleStringMandatoryElement = "";
                m_ASimpleDateMandatoryElement = new LiquidTechnologies.Runtime.Net45.XmlDateTime(LiquidTechnologies.Runtime.Net45.XmlDateTime.DateType.date);
                m_AComplexMandatoryElement = new CardinalityLib.AComplexMandatoryElement("AComplexMandatoryElement");
                m_ASimpleStringOptionalElement = null;
                m_ASimpleDateOptionalElement = null;
                m_AComplexOptionalElement = null;
                m_ASimpleStringCollectionElement = new CardinalityLib.XmlSimpleTypeCollection<string>("ASimpleStringCollectionElement", "", LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_string, 0, -1, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Preserve, new LiquidTechnologies.Runtime.Net45.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1));
                m_ASimpleDateCollectionElement = new CardinalityLib.XmlSimpleTypeCollection<LiquidTechnologies.Runtime.Net45.XmlDateTime>("ASimpleDateCollectionElement", "", LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_date, 0, -1, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Collapse, new LiquidTechnologies.Runtime.Net45.PrimitiveRestrictions("", -1, -1, "", "", "", "", -1, -1, -1));
                m_AComplexCollectionElement = new CardinalityLib.XmlObjectCollection<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
            }
            #endregion
    
            #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 override object Clone()
            {
                CardinalityLib.MyRootObject newObject = new CardinalityLib.MyRootObject(_elementName);
                newObject.m_ASimpleStringMandatoryElement = m_ASimpleStringMandatoryElement;
                newObject.m_ASimpleDateMandatoryElement = (LiquidTechnologies.Runtime.Net45.XmlDateTime)m_ASimpleDateMandatoryElement.Clone();
                newObject.m_AComplexMandatoryElement = null;
                if (m_AComplexMandatoryElement != null)
                    newObject.m_AComplexMandatoryElement = (CardinalityLib.AComplexMandatoryElement)m_AComplexMandatoryElement.Clone();
                newObject.m_ASimpleStringOptionalElement = m_ASimpleStringOptionalElement;
                if (m_ASimpleDateOptionalElement == null)
                    newObject.m_ASimpleDateOptionalElement = null;
                else
                    newObject.m_ASimpleDateOptionalElement = (LiquidTechnologies.Runtime.Net45.XmlDateTime)m_ASimpleDateOptionalElement.Clone();
                newObject.m_AComplexOptionalElement = null;
                if (m_AComplexOptionalElement != null)
                    newObject.m_AComplexOptionalElement = (CardinalityLib.AComplexOptionalElement)m_AComplexOptionalElement.Clone();
                foreach (string o in m_ASimpleStringCollectionElement)
                    newObject.m_ASimpleStringCollectionElement.Add(o);
                foreach (LiquidTechnologies.Runtime.Net45.XmlDateTime o in m_ASimpleDateCollectionElement)
                    newObject.m_ASimpleDateCollectionElement.Add((LiquidTechnologies.Runtime.Net45.XmlDateTime)o.Clone());
                foreach (CardinalityLib.AComplexCollectionElement o in m_AComplexCollectionElement)
                    newObject.m_AComplexCollectionElement.Add((CardinalityLib.AComplexCollectionElement)o.Clone());
    
    // ##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;
            }
            #endregion
    
            #region Member variables
    
            protected override string TargetNamespace
            {
                get { return ""; }
            }
    
            #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.Net45.ElementInfoSeqPrimMnd("ASimpleStringMandatoryElement", "", null, LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_string, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, null)]
            public string ASimpleStringMandatoryElement
            {
                get
                {
                    return m_ASimpleStringMandatoryElement;
                }
                set 
                {
                    // Apply whitespace rules appropriately
                    value = LiquidTechnologies.Runtime.Net45.WhitespaceUtils.Preserve(value);
                    m_ASimpleStringMandatoryElement = value;
                }
            }
            protected string m_ASimpleStringMandatoryElement;
    
            #endregion
    
            #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.Net45.XmlDateTime(LiquidTechnologies.Runtime.Net45.XmlDateTime.DateType.date).
            /// </remarks>
            [LiquidTechnologies.Runtime.Net45.ElementInfoSeqPrimMnd("ASimpleDateMandatoryElement", "", null, LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_date, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, null)]
            public LiquidTechnologies.Runtime.Net45.XmlDateTime ASimpleDateMandatoryElement
            {
                get
                {
                    return m_ASimpleDateMandatoryElement;
                }
                set 
                {
                    m_ASimpleDateMandatoryElement.SetDateTime(value, m_ASimpleDateMandatoryElement.Type); 
                }
            }
            protected LiquidTechnologies.Runtime.Net45.XmlDateTime m_ASimpleDateMandatoryElement;
    
            #endregion
    
            #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 null an exception is raised.
            /// </remarks>
            [LiquidTechnologies.Runtime.Net45.ElementInfoSeqClsMnd("AComplexMandatoryElement", "", LiquidTechnologies.Runtime.Net45.XmlObjectBase.XmlElementType.Element, typeof(CardinalityLib.AComplexMandatoryElement), true)]
            public CardinalityLib.AComplexMandatoryElement AComplexMandatoryElement
            {
                get 
                { 
                    return m_AComplexMandatoryElement;  
                }
                set 
                { 
                    Throw_IfPropertyIsNull(value, "AComplexMandatoryElement");
                    if (value != null)
                        SetElementName(value, "AComplexMandatoryElement");
                    m_AComplexMandatoryElement = value;
                }
            }
            protected CardinalityLib.AComplexMandatoryElement m_AComplexMandatoryElement;
            
            #endregion
    
            #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.Net45.ElementInfoSeqPrimOpt("ASimpleStringOptionalElement", "", true, null, LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_string, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, null)]
            public string ASimpleStringOptionalElement
            {
                get 
                { 
                    return m_ASimpleStringOptionalElement;  
                }
                set 
                { 
                    if (value == null)
                    {
                        m_ASimpleStringOptionalElement = null;
                    }
                    else
                    {
                        // Apply whitespace rules appropriately
                        value = LiquidTechnologies.Runtime.Net45.WhitespaceUtils.Preserve(value); 
                        m_ASimpleStringOptionalElement = value;
                    }
                }
            }
            protected string m_ASimpleStringOptionalElement;
            #endregion
    
            #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.Net45.ElementInfoSeqPrimOpt("ASimpleDateOptionalElement", "", true, null, LiquidTechnologies.Runtime.Net45.Conversions.ConversionType.type_date, null, LiquidTechnologies.Runtime.Net45.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, null)]
            public LiquidTechnologies.Runtime.Net45.XmlDateTime ASimpleDateOptionalElement
            {
                get 
                { 
                    return m_ASimpleDateOptionalElement;  
                }
                set 
                { 
                    if (value == null)
                    {
                        m_ASimpleDateOptionalElement = null;
                    }
                    else
                    {
                        if (m_ASimpleDateOptionalElement == null)
                            m_ASimpleDateOptionalElement = new LiquidTechnologies.Runtime.Net45.XmlDateTime(LiquidTechnologies.Runtime.Net45.XmlDateTime.DateType.date);
                        m_ASimpleDateOptionalElement.SetDateTime(value, m_ASimpleDateOptionalElement.Type);
                    }
                }
            }
            protected LiquidTechnologies.Runtime.Net45.XmlDateTime m_ASimpleDateOptionalElement;
            #endregion
    
            #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 null.
            /// </remarks>
            [LiquidTechnologies.Runtime.Net45.ElementInfoSeqClsOpt("AComplexOptionalElement", "", LiquidTechnologies.Runtime.Net45.XmlObjectBase.XmlElementType.Element, typeof(CardinalityLib.AComplexOptionalElement))]
            public CardinalityLib.AComplexOptionalElement AComplexOptionalElement
            {
                get
                { 
                    return m_AComplexOptionalElement;
                }
                set
                { 
                    if (value == null)
                        m_AComplexOptionalElement = null;
                    else
                    {
                        SetElementName(value, "AComplexOptionalElement");
                        m_AComplexOptionalElement = value; 
                    }
                }
            }
            protected CardinalityLib.AComplexOptionalElement m_AComplexOptionalElement;
            
            #endregion
    
            #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.Net45.ElementInfoSeqPrimCol("ASimpleStringCollectionElement", "")]
            public CardinalityLib.XmlSimpleTypeCollection<string> ASimpleStringCollectionElement
            {
                get { return m_ASimpleStringCollectionElement; }
            }
            protected CardinalityLib.XmlSimpleTypeCollection<string> m_ASimpleStringCollectionElement;
    
            #endregion
    
            #region Attribute - ASimpleDateCollectionElement
            /// <summary>
            /// A collection of LiquidTechnologies.Runtime.Net45.XmlDateTimes
            /// </summary>
            /// <remarks>
            /// This property is represented as an Element in the XML.
            /// This collection may contain 0 to Many LiquidTechnologies.Runtime.Net45.XmlDateTimes.
            /// </remarks>
            [LiquidTechnologies.Runtime.Net45.ElementInfoSeqPrimCol("ASimpleDateCollectionElement", "")]
            public CardinalityLib.XmlSimpleTypeCollection<LiquidTechnologies.Runtime.Net45.XmlDateTime> ASimpleDateCollectionElement
            {
                get { return m_ASimpleDateCollectionElement; }
            }
            protected CardinalityLib.XmlSimpleTypeCollection<LiquidTechnologies.Runtime.Net45.XmlDateTime> m_ASimpleDateCollectionElement;
    
            #endregion
    
            #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.Net45.ElementInfoSeqClsCol("AComplexCollectionElement", "", LiquidTechnologies.Runtime.Net45.XmlObjectBase.XmlElementType.Element)]
            public CardinalityLib.XmlObjectCollection<CardinalityLib.AComplexCollectionElement> AComplexCollectionElement
            {
                get { return m_AComplexCollectionElement; }
            }
            protected CardinalityLib.XmlObjectCollection<CardinalityLib.AComplexCollectionElement> m_AComplexCollectionElement;
    
            #endregion
    
            #region Attribute - Namespace
            public override string Namespace
            {
                get { return ""; }
            }    
            #endregion    
    
            #region Attribute - GetBase
            public override LiquidTechnologies.Runtime.Net45.XmlObjectBase GetBase()
            {
                return this;
            }
            #endregion
            #endregion
    
    
    // ##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
        }
    }