mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
code_style: run dotnet format
This commit is contained in:
parent
7fe1df20cc
commit
84b8735d6c
11 changed files with 23 additions and 26 deletions
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SourceGit.Commands
|
namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,13 +17,13 @@ namespace SourceGit.Models
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Job
|
public class Job
|
||||||
{
|
{
|
||||||
public Commands.Fetch Cmd = null;
|
public Commands.Fetch Cmd = null;
|
||||||
public DateTime NextRunTimepoint = DateTime.MinValue;
|
public DateTime NextRunTimepoint = DateTime.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEnabled
|
public bool IsEnabled
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
@ -36,7 +36,7 @@ namespace SourceGit.Models
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_interval = Math.Max(1, value);
|
_interval = Math.Max(1, value);
|
||||||
|
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
foreach (var job in _jobs)
|
foreach (var job in _jobs)
|
||||||
|
@ -81,7 +81,7 @@ namespace SourceGit.Models
|
||||||
|
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once FunctionNeverReturns
|
// ReSharper disable once FunctionNeverReturns
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,9 @@ namespace SourceGit.Models
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AvatarManager _instance = null;
|
private static AvatarManager _instance = null;
|
||||||
|
|
||||||
[GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@users\.noreply\.github\.com$")]
|
[GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@users\.noreply\.github\.com$")]
|
||||||
private static partial Regex REG_GITHUB_USER_EMAIL();
|
private static partial Regex REG_GITHUB_USER_EMAIL();
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace SourceGit.Models
|
||||||
private List<IAvatarHost> _avatars = new List<IAvatarHost>();
|
private List<IAvatarHost> _avatars = new List<IAvatarHost>();
|
||||||
private Dictionary<string, Bitmap> _resources = new Dictionary<string, Bitmap>();
|
private Dictionary<string, Bitmap> _resources = new Dictionary<string, Bitmap>();
|
||||||
private HashSet<string> _requesting = new HashSet<string>();
|
private HashSet<string> _requesting = new HashSet<string>();
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
_storePath = Path.Combine(Native.OS.DataDir, "avatars");
|
_storePath = Path.Combine(Native.OS.DataDir, "avatars");
|
||||||
|
@ -121,7 +121,7 @@ namespace SourceGit.Models
|
||||||
NotifyResourceChanged(email);
|
NotifyResourceChanged(email);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once FunctionNeverReturns
|
// ReSharper disable once FunctionNeverReturns
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace SourceGit.Models
|
||||||
public class ExternalToolPaths
|
public class ExternalToolPaths
|
||||||
{
|
{
|
||||||
[JsonPropertyName("tools")]
|
[JsonPropertyName("tools")]
|
||||||
public Dictionary<string, string> Tools { get; set; } = new Dictionary<string, string>();
|
public Dictionary<string, string> Tools { get; set; } = new Dictionary<string, string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExternalToolsFinder
|
public class ExternalToolsFinder
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace SourceGit.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IRawTheme GetTheme(string scopeName)
|
public IRawTheme GetTheme(string scopeName)
|
||||||
{
|
{
|
||||||
return _backend.GetTheme(scopeName);
|
return _backend.GetTheme(scopeName);
|
||||||
|
@ -74,7 +74,7 @@ namespace SourceGit.Models
|
||||||
var grammar = _extraGrammars.Find(x => x.GetScopeName().EndsWith(extension, StringComparison.OrdinalIgnoreCase));
|
var grammar = _extraGrammars.Find(x => x.GetScopeName().EndsWith(extension, StringComparison.OrdinalIgnoreCase));
|
||||||
if (grammar != null)
|
if (grammar != null)
|
||||||
return grammar.GetScopeName();
|
return grammar.GetScopeName();
|
||||||
|
|
||||||
if (extension == ".h")
|
if (extension == ".h")
|
||||||
extension = ".cpp";
|
extension = ".cpp";
|
||||||
else if (extension == ".resx" || extension == ".plist" || extension == ".manifest")
|
else if (extension == ".resx" || extension == ".plist" || extension == ".manifest")
|
||||||
|
@ -88,7 +88,7 @@ namespace SourceGit.Models
|
||||||
private readonly RegistryOptions _backend;
|
private readonly RegistryOptions _backend;
|
||||||
private readonly List<IRawGrammar> _extraGrammars;
|
private readonly List<IRawGrammar> _extraGrammars;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TextMateHelper
|
public static class TextMateHelper
|
||||||
{
|
{
|
||||||
public static TextMate.Installation CreateForEditor(TextEditor editor)
|
public static TextMate.Installation CreateForEditor(TextEditor editor)
|
||||||
|
|
|
@ -320,7 +320,7 @@ namespace SourceGit.ViewModels
|
||||||
var window = new Views.Blame() { DataContext = new Blame(_repo.FullPath, change.Path, _commit.SHA) };
|
var window = new Views.Blame() { DataContext = new Blame(_repo.FullPath, change.Path, _commit.SHA) };
|
||||||
window.Show();
|
window.Show();
|
||||||
ev.Handled = true;
|
ev.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.Items.Add(history);
|
menu.Items.Add(history);
|
||||||
menu.Items.Add(blame);
|
menu.Items.Add(blame);
|
||||||
|
@ -415,7 +415,7 @@ namespace SourceGit.ViewModels
|
||||||
window.Show();
|
window.Show();
|
||||||
ev.Handled = true;
|
ev.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
var copyPath = new MenuItem();
|
var copyPath = new MenuItem();
|
||||||
copyPath.Header = App.Text("CopyPath");
|
copyPath.Header = App.Text("CopyPath");
|
||||||
copyPath.Icon = App.CreateMenuIcon("Icons.Copy");
|
copyPath.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||||
|
|
|
@ -279,7 +279,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
if (value is null || value < 1)
|
if (value is null || value < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Models.AutoFetchManager.Instance.Interval != value)
|
if (Models.AutoFetchManager.Instance.Interval != value)
|
||||||
{
|
{
|
||||||
Models.AutoFetchManager.Instance.Interval = (int)value;
|
Models.AutoFetchManager.Instance.Interval = (int)value;
|
||||||
|
|
|
@ -1312,7 +1312,7 @@ namespace SourceGit.ViewModels
|
||||||
var succ = true;
|
var succ = true;
|
||||||
if (autoStage && _unstaged.Count > 0)
|
if (autoStage && _unstaged.Count > 0)
|
||||||
succ = new Commands.Add(_repo.FullPath).Exec();
|
succ = new Commands.Add(_repo.FullPath).Exec();
|
||||||
|
|
||||||
if (succ)
|
if (succ)
|
||||||
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec();
|
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec();
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var lineNumber = line.FirstDocumentLine.LineNumber;
|
var lineNumber = line.FirstDocumentLine.LineNumber;
|
||||||
if (lineNumber > _editor.BlameData.LineInfos.Count)
|
if (lineNumber > _editor.BlameData.LineInfos.Count)
|
||||||
break;
|
break;
|
||||||
|
@ -156,7 +156,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var lineNumber = line.FirstDocumentLine.LineNumber;
|
var lineNumber = line.FirstDocumentLine.LineNumber;
|
||||||
if (lineNumber >= _editor.BlameData.LineInfos.Count)
|
if (lineNumber >= _editor.BlameData.LineInfos.Count)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace SourceGit.Views
|
||||||
if (links.Count > 1)
|
if (links.Count > 1)
|
||||||
{
|
{
|
||||||
var menu = new ContextMenu();
|
var menu = new ContextMenu();
|
||||||
|
|
||||||
foreach (var link in links)
|
foreach (var link in links)
|
||||||
{
|
{
|
||||||
var url = $"{link.URLPrefix}{detail.Commit.SHA}";
|
var url = $"{link.URLPrefix}{detail.Commit.SHA}";
|
||||||
|
@ -69,7 +69,7 @@ namespace SourceGit.Views
|
||||||
var url = $"{links[0].URLPrefix}{detail.Commit.SHA}";
|
var url = $"{links[0].URLPrefix}{detail.Commit.SHA}";
|
||||||
Native.OS.OpenBrowser(url);
|
Native.OS.OpenBrowser(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var index = line.FirstDocumentLine.LineNumber;
|
var index = line.FirstDocumentLine.LineNumber;
|
||||||
if (index > lines.Count)
|
if (index > lines.Count)
|
||||||
break;
|
break;
|
||||||
|
@ -744,7 +744,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var index = line.FirstDocumentLine.LineNumber;
|
var index = line.FirstDocumentLine.LineNumber;
|
||||||
if (index > diff.Lines.Count)
|
if (index > diff.Lines.Count)
|
||||||
break;
|
break;
|
||||||
|
@ -926,7 +926,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var index = line.FirstDocumentLine.LineNumber;
|
var index = line.FirstDocumentLine.LineNumber;
|
||||||
if (index > lines.Count)
|
if (index > lines.Count)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue