Exemple #1
0
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] HeadingBlock obj)
        {
            var paragraph = new Paragraph()
            {
                Tag = obj
            };

            switch (obj.Level)
            {
            case 1: renderer.Styles.ApplyHeading1Style(paragraph); break;

            case 2: renderer.Styles.ApplyHeading2Style(paragraph); break;

            case 3: renderer.Styles.ApplyHeading3Style(paragraph); break;

            case 4: renderer.Styles.ApplyHeading4Style(paragraph); break;

            case 5: renderer.Styles.ApplyHeading5Style(paragraph); break;

            case 6: renderer.Styles.ApplyHeading6Style(paragraph); break;
            }

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] HeadingBlock obj)
        {
            var paragraph = new Paragraph();
            ComponentResourceKey styleKey = null;

            switch (obj.Level)
            {
            case 1: styleKey = Styles.Heading1StyleKey; break;

            case 2: styleKey = Styles.Heading2StyleKey; break;

            case 3: styleKey = Styles.Heading3StyleKey; break;

            case 4: styleKey = Styles.Heading4StyleKey; break;

            case 5: styleKey = Styles.Heading5StyleKey; break;

            case 6: styleKey = Styles.Heading6StyleKey; break;
            }

            if (styleKey != null)
            {
                paragraph.SetResourceReference(FrameworkContentElement.StyleProperty, styleKey);
            }

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
        /// <inheritdoc/>
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] ParagraphBlock obj)
        {
            var paragraph = new Paragraph();

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
        /// <inheritdoc/>
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] ParagraphBlock obj)
        {
            var paragraph = new Paragraph();

            renderer.BeginBlock(paragraph);
            renderer.WriteLeafInline(obj);

            paragraph.Inlines.AddRange(renderer.Inlines);
            renderer.EndBlock();
        }
        /// <inheritdoc/>
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] ParagraphBlock obj)
        {
            var paragraph = new Paragraph();

            paragraph.SetResourceReference(FrameworkContentElement.StyleProperty, Styles.ParagraphStyleKey);

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
Exemple #6
0
        protected override void Write([NotNull] WpfRenderer renderer, [NotNull] Markdig.Extensions.Figures.FigureCaption obj)
        {
            Paragraph paragraph = new Paragraph()
            {
                Tag = obj
            };

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
Exemple #7
0
        /// <inheritdoc/>
        protected override void Write(WpfRenderer renderer, ParagraphBlock obj)
        {
            if (renderer == null)
            {
                throw new ArgumentNullException(nameof(renderer));
            }
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            var paragraph = new Paragraph();

            paragraph.SetResourceReference(FrameworkContentElement.StyleProperty, Styles.ParagraphStyleKey);

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }
        protected override void Write(WpfRenderer renderer, HeadingBlock obj)
        {
            if (renderer == null)
            {
                throw new ArgumentNullException(nameof(renderer));
            }
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            var paragraph = new Paragraph();
            ComponentResourceKey?styleKey = null;

            switch (obj.Level)
            {
            case 1: styleKey = Styles.Heading1StyleKey; break;

            case 2: styleKey = Styles.Heading2StyleKey; break;

            case 3: styleKey = Styles.Heading3StyleKey; break;

            case 4: styleKey = Styles.Heading4StyleKey; break;

            case 5: styleKey = Styles.Heading5StyleKey; break;

            case 6: styleKey = Styles.Heading6StyleKey; break;
            }

            if (styleKey != null)
            {
                paragraph.SetResourceReference(FrameworkContentElement.StyleProperty, styleKey);
            }

            renderer.Push(paragraph);
            renderer.WriteLeafInline(obj);
            renderer.Pop();
        }