void Btn_PackageDown_Click(object sender, RoutedEventArgs e) { int i = PackageList.SelectedIndex; string f = (PackageList.Items[i] as ListViewItem).Content as string; PackageList.Items.RemoveAt(i); PackageList.Items.Insert(i + 1, makeListItem(f)); PackageList.SelectedIndex = i + 1; PackageList.Focus(); saveConfiguration(); }
void Btn_EditPackage_Click(object sender, RoutedEventArgs e) { int i = PackageList.SelectedIndex; var open = new Microsoft.Win32.OpenFileDialog(); open.Filter = "Spore packages|*.package"; open.FileName = PackageList.SelectedItem as string; open.RestoreDirectory = true; if (open.ShowDialog(this) == true) { PackageList.Items.RemoveAt(i); PackageList.Items.Insert(i, makeListItem(open.FileName)); PackageList.SelectedIndex = i; PackageList.Focus(); } saveConfiguration(); }