Defines a group of elements nested within another element.
Пример #1
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)
 {
     Members.Add(g);
 }
Пример #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 (m_currentDepth == 0)
                return -1;

            m_currentDepth--;
            m_model.Parent.AddGroup(m_model);
            m_model = m_model.Parent;
            return m_currentDepth;
        }
Пример #3
0
 /// <summary>
 /// Initialises a new Content Model Group.
 /// </summary>
 /// <param name="parent">The parent model group.</param>
 public Group(Group parent)
 {
     m_parent = parent;
     Members = new List<Object>();
     m_groupType = GroupType.None;
     m_occurrence = Occurrence.Required;
 }
Пример #4
0
 /// <summary>
 /// Begins processing of a nested model group.
 /// </summary>
 public void PushGroup()
 {
     m_model = new Group(m_model);
     m_currentDepth++;
 }
Пример #5
0
 /// <summary>
 /// Initialises a new instance of the <see cref="ContentModel"/> class.
 /// </summary>
 public ContentModel()
 {
     m_model = new Group(null);
 }
Пример #6
0
 public int PopGroup()
 {
     if (CurrentDepth == 0) return -1;
     CurrentDepth--;
     Model.Parent.AddGroup(Model);
     Model = Model.Parent;
     return CurrentDepth;
 }
Пример #7
0
 public void PushGroup()
 {
     Model = new Group(Model);
     CurrentDepth++;
 }
Пример #8
0
 public Group(Group parent)
 {
     Parent = parent;
     Members = new ArrayList();
     this.GroupType = GroupType.None;
     Occurrence = Occurrence.Required;
 }