Beispiel #1
0
        /// <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();
            }
        }
Beispiel #2
0
        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) { }
Beispiel #4
0
 /// <summary>
 /// Adds a new legend to the text area.
 /// </summary>
 public void Add(Legend legend)
 {
   this.Elements.Add(legend);
 }
Beispiel #5
0
 /// <summary>
 /// Adds a new legend to the collection.
 /// </summary>
 public Legend AddLegend()
 {
   Legend legend = new Legend();
   Add(legend);
   return legend;
 }
Beispiel #6
0
 /// <summary>
 /// Adds a new legend to the text area.
 /// </summary>
 public void Add(Legend legend)
 {
     Elements.Add(legend);
 }