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

Append() private method

private Append ( ) : void
return void
        private void Append()
        {
            // create header as html
            var headerHtml = new HtmlDocument();
            var domain = new Uri(BookmarkViewModel.Url).Host;
            headerHtml.LoadHtml(string.Format("<h2>{0}</h2><p>{1}</p>", BookmarkViewModel.Title, domain));

            _textBoxes = new List<RichTextBox>();
            _itemsControl.Items.Clear();

            AddTextBox(null, topMargin: 15, bottomMargin:0);
            AddParagraph();
            AppendSpan(headerHtml.DocumentNode.ChildNodes[0], _currentParagraph, null, "title");
            AddTextBox(null, bottomMargin: 0);
            AddParagraph();
            AppendSpan(headerHtml.DocumentNode.ChildNodes[1], _currentParagraph, null, "p");

            //RenderBody(headerHtml.DocumentNode);

            var bodyHtml = new HtmlDocument();
            var body = BookmarkViewModel.GetBodyFromStorage();
            body = StripWhitespaceFromBody(body);
            bodyHtml.LoadHtml(body);

            RenderBody(bodyHtml.DocumentNode);
        }