private AwfulSmiley BuildFromNode(HtmlNode node) { AwfulSmiley smiley = new AwfulSmiley(); smiley.Text = this.GetText(node); this.SetTitleAndUri(node, smiley); return smiley; }
private void SetTitleAndUri(HtmlNode parent, AwfulSmiley smiley) { var node = parent.Descendants("img") .FirstOrDefault(); if (node != null) { string uri = node.GetAttributeValue(SMILEY_URI_ATTRIBUTE, ""); string title = node.GetAttributeValue(SMILEY_TITLE_ATTRIBUTE, ""); smiley.Uri = uri; smiley.Title = title; } }