-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathDeleteRemote.cs
43 lines (36 loc) · 1.03 KB
/
DeleteRemote.cs
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 DeleteRemote : Popup
{
public Models.Remote Remote
{
get;
private set;
}
public DeleteRemote(Repository repo, Models.Remote remote)
{
_repo = repo;
Remote = remote;
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Deleting remote ...";
var log = _repo.CreateLog("Delete Remote");
Use(log);
return Task.Run(() =>
{
var succ = new Commands.Remote(_repo.FullPath).Use(log).Delete(Remote.Name);
log.Complete();
CallUIThread(() =>
{
_repo.MarkBranchesDirtyManually();
_repo.SetWatcherEnabled(true);
});
return succ;
});
}
private readonly Repository _repo = null;
}
}