/// <summary> /// Select a backup path /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openToolStripMenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog from = new FolderBrowserDialog(); from.Description = "Select a iDevice backup to inspect"; from.SelectedPath = IPhoneBackup.DefaultPath; DialogResult result = from.ShowDialog(this); if (result == DialogResult.OK) { IPhoneBackup[] backups = IPhoneBackup.Load(from.SelectedPath); if (backups.Length < 1) { MessageBox.Show("No backups found!"); } else { changeBackupToolStripMenuItem.DropDownItems.Clear(); ToolStripItem[] items = PopulateBackupChangeList(backups); changeBackupToolStripMenuItem.DropDownItems.AddRange(items); SelectBackupForm form = new SelectBackupForm(backups.ToArray()); form.ShowDialog(this); if (form.Selected != null) { SelectBackup(form.Selected); } } } }
private void Form1_Load(object sender, EventArgs e) { folderList.Columns.Add("Display Name", 200); folderList.Columns.Add("Files"); fileList.Columns.Add("Name", 300); fileList.Columns.Add("Size"); fileList.Columns.Add("Date", 130); fileList.Columns.Add("Domain", 300); fileList.Columns.Add("Key", 250); lvwColumnSorter = new ListViewColumnSorter(); fileList.ListViewItemSorter = lvwColumnSorter; IPhoneBackup[] backups = IPhoneBackup.Load(IPhoneBackup.DefaultPath); ToolStripItem[] items = PopulateBackupChangeList(backups); changeBackupToolStripMenuItem.DropDownItems.AddRange(items); SelectBackup(backups.FirstOrDefault()); }