void OnRemoveConfiguration(object sender, EventArgs args) { Gtk.TreeModel foo; Gtk.TreeIter iter; if (!configsList.Selection.GetSelected(out foo, out iter)) { return; } if (configData.Configurations.Count == 1) { MessageService.ShowWarning(GettextCatalog.GetString("There must be at least one configuration.")); return; } var cc = (ItemConfiguration)store.GetValue(iter, 0); var dlg = new DeleteConfigDialog(); try { if (MessageService.RunCustomDialog(dlg, Toplevel as Gtk.Window) == (int)Gtk.ResponseType.Yes) { configData.RemoveConfiguration(cc.Id, dlg.DeleteChildren); store.Remove(ref iter); } } finally { dlg.Destroy(); dlg.Dispose(); } }