Implement resource deletion.

This commit is contained in:
2023-11-23 00:57:22 +08:00
parent 5e2fae0f14
commit 1a084e6bfb

View File

@@ -109,5 +109,17 @@ namespace Cryville.Crtr.Browsing.UI {
public void OnPathClicked(int index) { public void OnPathClicked(int index) {
_manager.ReturnToDirectory(index); _manager.ReturnToDirectory(index);
} }
public void OnDeleteClicked() {
if (_selectedItems.Count == 0) {
Popup.Create("No item is selected.");
return;
}
Dialog.Show(DeleteSelectedItems, "Are you sure to delete the selected item(s)?", "Yes", "No");
}
void DeleteSelectedItems(int result) {
if (result != 0) return;
foreach (var item in _selectedItems.OrderByDescending(i => i)) _manager.RemoveAt(item);
}
} }
} }