/// <summary> /// Handles the MouseDoubleClick event of the listViewAdditionalInformation control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev07, 2009-07-16</remarks> private void listViewAdditionalInformation_MouseDoubleClick(object sender, MouseEventArgs e) { //double click opens the program associated to the selected file if (e.Button == MouseButtons.Left) { //undo the change of the checkstate (results from doubleclicking an item) listViewFiles.SelectedItems[0].Checked = !listViewFiles.SelectedItems[0].Checked; try { string name = listViewFiles.SelectedItems[0].Tag as string; string ext = Path.GetExtension(name); PreviewForm preview = new PreviewForm(ext == ".xml" || ext == ".xsl" ? PreviewType.HTML : ext == ".mlcfg" || ext == ".txt" ? PreviewType.Text : PreviewType.Image, errorReportHandler.GetEntry(content.Find(i => i.Name == name))); preview.Text = name; preview.ShowDialog(this); } catch (Exception ex) { InternalErrorHandler(ex, false); } } }