Esempio n. 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();
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 internal virtual void VisitLegend(Legend legend) { }
Esempio n. 4
0
 /// <summary>
 /// Adds a new legend to the text area.
 /// </summary>
 public void Add(Legend legend)
 {
   this.Elements.Add(legend);
 }
Esempio n. 5
0
 /// <summary>
 /// Adds a new legend to the collection.
 /// </summary>
 public Legend AddLegend()
 {
   Legend legend = new Legend();
   Add(legend);
   return legend;
 }
Esempio n. 6
0
 /// <summary>
 /// Adds a new legend to the text area.
 /// </summary>
 public void Add(Legend legend)
 {
     Elements.Add(legend);
 }