private void PopulateListViewItem(ListViewItem lvi, OutputShortcutInfo shortcut) { lvi.Tag = shortcut; bool excluded = false; string extension = ".lnk"; if (this.ProjectOutput != null) { var targetFile = shortcut.Target as OutputFileInfo; if (targetFile != null) { excluded = this.ProjectOutput.ProjectInfo.IsExcluded(targetFile.SourceFile); extension = targetFile.Extension; } } if (excluded) { lvi.ForeColor = Color.Gray; lvi.ImageIndex = this.GetFileImageIndex("$excluded"); } else { lvi.ForeColor = this.listView1.ForeColor; lvi.ImageIndex = this.GetFileImageIndex(extension); } int i = 0; this.PopulateListViewItem(lvi, i++, shortcut.Name); this.PopulateListViewItem(lvi, i++, string.Empty); this.PopulateListViewItem(lvi, i++, "Shortcut"); this.PopulateListViewItem(lvi, i++, string.Empty); this.PopulateListViewItem(lvi, i++, shortcut.Target.FullName); this.PopulateListViewItem(lvi, i++, string.Empty); }