/// <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); }
/// <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; }
/// <summary> /// Begins processing of a nested model group. /// </summary> public void PushGroup() { m_model = new Group(m_model); m_currentDepth++; }
/// <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; }
/// <summary> /// Initialises a new instance of the <see cref="ContentModel"/> class. /// </summary> public ContentModel() { m_model = new Group(null); }