void lv3_DoubleClick(object sender, EventArgs e) { ListViewItem lvi = lv3.SelectedItems[0]; ArrayList al = (ArrayList)lvi.Tag; FileInfo fi=(FileInfo)al[0]; zip.Zip.ZipFile zf=(zip.Zip.ZipFile)al[1]; zip.Zip.ZipEntry ze=(zip.Zip.ZipEntry)al[2]; string strFName = fi.FullName; string strName = ze.Name; string strParent = ""; if (strName.IndexOf("/") != -1) { string[] strNameArr = strName.Split(Encoding.Default.GetChars(Encoding.Default.GetBytes("/"))); strName = strNameArr[strNameArr.Length - 1]; for (int i = 0; i < strNameArr.Length - 2; i++) { strParent += "\\" + strNameArr[i]; } } if (isZip(strFName)) { zip.Zip.FastZip fz = new ICSharpCode.SharpZipLib.Zip.FastZip(); fz.ExtractZip(strFName, Application.UserAppDataPath + strParent, ze.Name); FileInfo[] fins = new FileInfo[1]; fins.SetValue(new FileInfo(Application.UserAppDataPath + "\\" + ze.Name), 0); PropForm pf = new PropForm(fins); pf.Show(); } }
private void listView1_DoubleClick(object sender, EventArgs e) { if (cBoxExifInfo.Enabled) { timer1.Enabled = false; ArrayList al = new ArrayList(); for (int i = 0; i < listView1.Items.Count; i++) { ListViewItem lvi = listView1.Items[i]; if (isPhoto(lvi.Text)) { FileInfo fi = new FileInfo(lvi.SubItems[1].Text + "\\" + lvi.Text); al.Add(fi); } } FileInfo[] fins = new FileInfo[al.Count]; for (int i = 0; i < al.Count; i++) { FileInfo tmpfi = (FileInfo)al[i]; fins.SetValue(tmpfi, i); } LargePictureForm lpf = new LargePictureForm(fins, listView1.SelectedItems[0].Index); lpf.Show(); } else { try { ListViewItem lvi = listView1.SelectedItems[0]; Process.Start(lvi.SubItems[1].Text + "\\" + lvi.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private FileInfo[] orderPDUFiles(FileInfo[] files) { FileInfo[] orderedFileArray = new FileInfo[files.Length]; foreach(FileInfo pduFile in files) { string pduFileName = pduFile.Name; int index = pduFileName.LastIndexOf("_"); int pduNr = 0; if(index != -1) pduNr = int.Parse(pduFileName.Substring(0,index)); orderedFileArray.SetValue(pduFile,pduNr); } return orderedFileArray; }
private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { FileInfo[] fins = new FileInfo[listView1.SelectedItems.Count]; for (int i=0;i<listView1.SelectedItems.Count;i++) { ListViewItem lvi = listView1.SelectedItems[i]; fins.SetValue(new FileInfo(lvi.SubItems[1].Text + "\\" + lvi.Text), i); /* string strText = ""; string strPath = lvi.SubItems[1].Text + "\\" + lvi.Text; if (isPhoto(strPath)) { Hashtable ht = getEXIF(strPath); foreach (DictionaryEntry de in ht) { strText += de.Key + ":" + de.Value + "\n"; } } else if (isMedia(strPath)) { Hashtable ht = getMediaInfo(strPath); foreach (DictionaryEntry de in ht) { strText += de.Key + ":" + de.Value + "\n"; } } MessageBox.Show(strText); */ } PropForm pf = new PropForm(fins); pf.Show(); }