Esempio n. 1
0
        /**************************************************************************/

        public bool AllowedDocType(MacroscopeDocument msDoc)
        {
            bool Allowed = false;

            switch (msDoc.GetDocumentType( ))
            {
            case MacroscopeConstants.DocumentType.HTML:
                Allowed = true;
                break;

            case MacroscopeConstants.DocumentType.PDF:
                Allowed = true;
                break;

            default:
                break;
            }

            return(Allowed);
        }
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            bool Proceed = false;

            if (msDoc.GetIsExternal())
            {
                return;
            }

            if (msDoc.GetIsRedirect())
            {
                return;
            }

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.HTML:
                Proceed = true;
                break;

            case MacroscopeConstants.DocumentType.PDF:
                Proceed = true;
                break;

            default:
                break;
            }

            if (Proceed)
            {
                ListViewItem lvItem = null;

                string Text           = msDoc.GetKeywords();
                int    Occurrences    = 0;
                int    KeywordsLength = msDoc.GetKeywordsLength();
                int    TextNumber     = msDoc.GetKeywordsCount();

                string PairKey = string.Join("", Url, Text);

                if (KeywordsLength > 0)
                {
                    Occurrences = DocCollection.GetStatsKeywordsCount(msDoc);
                }

                if (this.DisplayListView.Items.ContainsKey(PairKey))
                {
                    try
                    {
                        lvItem = this.DisplayListView.Items[PairKey];
                        lvItem.SubItems[0].Text = Url;
                        lvItem.SubItems[1].Text = Occurrences.ToString();
                        lvItem.SubItems[2].Text = Text;
                        lvItem.SubItems[3].Text = KeywordsLength.ToString();
                        lvItem.SubItems[4].Text = TextNumber.ToString();
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayKeywords 1: {0}", ex.Message));
                    }
                }
                else
                {
                    try
                    {
                        lvItem = new ListViewItem(PairKey);
                        lvItem.UseItemStyleForSubItems = false;
                        lvItem.Name = PairKey;

                        lvItem.SubItems[0].Text = Url;
                        lvItem.SubItems.Add(Occurrences.ToString());
                        lvItem.SubItems.Add(Text);
                        lvItem.SubItems.Add(KeywordsLength.ToString());
                        lvItem.SubItems.Add(TextNumber.ToString());

                        ListViewItems.Add(lvItem);
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayKeywords 2: {0}", ex.Message));
                    }
                }

                if (lvItem != null)
                {
                    lvItem.ForeColor = Color.Blue;

                    // URL -------------------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[0].ForeColor = Color.Green;
                    }
                    else
                    {
                        lvItem.SubItems[0].ForeColor = Color.Gray;
                    }

                    // Check Missing Text ----------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        if (KeywordsLength <= 0)
                        {
                            lvItem.SubItems[1].ForeColor = Color.Red;
                            lvItem.SubItems[2].ForeColor = Color.Red;
                            lvItem.SubItems[3].ForeColor = Color.Red;
                            lvItem.SubItems[4].ForeColor = Color.Red;
                        }
                        else
                        {
                            lvItem.SubItems[1].ForeColor = Color.Green;
                            lvItem.SubItems[2].ForeColor = Color.Green;
                            lvItem.SubItems[3].ForeColor = Color.Green;
                            lvItem.SubItems[4].ForeColor = Color.Green;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[1].ForeColor = Color.Gray;
                        lvItem.SubItems[2].ForeColor = Color.Gray;
                        lvItem.SubItems[3].ForeColor = Color.Gray;
                        lvItem.SubItems[4].ForeColor = Color.Gray;
                    }
                }
            }
        }
