Implement resource deletion.
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user