FModel/FModel/ViewModels/Commands/DeleteDirectoryCommand.cs
Marlon 14e05da2e0
Some checks failed
FModel QA Builder / build (push) Has been cancelled
fixed line endings to lf to match editorconfig
2026-01-27 14:17:43 +01:00

22 lines
594 B
C#

using FModel.Framework;
using FModel.Settings;
namespace FModel.ViewModels.Commands;
public class DeleteDirectoryCommand : ViewModelCommand<CustomDirectoriesViewModel>
{
public DeleteDirectoryCommand(CustomDirectoriesViewModel contextViewModel) : base(contextViewModel)
{
}
public override void Execute(CustomDirectoriesViewModel contextViewModel, object parameter)
{
if (parameter is not CustomDirectory customDir) return;
var index = contextViewModel.GetIndex(customDir);
if (index < 2) return;
contextViewModel.Delete(index);
}
}