Beispiel #1
0
        /// <summary>
        /// Add a new schema element zone to the specified parent schema element zone.
        /// </summary>
        /// <param name="parentZoneElement">The parent schema element zone to consider.</param>
        /// <param name="aElement">The schema element to consider.</param>
        public void AddElement(
            SchemaZoneElement parentZoneElement,
            SchemaElement aElement)
        {
            if ((parentZoneElement == null) | (aElement == null))
            {
                return;
            }

            aElement.ParentZone = parentZoneElement;
            parentZoneElement.AddSubElement(aElement);
        }
Beispiel #2
0
        // --------------------------------------------------
        // CLONING
        // --------------------------------------------------

        #region Cloning

        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <param name="parent">The parent schema element group to consider.</param>
        /// <returns>Returns a cloned instance.</returns>
        public override object Clone(SchemaZoneElement parent, params string[] areas)
        {
            if (parent == null)
            {
                parent = ParentZone;
            }

            SchemaZoneElement element = base.Clone(parent, areas) as SchemaZoneElement;

            foreach (SchemaElement subElement in SubElements)
            {
                element.AddSubElement(subElement.Clone(element) as SchemaElement);
            }

            return(element);
        }
Beispiel #3
0
        /// <summary>
        /// Add a new object to the specified parent schema element zone.
        /// </summary>
        /// <param name="parentZoneElement">The parent schema element zone to consider.</param>
        /// <returns>The created schema element.</returns>
        public SchemaElement CreateElement(
            SchemaZoneElement parentZoneElement)
        {
            if (parentZoneElement == null)
            {
                return(null);
            }

            SchemaElement element = new SchemaElement
            {
                ParentZone = parentZoneElement
            };

            parentZoneElement.AddSubElement(element);
            return(element);
        }