/// <summary>
 /// Adds a html string to the body of the tag.
 /// </summary>
 /// <param name="html">The HTML string.</param>
 public virtual void Add(string html)
 {
     if (html != null)
     {
         HtmlList.Add(html);
     }
 }
 /// <summary>
 /// Adds another FWTagBuilder to the body of the tag.
 /// </summary>
 /// <param name="tag">The FWTagBuilder object.</param>
 public virtual T Add <T>(T tag)
     where T : TagBuilder
 {
     if (tag != null)
     {
         HtmlList.Add(tag);
     }
     return(tag);
 }
        //public CultureInfo Language { get; }

        //public void GetLanguage()
        //{
        //    string preferencesLocation = this.Location + "/about_you/preferences.html";
        //    HtmlDocument htmlDocument = new HtmlDocument();
        //    htmlDocument.Load(preferencesLocation);
        //    string locale = htmlDocument.DocumentNode.SelectSingleNode("/ html / body / div / div / div / div[2] / div[2] / div / div[3] / div / div[2] / div[1] / div[2] / div / div / div / div[1] / div[3]").InnerText;
        //    this.Language = this.Language(locale, false);
        //}

        public void GetHtmlFiles(ProgressBar progressBar, ListBox outputLog)
        {
            List <string> listOfHtml       = new List <string>();
            string        messagesLocation = this.Location + "/messages/archived_threads/";

            outputLog.Dispatcher.Invoke(() =>
            {
                outputLog.Items.Add("Gathering HTML files from archived threads...");
                outputLog.SelectedIndex = outputLog.Items.Count - 1;
                outputLog.ScrollIntoView(outputLog.SelectedItem);
            });
            listOfHtml = Directory.GetFiles(messagesLocation, "*.html", SearchOption.AllDirectories).ToList();
            outputLog.Dispatcher.Invoke(() =>
            {
                outputLog.Items.Add("Gathering HTML files from filtered threads...");
                outputLog.SelectedIndex = outputLog.Items.Count - 1;
                outputLog.ScrollIntoView(outputLog.SelectedItem);
            });
            messagesLocation = Location + "/messages/filtered_threads/";
            listOfHtml.AddRange(Directory.GetFiles(messagesLocation, "*.html", SearchOption.AllDirectories).ToList());
            outputLog.Dispatcher.Invoke(() =>
            {
                outputLog.Items.Add("Gathering HTML files from inbox...");
                outputLog.SelectedIndex = outputLog.Items.Count - 1;
                outputLog.ScrollIntoView(outputLog.SelectedItem);
            });
            messagesLocation = Location + "/messages/inbox/";
            listOfHtml.AddRange(Directory.GetFiles(messagesLocation, "*.html", SearchOption.AllDirectories).ToList());

            foreach (string htmlFile in listOfHtml)
            {
                HtmlList.Add(new HtmlFile(htmlFile));
            }
            outputLog.Dispatcher.Invoke(() =>
            {
                outputLog.Items.Add("Found " + HtmlList.Count + " HTML files to process");
                outputLog.SelectedIndex = outputLog.Items.Count - 1;
                progressBar.Maximum     = HtmlList.Count;
                outputLog.ScrollIntoView(outputLog.SelectedItem);
            });
        }
Exemple #4
0
 public Html Add(string name)
 {
     Html result = name;
     _children.Add(result);
     return result;
 }