private void listViewEmpty_DoubleClick(object sender, EventArgs e) { if (this.listViewEmpty.SelectedItems.Count == 0) { return; } string strFileName = this.listViewEmpty.SelectedItems[0].SubItems[2].Text; SuperDocSearcher.OpenFile(strFileName); }
private void OpenFileToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem mi = (ToolStripMenuItem)sender; ContextMenuStrip ms = (ContextMenuStrip)mi.GetCurrentParent(); ListView curListView = (ListView)ms.SourceControl; if (curListView.SelectedItems.Count == 0) { return; } foreach (ListViewItem item in curListView.SelectedItems) { string strFileName = item.SubItems[2].Text; SuperDocSearcher.OpenFile(strFileName); } }