style: add .editorconfig for code formatting. see issu #25

This commit is contained in:
leo 2024-03-18 09:37:06 +08:00
parent a8eeea4f78
commit 18aaa0a143
225 changed files with 7781 additions and 3911 deletions

View file

@ -1,29 +1,36 @@
using System.Threading.Tasks;
namespace SourceGit.ViewModels {
public class DeleteTag : Popup {
public Models.Tag Target {
namespace SourceGit.ViewModels
{
public class DeleteTag : Popup
{
public Models.Tag Target
{
get;
private set;
}
public bool ShouldPushToRemote {
public bool ShouldPushToRemote
{
get;
set;
}
public DeleteTag(Repository repo, Models.Tag tag) {
public DeleteTag(Repository repo, Models.Tag tag)
{
_repo = repo;
Target = tag;
ShouldPushToRemote = true;
View = new Views.DeleteTag() { DataContext = this };
}
public override Task<bool> Sure() {
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Deleting tag '{Target.Name}' ...";
return Task.Run(() => {
return Task.Run(() =>
{
var remotes = ShouldPushToRemote ? _repo.Remotes : null;
var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes);
CallUIThread(() => _repo.SetWatcherEnabled(true));
@ -31,6 +38,6 @@ namespace SourceGit.ViewModels {
});
}
private Repository _repo = null;
private readonly Repository _repo = null;
}
}
}