Esempio n. 3
0
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            bool Proceed = false;

            if (msDoc.GetIsExternal())
            {
                return;
            }

            if (msDoc.GetIsRedirect())
            {
                return;
            }

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.HTML:
                Proceed = true;
                break;

            case MacroscopeConstants.DocumentType.PDF:
                Proceed = true;
                break;

            default:
                break;
            }

            if (Proceed)
            {
                ListViewItem lvItem            = null;
                int          Occurrences       = 0;
                string       PageLanguage      = msDoc.GetIsoLanguageCode();
                string       DetectedLanguage  = msDoc.GetDescriptionLanguage();
                string       Description       = msDoc.GetDescription();
                int          DescriptionLength = msDoc.GetDescriptionLength();

                string PairKey = string.Join(":", UrlToDigest(Url), UrlToDigest(Description));

                if (string.IsNullOrEmpty(PageLanguage))
                {
                    PageLanguage = "";
                }

                if (string.IsNullOrEmpty(DetectedLanguage))
                {
                    DetectedLanguage = "";
                }

                if (DescriptionLength > 0)
                {
                    Occurrences = DocCollection.GetStatsDescriptionCount(msDoc: msDoc);
                }
                else
                {
                    Description = "MISSING";
                }

                if (this.DisplayListView.Items.ContainsKey(PairKey))
                {
                    try
                    {
                        lvItem = this.DisplayListView.Items[PairKey];
                        lvItem.SubItems[ColUrl].Text              = Url;
                        lvItem.SubItems[ColPageLanguage].Text     = PageLanguage;
                        lvItem.SubItems[ColDetectedLanguage].Text = DetectedLanguage;
                        lvItem.SubItems[ColOccurences].Text       = Occurrences.ToString();
                        lvItem.SubItems[ColDescriptionText].Text  = Description;
                        lvItem.SubItems[ColLength].Text           = DescriptionLength.ToString();
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayDescriptions 1: {0}", ex.Message));
                    }
                }
                else
                {
                    try
                    {
                        lvItem = new ListViewItem(PairKey);
                        lvItem.UseItemStyleForSubItems = false;
                        lvItem.Name = PairKey;

                        lvItem.SubItems[ColUrl].Text = Url;
                        lvItem.SubItems.Add(PageLanguage);
                        lvItem.SubItems.Add(DetectedLanguage);
                        lvItem.SubItems.Add(Occurrences.ToString());
                        lvItem.SubItems.Add(Description);
                        lvItem.SubItems.Add(DescriptionLength.ToString());

                        ListViewItems.Add(lvItem);
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayDescriptions 2: {0}", ex.Message));
                    }
                }

                if (lvItem != null)
                {
                    lvItem.ForeColor = Color.Blue;

                    // URL -------------------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[ColUrl].ForeColor = Color.Green;
                    }
                    else
                    {
                        lvItem.SubItems[ColUrl].ForeColor = Color.Gray;
                    }

                    // Description Language --------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Green;
                        lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Green;

                        if (DetectedLanguage != PageLanguage)
                        {
                            lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Red;
                            lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Red;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Gray;
                        lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Gray;
                    }

                    // Check Description Length ----------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        if (DescriptionLength < MacroscopePreferencesManager.GetDescriptionMinLen())
                        {
                            lvItem.SubItems[ColUrl].ForeColor              = Color.Red;
                            lvItem.SubItems[ColOccurences].ForeColor       = Color.Red;
                            lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Red;
                            lvItem.SubItems[ColDescriptionText].ForeColor  = Color.Red;
                            lvItem.SubItems[ColLength].ForeColor           = Color.Red;
                        }
                        else
                        if (DescriptionLength > MacroscopePreferencesManager.GetDescriptionMaxLen())
                        {
                            lvItem.SubItems[ColUrl].ForeColor              = Color.Red;
                            lvItem.SubItems[ColOccurences].ForeColor       = Color.Red;
                            lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Red;
                            lvItem.SubItems[ColDescriptionText].ForeColor  = Color.Red;
                            lvItem.SubItems[ColLength].ForeColor           = Color.Red;
                        }
                        else
                        {
                            lvItem.SubItems[ColOccurences].ForeColor       = Color.Green;
                            lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Green;
                            lvItem.SubItems[ColDescriptionText].ForeColor  = Color.Green;
                            lvItem.SubItems[ColLength].ForeColor           = Color.Green;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[ColOccurences].ForeColor       = Color.Gray;
                        lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Gray;
                        lvItem.SubItems[ColDescriptionText].ForeColor  = Color.Gray;
                        lvItem.SubItems[ColLength].ForeColor           = Color.Gray;
                    }
                }
            }
        }
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            List <KeyValuePair <string, MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS> > KeywordPresence;
            bool Proceed = false;

            if (msDoc.GetIsExternal())
            {
                return;
            }

            if (msDoc.GetIsRedirect())
            {
                return;
            }

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.HTML:
                Proceed = true;
                break;

            default:
                break;
            }

            if (Proceed)
            {
                ListViewItem lvItem = null;

                KeywordPresence = DocCollection.GetKeywordPresenceAnalysis(msDoc: msDoc);

                foreach (KeyValuePair <string, MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS> Pair in KeywordPresence)
                {
                    MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS Present = Pair.Value;
                    string Keyword = Pair.Key;
                    string PairKey = string.Join("", UrlToDigest(Url: Url).ToString(), Keyword);

                    if (this.DisplayListView.Items.ContainsKey(PairKey))
                    {
                        try
                        {
                            lvItem = this.DisplayListView.Items[PairKey];
                            lvItem.SubItems[COL_URL].Text      = Url;
                            lvItem.SubItems[COL_KEYWORD].Text  = Keyword;
                            lvItem.SubItems[COL_PRESENCE].Text = Present.ToString();
                        }
                        catch (Exception ex)
                        {
                            DebugMsg(string.Format("MacroscopeDisplayKeywordsPresence 1: {0}", ex.Message));
                        }
                    }
                    else
                    {
                        try
                        {
                            lvItem = new ListViewItem(PairKey);
                            lvItem.UseItemStyleForSubItems = false;
                            lvItem.Name = PairKey;

                            lvItem.SubItems[COL_URL].Text = Url;
                            lvItem.SubItems.Add(Keyword);
                            lvItem.SubItems.Add(Present.ToString());

                            ListViewItems.Add(lvItem);
                        }
                        catch (Exception ex)
                        {
                            DebugMsg(string.Format("MacroscopeDisplayKeywordsPresence 2: {0}", ex.Message));
                        }
                    }

                    if (lvItem != null)
                    {
                        lvItem.ForeColor = Color.Blue;

                        // URL -------------------------------------------------------------//

                        if (msDoc.GetIsInternal())
                        {
                            lvItem.SubItems[COL_URL].ForeColor = Color.Green;
                        }
                        else
                        {
                            lvItem.SubItems[COL_URL].ForeColor = Color.Gray;
                        }

                        // Check Missing Text ----------------------------------------------//

                        if (msDoc.GetIsInternal())
                        {
                            switch (Present)
                            {
                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.KEYWORDS_METATAG_EMPTY:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Red;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Red;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Red;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.MALFORMED_KEYWORDS_METATAG:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Red;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Red;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Red;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.PRESENT_IN_TITLE:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Green;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Green;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Green;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.MISSING_IN_TITLE:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Red;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Red;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Red;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.PRESENT_IN_DESCRIPTION:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Green;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Green;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Green;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.MISSING_IN_DESCRIPTION:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Orange;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Orange;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Orange;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.PRESENT_IN_BODY:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Green;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Green;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Green;
                                break;

                            case MacroscopeKeywordPresenceAnalysis.KEYWORD_STATUS.MISSING_IN_BODY:
                                lvItem.SubItems[COL_URL].ForeColor      = Color.Red;
                                lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Red;
                                lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Red;
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            lvItem.SubItems[COL_KEYWORD].ForeColor  = Color.Gray;
                            lvItem.SubItems[COL_PRESENCE].ForeColor = Color.Gray;
                        }
                    }
                }
            }
        }
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            bool Proceed = false;

            if (msDoc.GetIsExternal())
            {
                return;
            }

            if (msDoc.GetIsRedirect())
            {
                return;
            }

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.HTML:
                Proceed = true;
                break;

            case MacroscopeConstants.DocumentType.PDF:
                Proceed = true;
                break;

            default:
                break;
            }

            if (Proceed)
            {
                string PageLocale           = msDoc.GetLocale();
                string PageLanguage         = msDoc.GetIsoLanguageCode();
                string DetectedLanguage     = msDoc.GetDocumentTextLanguage();
                int    WordCount            = msDoc.GetWordCount();
                string ReadabilityGradeType = MacroscopeAnalyzeReadability.FormatAnalyzeReadabilityMethod(
                    ReadabilityMethod: msDoc.GetReadabilityGradeMethod()
                    );
                string       ReadabilityGrade            = msDoc.GetReadabilityGrade().ToString("00.00");
                string       ReadabilityGradeDescription = msDoc.GetReadabilityGradeDescription();
                string       PairKey = string.Join("", Url);
                ListViewItem lvItem  = null;

                if (string.IsNullOrEmpty(PageLocale))
                {
                    PageLocale = "";
                }

                if (string.IsNullOrEmpty(PageLanguage))
                {
                    PageLanguage = "";
                }

                if (string.IsNullOrEmpty(DetectedLanguage))
                {
                    DetectedLanguage = "";
                }

                if (this.DisplayListView.Items.ContainsKey(PairKey))
                {
                    try
                    {
                        lvItem = this.DisplayListView.Items[PairKey];
                        lvItem.SubItems[ColUrl].Text                         = Url;
                        lvItem.SubItems[ColLocale].Text                      = PageLocale;
                        lvItem.SubItems[ColPageLanguage].Text                = PageLanguage;
                        lvItem.SubItems[ColDetectedLanguage].Text            = DetectedLanguage;
                        lvItem.SubItems[ColWordCount].Text                   = WordCount.ToString();
                        lvItem.SubItems[ColReadabilityGradeType].Text        = ReadabilityGradeType;
                        lvItem.SubItems[ColReadabilityGrade].Text            = ReadabilityGrade;
                        lvItem.SubItems[ColReadabilityGradeDescription].Text = ReadabilityGradeDescription;
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayPageText 1: {0}", ex.Message));
                    }
                }
                else
                {
                    try
                    {
                        lvItem = new ListViewItem(PairKey);
                        lvItem.UseItemStyleForSubItems = false;
                        lvItem.Name = PairKey;

                        lvItem.SubItems[ColUrl].Text = Url;
                        lvItem.SubItems.Add(PageLocale);
                        lvItem.SubItems.Add(PageLanguage);
                        lvItem.SubItems.Add(DetectedLanguage);
                        lvItem.SubItems.Add(WordCount.ToString());
                        lvItem.SubItems.Add(ReadabilityGradeType);
                        lvItem.SubItems.Add(ReadabilityGrade);
                        lvItem.SubItems.Add(ReadabilityGradeDescription);

                        ListViewItems.Add(lvItem);
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayPageText 2: {0}", ex.Message));
                    }
                }

                if (lvItem != null)
                {
                    lvItem.ForeColor = Color.Blue;

                    // URL -------------------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[ColUrl].ForeColor = Color.Green;
                    }
                    else
                    {
                        lvItem.SubItems[ColUrl].ForeColor = Color.Gray;
                    }

                    // Page Locale -----------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[ColLocale].ForeColor = Color.Green;
                    }
                    else
                    {
                        lvItem.SubItems[ColLocale].ForeColor = Color.Gray;
                    }

                    // Page Language ---------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Green;
                        lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Green;

                        if (DetectedLanguage != PageLanguage)
                        {
                            lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Red;
                            lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Red;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[ColPageLanguage].ForeColor     = Color.Gray;
                        lvItem.SubItems[ColDetectedLanguage].ForeColor = Color.Gray;
                    }

                    // Word Count ------------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        if (WordCount > 0)
                        {
                            lvItem.SubItems[ColWordCount].ForeColor = Color.Green;
                        }
                        else
                        {
                            lvItem.SubItems[ColWordCount].ForeColor = Color.Red;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[ColWordCount].ForeColor = Color.Gray;
                    }
                }
            }
        }
        /**************************************************************************/

        public bool CanApplyCustomFiltersToDocument(MacroscopeDocument msDoc)
        {
            bool CanApply = true;

            if (
                (msDoc == null) ||
                (msDoc.GetIsRedirect()) ||
                (msDoc.GetStatusCode() != HttpStatusCode.OK) ||
                (!msDoc.GetIsInternal()))
            {
                CanApply = false;
            }
            else
            {
                if (
                    !(msDoc.IsDocumentType(Type: MacroscopeConstants.DocumentType.HTML) ||
                      msDoc.IsDocumentType(Type: MacroscopeConstants.DocumentType.CSS) ||
                      msDoc.IsDocumentType(Type: MacroscopeConstants.DocumentType.JAVASCRIPT) ||
                      msDoc.IsDocumentType(Type: MacroscopeConstants.DocumentType.TEXT) ||
                      msDoc.IsDocumentType(Type: MacroscopeConstants.DocumentType.XML))
                    )
                {
                    CanApply = false;
                }
                else
                {
                    switch (msDoc.GetDocumentType())
                    {
                    case MacroscopeConstants.DocumentType.HTML:
                        if (!MacroscopePreferencesManager.GetCustomFiltersApplyToHtml())
                        {
                            CanApply = false;
                        }
                        break;

                    case MacroscopeConstants.DocumentType.CSS:
                        if (!MacroscopePreferencesManager.GetCustomFiltersApplyToCss())
                        {
                            CanApply = false;
                        }
                        break;

                    case MacroscopeConstants.DocumentType.JAVASCRIPT:
                        if (!MacroscopePreferencesManager.GetCustomFiltersApplyToJavascripts())
                        {
                            CanApply = false;
                        }
                        break;

                    case MacroscopeConstants.DocumentType.TEXT:
                        if (!MacroscopePreferencesManager.GetCustomFiltersApplyToText())
                        {
                            CanApply = false;
                        }
                        break;

                    case MacroscopeConstants.DocumentType.XML:
                        if (!MacroscopePreferencesManager.GetCustomFiltersApplyToXml())
                        {
                            CanApply = false;
                        }
                        break;

                    default:
                        break;
                    }
                }
            }

            return(CanApply);
        }
