private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { if (listBox1.SelectedItem != null) { string file = (string)listBox1.SelectedItem; if (file.EndsWith(".dds") || file.EndsWith(".bmp")) { PictureViewer pv = new PictureViewer(file, pakfile[file]); pv.Show(); } if (file.EndsWith(".xml")) { XMLViewer xv = new XMLViewer(file, pakfile[file]); xv.Show(); } } }