private void listView2_DoubleClick(object sender, EventArgs e) { iPhoneBackup backup = currentBackup; iPhoneFile file = (iPhoneFile)listView2.FocusedItem.Tag; string ext = ""; if (files92 == null) { ext = ".mddata"; } string argument = @"/select, """ + Path.Combine(backup.path, file.Key + ext) + @""""; System.Diagnostics.Process.Start("explorer.exe", argument); }
private void toolStripButton4_Click(object sender, EventArgs e) { string filename; string dest_root; string dest; string ext = (files92 == null) ? ".mddata" : ""; iPhoneBackup backup = currentBackup; iPhoneApp app = listView1.FocusedItem.Tag as iPhoneApp; if (backup == null || app == null) { return; } dest_root = dest = Path.Combine(@"C:\temp", backup.DeviceName, app.Key); foreach (ListViewItem i in listView2.SelectedItems) { iPhoneFile f = i.Tag as iPhoneFile; if (f != null) { filename = Path.Combine(backup.path, f.Key + ext); dest = Path.Combine(dest_root, f.Path); dest = dest.Normalize(NormalizationForm.FormC); StringBuilder sb = new StringBuilder(dest.Length); char[] ss = Path.GetInvalidPathChars(); Array.Sort(ss); foreach (char c in dest) { //System.IO.Path.GetInvalidFileNameChars() if (c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar) { sb.Append(Path.DirectorySeparatorChar); } else if (c == Path.VolumeSeparatorChar) { sb.Append(c); } else if (Array.BinarySearch(ss, c) >= 0) { sb.Append('_'); } else { sb.Append(c); } } dest = sb.ToString(); dest = dest.Replace(':', '_'); dest = dest.Replace(@"C_\temp", @"C:\temp"); Directory.CreateDirectory(Path.GetDirectoryName(dest)); File.Copy(filename, dest, true); } } }
private void listView1_Click(object sender, EventArgs e) { listView2.Items.Clear(); buttonCSVExport.Enabled = true; listView2.BeginUpdate(); Cursor.Current = Cursors.WaitCursor; try { foreach (ListViewItem item in listView1.SelectedItems) { iPhoneApp app = (iPhoneApp)item.Tag; if (app.Files == null) { break; } ListViewItem[] lvic = new ListViewItem[app.Files.Count]; int idx = 0; foreach (string f in app.Files) { iPhoneFile ff; ff = new iPhoneFile(); mbdb.MBFileRecord x = files92[Int32.Parse(f)]; ff.Key = x.key; ff.Domain = x.Domain; ff.Path = x.Path; ff.ModificationTime = x.aTime; ff.FileLength = x.FileLength; ListViewItem lvi = new ListViewItem(); lvi.Tag = ff; lvi.Text = ff.Path; lvi.SubItems.Add(ff.FileLength.ToString("N0")); lvi.SubItems.Add(ff.ModificationTime.ToString()); lvi.SubItems.Add(ff.Domain); lvi.SubItems.Add(ff.Key); lvi.SubItems[1].Tag = (long)ff.FileLength; lvi.SubItems[2].Tag = (long)ff.ModificationTime.ToBinary(); lvic[idx++] = lvi; } listView2.Items.AddRange(lvic); } } finally { listView2.EndUpdate(); Cursor.Current = Cursors.Default; } toolStripButton4.Enabled = (listView2.Items.Count > 0); }
private void listView1_Click(object sender, EventArgs e) { listView2.Items.Clear(); buttonCSVExport.Enabled = true; listView2.BeginUpdate(); Cursor.Current = Cursors.WaitCursor; try { foreach (ListViewItem item in listView1.SelectedItems) { iPhoneApp app = (iPhoneApp)item.Tag; if (app.Files == null) break; ListViewItem[] lvic = new ListViewItem[app.Files.Count]; int idx = 0; foreach (string f in app.Files) { iPhoneFile ff; ff = new iPhoneFile(); mbdb.MBFileRecord x = files92[Int32.Parse(f)]; ff.Key = x.key; ff.Domain = x.Domain; ff.Path = x.Path; ff.ModificationTime = x.aTime; ff.FileLength = x.FileLength; ListViewItem lvi = new ListViewItem(); lvi.Tag = ff; lvi.Text = ff.Path; lvi.SubItems.Add(ff.FileLength.ToString("N0")); lvi.SubItems.Add(ff.ModificationTime.ToString()); lvi.SubItems.Add(ff.Domain); lvi.SubItems.Add(ff.Key); lvi.SubItems[1].Tag = (long)ff.FileLength; lvi.SubItems[2].Tag = (long)ff.ModificationTime.ToBinary(); lvic[idx++] = lvi; } listView2.Items.AddRange(lvic); } } finally { listView2.EndUpdate(); Cursor.Current = Cursors.Default; } toolStripButton4.Enabled = (listView2.Items.Count > 0); }