public SiteWordsExtractor()
        {
            // initialize the windows form components
            InitializeComponent();

            listViewResults.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            // load logger configuration
            configLogger();
            log.Info("-------------------");
            log.Info("Application started");


            AppSettings.Settings = AppSettingsStorage.Load();
            updateStatusLine("Configuration Loaded");
            progressLabel.Text = "";
            m_statsRootFolder  = null;
            m_reportFolder     = null;
            m_ElementsCounter  = null;
            m_htmlProcessor    = new HtmlProcessor();
            m_columnSorter     = new ListViewColumnSorter();
            listViewResults.ListViewItemSorter = m_columnSorter;

            validateSettings();
        }
Exemple #2
0
 public void RegisterProcessor(HtmlProcessor processor)
 {
     m_processor = processor;
     m_processor.OnStartProcessPage += OnStartProcessPage;
     m_processor.OnEndProcessPage   += OnEndProcessPage;
     m_processor.OnNewParagraph     += OnNewParagraph;
     m_processor.OnText             += OnText;
     m_processor.OnBoldText         += OnBoldText;
     m_processor.OnAttribute        += OnAttribute;
     m_processor.OnHyperlink        += OnHyperlink;
 }
Exemple #3
0
        public ElementsCounter(HtmlProcessor processor)
        {
            m_wordsCounter = new WordsCounter(AppSettings.Settings.WordsCounter.RegEx);

            m_elementsCount     = new Dictionary <string, int>();
            m_elementsWordCount = new Dictionary <string, int>();

            m_processor              = processor;
            m_processor.OnAttribute += OnText;
            m_processor.OnText      += OnText;
            m_processor.OnBoldText  += OnText;
            m_processor.OnHyperlink += OnHyperlink;
        }
Exemple #4
0
        public void UnregisterProcessor()
        {
            m_processor.OnStartProcessPage -= OnStartProcessPage;
            m_processor.OnEndProcessPage   -= OnEndProcessPage;
            m_processor.OnNewParagraph     -= OnNewParagraph;
            m_processor.OnText             -= OnText;
            m_processor.OnBoldText         -= OnBoldText;
            m_processor.OnAttribute        -= OnAttribute;
            m_processor.OnHyperlink        -= OnHyperlink;
            m_processor = null;
            m_rtf.CloseFile();

            log.Debug("UnregisterProcessor: file=[" + m_filename + "], words count=" + m_wordsCount.ToString());
        }