Defines a group of elements nested within another element.
Пример #1
0
 /// <summary>
 ///   Begins processing of a nested model group.
 /// </summary>
 public void PushGroup()
 {
     this.m_model = new Group(this.m_model);
     this.m_currentDepth++;
 }
Пример #2
0
        /// <summary>
        ///   Finishes processing of a nested model group.
        /// </summary>
        /// <returns>The current depth of the group nesting, or -1 if there are no more groups to pop.</returns>
        public int PopGroup()
        {
            if (this.m_currentDepth == 0)
            {
                return -1;
            }

            this.m_currentDepth--;
            this.m_model.Parent.AddGroup(this.m_model);
            this.m_model = this.m_model.Parent;
            return this.m_currentDepth;
        }
Пример #3
0
 /// <summary>
 ///   Adds a new child model group to the end of the group's members.
 /// </summary>
 /// <param name = "g">The model group to add.</param>
 public void AddGroup(Group g)
 {
     this.Members.Add(g);
 }
Пример #4
0
 /// <summary>
 ///   Initialises a new instance of the <see cref = "ContentModel" /> class.
 /// </summary>
 public ContentModel()
 {
     this.m_model = new Group(null);
 }
Пример #5
0
 /// <summary>
 ///   Initialises a new Content Model Group.
 /// </summary>
 /// <param name = "parent">The parent model group.</param>
 public Group(Group parent)
 {
     this.m_parent = parent;
     this.Members = new ArrayList();
     this.m_groupType = GroupType.None;
     this.m_occurrence = Occurrence.Required;
 }