예제 #1
0
        private AwfulSmiley BuildFromNode(HtmlNode node)
        {
            AwfulSmiley smiley = new AwfulSmiley();
            smiley.Text = this.GetText(node);
            this.SetTitleAndUri(node, smiley);

            return smiley;
        }
예제 #2
0
        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;
            }
        }