2024-02-05 23:08:37 -08:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
namespace SourceGit.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class DropStash : Popup
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
public Models.Stash Stash { get; private set; }
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
public DropStash(string repo, Models.Stash stash)
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
_repo = repo;
|
|
|
|
|
Stash = stash;
|
|
|
|
|
View = new Views.DropStash() { DataContext = this };
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
public override Task<bool> Sure()
|
|
|
|
|
{
|
2024-02-25 19:29:57 -08:00
|
|
|
|
ProgressDescription = $"Dropping stash: {Stash.Name}";
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
return Task.Run(() =>
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
new Commands.Stash(_repo).Drop(Stash.Name);
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
|
private readonly string _repo;
|
2024-02-05 23:08:37 -08:00
|
|
|
|
}
|
2024-03-17 18:37:06 -07:00
|
|
|
|
}
|