/// <summary> /// Parses the keyword «\legend» inside a textarea. /// </summary> private void ParseLegend(Legend legend) { // Syntax: // 1. \legend // 2. \legend[...] // 3. \legend[...]{...} try { ReadCode(); if (Symbol == Symbol.BracketLeft) { ParseAttributes(legend, false); ReadCode(); } // Empty legends are allowed. if (Symbol != Symbol.BraceLeft) return; AdjustToNextBlock(); // consume/ignore all content } catch (DdlParserException pe) { ReportParserException(pe); AdjustToNextBlock(); } }
internal override void VisitLegend(Legend legend) { ParagraphFormat parentFormat; if (!legend._style.IsNull) { Style style = legend.Document.Styles[legend.Style]; if (style == null) style = legend.Document.Styles[StyleNames.InvalidStyleName]; parentFormat = style._paragraphFormat; } else { TextArea textArea = (TextArea)GetDocumentElementHolder(legend); legend._style = textArea._style; parentFormat = textArea._format; } if (legend._format == null) legend.Format = parentFormat.Clone(); else FlattenParagraphFormat(legend._format, parentFormat); }
internal virtual void VisitLegend(Legend legend) { }
/// <summary> /// Adds a new legend to the text area. /// </summary> public void Add(Legend legend) { this.Elements.Add(legend); }
/// <summary> /// Adds a new legend to the collection. /// </summary> public Legend AddLegend() { Legend legend = new Legend(); Add(legend); return legend; }
/// <summary> /// Adds a new legend to the text area. /// </summary> public void Add(Legend legend) { Elements.Add(legend); }