forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeleteTag.cs
More file actions
43 lines (37 loc) · 1.06 KB
/
Copy pathDeleteTag.cs
File metadata and controls
43 lines (37 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class DeleteTag : Popup
{
public Models.Tag Target
{
get;
private set;
}
public bool ShouldPushToRemote
{
get;
set;
}
public DeleteTag(Repository repo, Models.Tag tag)
{
_repo = repo;
Target = tag;
ShouldPushToRemote = true;
View = new Views.DeleteTag() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Deleting tag '{Target.Name}' ...";
return Task.Run(() =>
{
var remotes = ShouldPushToRemote ? _repo.Remotes : null;
var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes);
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
}
private readonly Repository _repo = null;
}
}