Esempio n. 1
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 ArrayList();
     m_groupType = GroupType.None;
     m_occurrence = Occurrence.Required;
 }
Esempio n. 2
0
 /// <summary>
 ///   Begins processing of a nested model group.
 /// </summary>
 public void PushGroup()
 {
     m_model = new Group(m_model);
     m_currentDepth++;
 }
Esempio n. 3
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;
        }
Esempio n. 4
0
 /// <summary>
 ///   Initialises a new instance of the <see cref = "ContentModel" /> class.
 /// </summary>
 public ContentModel()
 {
     m_model = new Group(null);
 }
Esempio n. 5
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);
 }