/** * Constructs a RtfInfoElement based on the given Meta object * * @param doc The RtfDocument this RtfInfoElement belongs to * @param meta The Meta object this RtfInfoElement is based on */ public RtfInfoElement(RtfDocument doc, Meta meta) : base(doc) { infoType = meta.Type; content = meta.Content; }
/* (non-Javadoc) * @see com.lowagie.text.rtf.direct.RtfDestination#handleGroupEnd() */ public override bool HandleCloseGroup() { if (this.text.Length > 0) { var doc = this.rtfParser.GetDocument(); if (doc != null) { if (this.elementName.Equals("author")){ doc.AddAuthor(this.text); } if (this.elementName.Equals("title")){ doc.AddTitle(this.text); } if (this.elementName.Equals("subject")){ doc.AddSubject(this.text); } } else { RtfDocument rtfDoc = this.rtfParser.GetRtfDocument(); if (rtfDoc != null) { if (this.elementName.Equals("author")){ Meta meta = new Meta(this.elementName, this.text); RtfInfoElement elem = new RtfInfoElement(rtfDoc, meta); rtfDoc.GetDocumentHeader().AddInfoElement(elem); } if (this.elementName.Equals("title")){ Meta meta = new Meta(this.elementName, this.text); RtfInfoElement elem = new RtfInfoElement(rtfDoc, meta); rtfDoc.GetDocumentHeader().AddInfoElement(elem); } if (this.elementName.Equals("subject")){ Meta meta = new Meta(this.elementName, this.text); RtfInfoElement elem = new RtfInfoElement(rtfDoc, meta); rtfDoc.GetDocumentHeader().AddInfoElement(elem); } } } this.SetToDefaults(); } return true; }