Ejemplo n.º 1
0
        /// <summary>
        /// HW_s the load completed.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <param name="e">The e.</param>
        protected void hw_LoadCompleted(object o, HtmlDocumentLoadCompleted e)
        {
            HtmlDocument doc = e.Document;

            if (doc == null)
            {
                return;
            }
            HtmlNode docNode = doc.DocumentNode;

            HtmlNodeCollection tags      = docNode.SelectNodes(".//p[@class='sa']");
            string             scripture = tags.Count > 0 ? tags[0].InnerText : string.Empty;

            tags = docNode.SelectNodes(".//p[@class='sb']");
            string summaryText = tags.Count > 0 ? tags[0].InnerText : string.Empty;

            scripture   = scripture.Replace("&nbsp;", " ");
            summaryText = summaryText.Replace("&nbsp;", " ");

            var dt = new DailyText {
                Scripture   = scripture,
                SummaryText = summaryText
            };

            DailyTextRetrieved.Invoke(dt);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// HW_s the load completed.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <param name="e">The e.</param>
        protected void hw_LoadCompleted(object o, HtmlDocumentLoadCompleted e)
        {
            HtmlDocument doc = e.Document;
            if (doc == null) return;
            HtmlNode docNode = doc.DocumentNode;

            HtmlNodeCollection tags = docNode.SelectNodes(".//p[@class='sa']");
            string scripture = tags.Count > 0 ? tags[0].InnerText : string.Empty;

            tags = docNode.SelectNodes(".//p[@class='sb']");
            string summaryText = tags.Count > 0 ? tags[0].InnerText : string.Empty;

            scripture = scripture.Replace("&nbsp;", " ");
            summaryText = summaryText.Replace("&nbsp;", " ");

            var dt = new DailyText {
                                       Scripture = scripture,
                                       SummaryText = summaryText
                                   };

            DailyTextRetrieved.Invoke(dt);
        }