Esempio n. 7
0
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            bool Proceed = false;

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.SITEMAPXML:
                Proceed = true;
                break;

            case MacroscopeConstants.DocumentType.SITEMAPTEXT:
                Proceed = true;
                break;

            default:
                break;
            }

            if (!Proceed)
            {
                return;
            }

            string PairKey = string.Join("", Url);

            ListViewItem lvItem = null;
            int          Count  = msDoc.CountOutlinks();

            if (this.DisplayListView.Items.ContainsKey(PairKey))
            {
                try
                {
                    lvItem = this.DisplayListView.Items[PairKey];
                    lvItem.SubItems[0].Text = Url;
                    lvItem.SubItems[1].Text = Count.ToString();
                }
                catch (Exception ex)
                {
                    DebugMsg(string.Format("MacroscopeDisplaySitemaps 1: {0}", ex.Message));
                }
            }
            else
            {
                try
                {
                    lvItem = new ListViewItem(PairKey);
                    lvItem.UseItemStyleForSubItems = false;
                    lvItem.Name = PairKey;

                    lvItem.SubItems[0].Text = Url;
                    lvItem.SubItems.Add(Count.ToString());

                    ListViewItems.Add(lvItem);
                }
                catch (Exception ex)
                {
                    DebugMsg(string.Format("MacroscopeDisplaySitemaps 2: {0}", ex.Message));
                }
            }

            if (lvItem != null)
            {
                lvItem.ForeColor = Color.Blue;

                if (msDoc.GetIsInternal())
                {
                    lvItem.SubItems[0].ForeColor = Color.Green;
                    if (Count <= 0)
                    {
                        lvItem.SubItems[0].ForeColor = Color.Red;
                        lvItem.SubItems[1].ForeColor = Color.Red;
                    }
                }
                else
                {
                    lvItem.SubItems[0].ForeColor = Color.Gray;
                }
            }
        }
        /**************************************************************************/

        protected override void RenderListView(
            List <ListViewItem> ListViewItems,
            MacroscopeDocumentCollection DocCollection,
            MacroscopeDocument msDoc,
            string Url
            )
        {
            bool Proceed = false;

            if (msDoc.GetIsExternal())
            {
                return;
            }

            if (msDoc.GetIsRedirect())
            {
                return;
            }

            switch (msDoc.GetDocumentType())
            {
            case MacroscopeConstants.DocumentType.HTML:
                Proceed = true;
                break;

            case MacroscopeConstants.DocumentType.PDF:
                Proceed = true;
                break;

            default:
                break;
            }

            if (Proceed)
            {
                string PageLanguage     = msDoc.GetIsoLanguageCode();
                string DetectedLanguage = msDoc.GetTitleLanguage();
                string Text             = msDoc.GetTitle();
                string TextLabel        = Text;
                int    TextOccurences   = 0;
                int    TextLength       = Text.Length;
                int    TextPixelWidth   = msDoc.GetTitlePixelWidth();

                string PairKey = string.Join(":", UrlToDigest(Url), UrlToDigest(Text));

                ListViewItem lvItem = null;

                if (string.IsNullOrEmpty(PageLanguage))
                {
                    PageLanguage = "";
                }

                if (string.IsNullOrEmpty(DetectedLanguage))
                {
                    DetectedLanguage = "";
                }

                if (TextLength > 0)
                {
                    TextOccurences = DocCollection.GetStatsTitleCount(msDoc: msDoc);
                }
                else
                {
                    TextLabel = "MISSING";
                }

                if (this.DisplayListView.Items.ContainsKey(PairKey))
                {
                    try
                    {
                        lvItem = this.DisplayListView.Items[PairKey];

                        lvItem.SubItems[COL_URL].Text               = Url;
                        lvItem.SubItems[COL_PAGE_LANGUAGE].Text     = PageLanguage;
                        lvItem.SubItems[COL_DETECTED_LANGUAGE].Text = DetectedLanguage;
                        lvItem.SubItems[COL_OCCURENCES].Text        = TextOccurences.ToString();
                        lvItem.SubItems[COL_TITLE_TEXT].Text        = TextLabel;
                        lvItem.SubItems[COL_LENGTH].Text            = TextLength.ToString();
                        lvItem.SubItems[COL_PIXEL_WIDTH].Text       = TextPixelWidth.ToString();
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayTitles 1: {0}", ex.Message));
                    }
                }
                else
                {
                    try
                    {
                        lvItem = new ListViewItem(PairKey);
                        lvItem.UseItemStyleForSubItems = false;
                        lvItem.Name = PairKey;

                        lvItem.SubItems[COL_URL].Text = Url;
                        lvItem.SubItems.Add(PageLanguage);
                        lvItem.SubItems.Add(DetectedLanguage);
                        lvItem.SubItems.Add(TextOccurences.ToString());
                        lvItem.SubItems.Add(TextLabel);
                        lvItem.SubItems.Add(TextLength.ToString());
                        lvItem.SubItems.Add(TextPixelWidth.ToString());

                        ListViewItems.Add(lvItem);
                    }
                    catch (Exception ex)
                    {
                        DebugMsg(string.Format("MacroscopeDisplayTitles 2: {0}", ex.Message));
                    }
                }

                if (lvItem != null)
                {
                    lvItem.ForeColor = Color.Blue;

                    // URL -------------------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[COL_URL].ForeColor = Color.Green;
                    }
                    else
                    {
                        lvItem.SubItems[COL_URL].ForeColor = Color.Gray;
                    }

                    // Title Language --------------------------------------------------//

                    if (msDoc.GetIsInternal())
                    {
                        lvItem.SubItems[COL_PAGE_LANGUAGE].ForeColor     = Color.Green;
                        lvItem.SubItems[COL_DETECTED_LANGUAGE].ForeColor = Color.Green;

                        if (DetectedLanguage != PageLanguage)
                        {
                            lvItem.SubItems[COL_PAGE_LANGUAGE].ForeColor     = Color.Red;
                            lvItem.SubItems[COL_DETECTED_LANGUAGE].ForeColor = Color.Red;
                        }
                    }
                    else
                    {
                        lvItem.SubItems[COL_PAGE_LANGUAGE].ForeColor     = Color.Gray;
                        lvItem.SubItems[COL_DETECTED_LANGUAGE].ForeColor = Color.Gray;
                    }

                    // Check Missing Title ---------------------------------------------//

                    if (TextLength <= 0)
                    {
                        lvItem.SubItems[COL_TITLE_TEXT].Text      = "MISSING";
                        lvItem.SubItems[COL_TITLE_TEXT].ForeColor = Color.Red;
                    }
                    else
                    if (TextLength < MacroscopePreferencesManager.GetTitleMinLen())
                    {
                        lvItem.SubItems[COL_TITLE_TEXT].ForeColor = Color.Red;
                    }
                    else
                    if (TextLength > MacroscopePreferencesManager.GetTitleMaxLen())
                    {
                        lvItem.SubItems[COL_TITLE_TEXT].ForeColor = Color.Red;
                    }
                    else
                    {
                        lvItem.SubItems[COL_TITLE_TEXT].ForeColor = Color.Green;
                    }

                    // Check Title Length ----------------------------------------------//

                    if (TextLength < MacroscopePreferencesManager.GetTitleMinLen())
                    {
                        lvItem.SubItems[COL_LENGTH].ForeColor = Color.Red;
                    }
                    else
                    if (TextLength > MacroscopePreferencesManager.GetTitleMaxLen())
                    {
                        lvItem.SubItems[COL_LENGTH].ForeColor = Color.Red;
                    }
                    else
                    {
                        lvItem.SubItems[COL_LENGTH].ForeColor = Color.Green;
                    }

                    // Check Pixel Width -----------------------------------------------//

                    if (TextPixelWidth > MacroscopePreferencesManager.GetTitleMaxPixelWidth())
                    {
                        lvItem.SubItems[COL_PIXEL_WIDTH].ForeColor = Color.Red;
                    }
                    else
                    if (TextPixelWidth >= (MacroscopePreferencesManager.GetTitleMaxPixelWidth() - 20))
                    {
                        lvItem.SubItems[COL_PIXEL_WIDTH].ForeColor = Color.Goldenrod;
                    }
                    else
                    if (TextPixelWidth <= 0)
                    {
                        lvItem.SubItems[COL_PIXEL_WIDTH].ForeColor = Color.Orange;
                    }
                    else
                    {
                        lvItem.SubItems[COL_PIXEL_WIDTH].ForeColor = Color.Green;
                    }
                }
            }
        }