private void ApplyHyperlinkStyle(int rowIndex, OLVListItem olvi)
{
olvi.UseItemStyleForSubItems = false;
// If subitem 0 is given a back color, the item back color is changed too.
// So we have to remember it here so we can used it even if subitem 0 is changed.
Color itemBackColor = olvi.BackColor;
for (int i = 0; i < this.Columns.Count; i++) {
OLVListSubItem subItem = olvi.GetSubItem(i);
if (subItem == null)
continue;
OLVColumn column = this.GetColumn(i);
subItem.BackColor = itemBackColor;
if (column.Hyperlink && !String.IsNullOrEmpty(subItem.Url)) {
this.ApplyCellStyle(olvi, i, this.IsUrlVisited(subItem.Url) ? this.HyperlinkStyle.Visited : this.HyperlinkStyle.Normal);
}
}
}