forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeleteRemote.cs
More file actions
39 lines (34 loc) · 1000 Bytes
/
Copy pathDeleteRemote.cs
File metadata and controls
39 lines (34 loc) · 1000 Bytes
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
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;
View = new Views.DeleteRemote() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Deleting remote ...";
return Task.Run(() =>
{
var succ = new Commands.Remote(_repo.FullPath).Delete(Remote.Name);
CallUIThread(() =>
{
_repo.MarkBranchesDirtyManually();
_repo.SetWatcherEnabled(true);
});
return succ;
});
}
private readonly Repository _repo = null;
}
}