상속: RtfElement, IRtfGroup
예제 #1
0
        }         // DoVisit

        // ----------------------------------------------------------------------
        protected override bool IsEqual(object obj)
        {
            RtfGroup compare = obj as RtfGroup;             // guaranteed to be non-null

            return(compare != null && base.IsEqual(obj) &&
                   this.contents.Equals(compare.contents));
        }         // IsEqual
 // ----------------------------------------------------------------------
 protected override void DoGroupBegin()
 {
     RtfGroup newGroup = new RtfGroup();
     if ( curGroup != null )
     {
         openGroupStack.Push( curGroup );
         curGroup.WritableContents.Add( newGroup );
     }
     curGroup = newGroup;
 }
		} // DoParseBegin

		// ----------------------------------------------------------------------
		protected override void DoGroupBegin()
		{
			RtfGroup newGroup = new RtfGroup();
			if ( this.curGroup != null )
			{
				this.openGroupStack.Push( this.curGroup );
				this.curGroup.WritableContents.Add( newGroup );
			}
			this.curGroup = newGroup;
		} // DoGroupBegin
 // ----------------------------------------------------------------------
 protected override void DoGroupEnd()
 {
     if ( openGroupStack.Count > 0 )
     {
         curGroup = (RtfGroup)openGroupStack.Pop();
     }
     else
     {
         if ( structureRoot != null )
         {
             throw new RtfStructureException( Strings.MultipleRootLevelGroups );
         }
         structureRoot = curGroup;
         curGroup = null;
     }
 }
 // ----------------------------------------------------------------------
 protected override void DoParseBegin()
 {
     openGroupStack.Clear();
     curGroup = null;
     structureRoot = null;
 }