WeiranZhang.Metropaper.Controls.NewHtmlBlock.AppendBold C# (CSharp) Method

AppendBold() private method

private AppendBold ( HtmlNode node, System.Windows.Documents.Paragraph paragraph, System.Windows.Documents.Span span ) : void
node HtmlAgilityPack.HtmlNode
paragraph System.Windows.Documents.Paragraph
span System.Windows.Documents.Span
return void
        private void AppendBold(HtmlNode node, Paragraph paragraph, Span span)
        {
            Run run = new Run();
            run.FontWeight = FontWeights.Bold;
            if (run.FontFamily != this.FontFamily)
                run.FontFamily = this.FontFamily;

            if (run.FontSize != this.FontSize)
                run.FontSize = this.FontSize;

            if (run.FontStretch != this.FontStretch)
                run.FontStretch = this.FontStretch;

            if (run.FontStyle != this.FontStyle)
                run.FontStyle = this.FontStyle;

            if (run.Foreground != this.Foreground)
                run.Foreground = this.Foreground;

            if (span != null)
            {
                span.Inlines.Add(run);
            }
            else if (paragraph != null)
            {
                paragraph.Inlines.Add(run);
            }

            RenderChildren(node, paragraph, span);
        }