/**************************************************************************/ private void RenderListViewSitemapErrors(MacroscopeDocumentCollection DocCollection) { List <ListViewItem> ListViewItems = new List <ListViewItem>(1); List <Dictionary <string, string> > CompiledTable = DocCollection.GetSitemapErrorsAsTable(); foreach (Dictionary <string, string> Entry in CompiledTable) { string SitemapUrl = Entry["sitemap_url"]; string StatusCode = Entry["status_code"]; string Robots = Entry["robots"]; string TargetUrl = Entry["target_url"]; string PairKey = string.Join("::::::::", SitemapUrl, TargetUrl); MacroscopeDocument msDoc = DocCollection.GetDocumentByUrl(Url: SitemapUrl); MacroscopeDocument msDocLinked = DocCollection.GetDocumentByUrl(Url: TargetUrl); ListViewItem lvItem = null; if (this.DisplayListView.Items.ContainsKey(PairKey)) { try { lvItem = this.DisplayListView.Items[PairKey]; lvItem.SubItems[0].Text = SitemapUrl; lvItem.SubItems[1].Text = StatusCode; lvItem.SubItems[2].Text = Robots; lvItem.SubItems[3].Text = TargetUrl; } catch (Exception ex) { DebugMsg(string.Format("RenderListViewSitemapErrors 1: {0}", ex.Message)); } } else { try { lvItem = new ListViewItem(PairKey); lvItem.UseItemStyleForSubItems = false; lvItem.Name = PairKey; lvItem.SubItems[0].Text = SitemapUrl; lvItem.SubItems.Add(StatusCode); lvItem.SubItems.Add(Robots); lvItem.SubItems.Add(TargetUrl); ListViewItems.Add(lvItem); } catch (Exception ex) { DebugMsg(string.Format("RenderListViewSitemapErrors 2: {0}", ex.Message)); } } if (lvItem != null) { lvItem.ForeColor = Color.Blue; if (msDoc.GetIsInternal()) { lvItem.SubItems[0].ForeColor = Color.Green; } else { lvItem.SubItems[0].ForeColor = Color.Gray; } if (!msDocLinked.GetAllowedByRobots()) { lvItem.SubItems[2].ForeColor = Color.Red; } else { lvItem.SubItems[2].ForeColor = Color.Green; } if (msDocLinked.GetIsInternal()) { lvItem.SubItems[3].ForeColor = Color.Green; } } else { lvItem.SubItems[3].ForeColor = Color.Gray; } } this.DisplayListView.Items.AddRange(ListViewItems.ToArray()); return; }