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

AppendItalic() private method

private AppendItalic ( 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 AppendItalic(HtmlNode node, Paragraph paragraph, Span span)
        {
            Run run = new Run();
            run.FontStyle = FontStyles.Italic;

            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.FontWeight != this.FontWeight)
                run.FontWeight = this.FontWeight;

            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);
        }