forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLFSTrackCustomPattern.cs
More file actions
43 lines (37 loc) · 1.16 KB
/
Copy pathLFSTrackCustomPattern.cs
File metadata and controls
43 lines (37 loc) · 1.16 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.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class LFSTrackCustomPattern : Popup
{
[Required(ErrorMessage = "LFS track pattern is required!!!")]
public string Pattern
{
get => _pattern;
set => SetProperty(ref _pattern, value, true);
}
public bool IsFilename
{
get;
set;
} = false;
public LFSTrackCustomPattern(Repository repo)
{
_repo = repo;
View = new Views.LFSTrackCustomPattern() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Adding custom LFS tracking pattern ...";
return Task.Run(() =>
{
var succ = new Commands.LFS(_repo.FullPath).Track(_pattern, IsFilename);
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
}
private readonly Repository _repo = null;
private string _pattern = string.Empty;
}
}