Пример #1
0
 /// <summary>
 /// Initialises a new Content Model Group.
 /// </summary>
 /// <param name="parent">The parent model group.</param>
 public Group( Group parent )
 {
     Parent = parent;
       _members = new ArrayList();
       _groupType = GroupType.None;
       Occurrence = Occurrence.Required;
 }
Пример #2
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 );
 }
Пример #3
0
 /// <summary>
 /// Initialises a new instance of the <see cref="ContentModel"/> class.
 /// </summary>
 public ContentModel()
 {
     _model = new Group( null );
 }
Пример #4
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( CurrentDepth == 0 )
            return -1;

              CurrentDepth--;
              _model.Parent.AddGroup( _model );
              _model = _model.Parent;
              return CurrentDepth;
        }
Пример #5
0
 /// <summary>
 /// Begins processing of a nested model group.
 /// </summary>
 public void PushGroup()
 {
     _model = new Group( _model );
       CurrentDepth++;
 }