mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
code_style: run dotnet format
to apply code style rules
This commit is contained in:
parent
0ba58a6e9b
commit
e5462f0086
15 changed files with 50 additions and 50 deletions
|
@ -50,9 +50,9 @@ namespace SourceGit
|
|||
}
|
||||
|
||||
[JsonSourceGenerationOptions(
|
||||
WriteIndented = true,
|
||||
IgnoreReadOnlyFields = true,
|
||||
IgnoreReadOnlyProperties = true,
|
||||
WriteIndented = true,
|
||||
IgnoreReadOnlyFields = true,
|
||||
IgnoreReadOnlyProperties = true,
|
||||
Converters = [
|
||||
typeof(ColorConverter),
|
||||
typeof(FontFamilyConverter),
|
||||
|
|
|
@ -458,7 +458,7 @@ namespace SourceGit
|
|||
var args = desktop.Args;
|
||||
if (args.Length != 1 || !args[0].StartsWith("Enter passphrase", StringComparison.Ordinal))
|
||||
return false;
|
||||
|
||||
|
||||
desktop.MainWindow = new Views.Askpass(args[0]);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace SourceGit.Commands
|
|||
var rs = cmd.ReadToEnd();
|
||||
if (rs.IsSuccess)
|
||||
{
|
||||
var lines = rs.StdOut.Split(new char[] {'\n', '\r'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
var lines = rs.StdOut.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var match = REG_LOCK().Match(line);
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace SourceGit.Converters
|
|||
|
||||
public static readonly FuncValueConverter<int, bool> IsSubjectLengthBad =
|
||||
new FuncValueConverter<int, bool>(v => v > ViewModels.Preference.Instance.SubjectGuideLength);
|
||||
|
||||
|
||||
public static readonly FuncValueConverter<int, bool> IsSubjectLengthGood =
|
||||
new FuncValueConverter<int, bool>(v => v <= ViewModels.Preference.Instance.SubjectGuideLength);
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace SourceGit.Models
|
|||
public bool IsMerged { get; set; } = false;
|
||||
public Thickness Margin { get; set; } = new Thickness(0);
|
||||
|
||||
|
||||
public string AuthorTimeStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||
public string CommitterTimeStr => DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||
public string AuthorTimeShortStr => DateTime.UnixEpoch.AddSeconds(AuthorTime).ToLocalTime().ToString("yyyy/MM/dd");
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace SourceGit.Models
|
|||
|
||||
if (Branch.StartsWith("refs/heads/", System.StringComparison.Ordinal))
|
||||
return $"({Branch.Substring(11)})";
|
||||
|
||||
|
||||
if (Branch.StartsWith("refs/remotes/", System.StringComparison.Ordinal))
|
||||
return $"({Branch.Substring(13)})";
|
||||
|
||||
|
|
|
@ -18,19 +18,19 @@ namespace SourceGit.ViewModels
|
|||
public bool IsFiltered { get; set; } = false;
|
||||
public bool IsSelected { get; set; } = false;
|
||||
public List<BranchTreeNode> Children { get; private set; } = new List<BranchTreeNode>();
|
||||
|
||||
|
||||
public bool IsExpanded
|
||||
{
|
||||
get => _isExpanded;
|
||||
set => SetProperty(ref _isExpanded, value);
|
||||
}
|
||||
|
||||
|
||||
public CornerRadius CornerRadius
|
||||
{
|
||||
get => _cornerRadius;
|
||||
set => SetProperty(ref _cornerRadius, value);
|
||||
}
|
||||
|
||||
|
||||
public bool IsBranch
|
||||
{
|
||||
get => Backend is Models.Branch;
|
||||
|
@ -55,7 +55,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
get => Backend is Models.Branch b ? b.FriendlyName : null;
|
||||
}
|
||||
|
||||
|
||||
private bool _isExpanded = false;
|
||||
private CornerRadius _cornerRadius = new CornerRadius(4);
|
||||
|
||||
|
@ -118,11 +118,11 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (node.Backend is Models.Branch)
|
||||
continue;
|
||||
|
||||
|
||||
var path = prefix + "/" + node.Name;
|
||||
if (node.IsExpanded)
|
||||
_expanded.Add(path);
|
||||
|
||||
|
||||
CollectExpandedNodes(node.Children, path);
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
if (l.Backend is Models.Branch)
|
||||
return r.Backend is Models.Branch ? string.Compare(l.Name, r.Name, StringComparison.Ordinal) : 1;
|
||||
|
||||
|
||||
return r.Backend is Models.Branch ? -1 : string.Compare(l.Name, r.Name, StringComparison.Ordinal);
|
||||
});
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
Pages = new AvaloniaList<LauncherPage>();
|
||||
AddNewTab();
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(startupRepo))
|
||||
{
|
||||
var root = new Commands.QueryRepositoryRootPath(startupRepo).Result();
|
||||
|
@ -272,8 +272,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void DispatchNotification(string pageId, string message, bool isError)
|
||||
{
|
||||
var notification = new Notification() {
|
||||
IsError = isError,
|
||||
var notification = new Notification()
|
||||
{
|
||||
IsError = isError,
|
||||
Message = message,
|
||||
};
|
||||
|
||||
|
|
|
@ -496,7 +496,7 @@ namespace SourceGit.ViewModels
|
|||
private bool _restoreTabs = false;
|
||||
private bool _useFixedTabWidth = true;
|
||||
private bool _check4UpdatesOnStartup = true;
|
||||
|
||||
|
||||
private bool _useTwoColumnsLayoutInHistories = false;
|
||||
private bool _useSideBySideDiff = false;
|
||||
private bool _useSyntaxHighlighting = false;
|
||||
|
|
|
@ -644,7 +644,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
lfs.Items.Add(new MenuItem() { Header = "-" });
|
||||
}
|
||||
}
|
||||
|
||||
var lfsLock = new MenuItem();
|
||||
lfsLock.Header = App.Text("GitLFS.Locks.Lock");
|
||||
|
@ -678,7 +678,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
lfsLock.Items.Add(lockRemote);
|
||||
}
|
||||
}
|
||||
}
|
||||
lfs.Items.Add(lfsLock);
|
||||
|
||||
var lfsUnlock = new MenuItem();
|
||||
|
@ -713,7 +713,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
lfsUnlock.Items.Add(unlockRemote);
|
||||
}
|
||||
}
|
||||
}
|
||||
lfs.Items.Add(lfsUnlock);
|
||||
|
||||
menu.Items.Add(lfs);
|
||||
|
@ -1005,7 +1005,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
lfsLock.Items.Add(lockRemote);
|
||||
}
|
||||
}
|
||||
}
|
||||
lfs.Items.Add(lfsLock);
|
||||
|
||||
var lfsUnlock = new MenuItem();
|
||||
|
@ -1040,7 +1040,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
lfsUnlock.Items.Add(unlockRemote);
|
||||
}
|
||||
}
|
||||
}
|
||||
lfs.Items.Add(lfsUnlock);
|
||||
|
||||
menu.Items.Add(lfs);
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace SourceGit.Views
|
|||
get => GetValue(NodeProperty);
|
||||
set => SetValue(NodeProperty, value);
|
||||
}
|
||||
|
||||
|
||||
public static readonly StyledProperty<bool> IsExpandedProperty =
|
||||
AvaloniaProperty.Register<BranchTreeNodeIcon, bool>(nameof(IsExpanded));
|
||||
|
||||
|
@ -51,21 +51,21 @@ namespace SourceGit.Views
|
|||
|
||||
if (node.Backend is Models.Remote)
|
||||
{
|
||||
CreateContent(12, new Thickness(0,2,0,0), "Icons.Remote");
|
||||
CreateContent(12, new Thickness(0, 2, 0, 0), "Icons.Remote");
|
||||
}
|
||||
else if (node.Backend is Models.Branch branch)
|
||||
{
|
||||
if (branch.IsCurrent)
|
||||
CreateContent(12, new Thickness(0,2,0,0), "Icons.Check");
|
||||
CreateContent(12, new Thickness(0, 2, 0, 0), "Icons.Check");
|
||||
else
|
||||
CreateContent(12, new Thickness(2,0,0,0), "Icons.Branch");
|
||||
CreateContent(12, new Thickness(2, 0, 0, 0), "Icons.Branch");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.IsExpanded)
|
||||
CreateContent(10, new Thickness(0,2,0,0), "Icons.Folder.Open");
|
||||
CreateContent(10, new Thickness(0, 2, 0, 0), "Icons.Folder.Open");
|
||||
else
|
||||
CreateContent(10, new Thickness(0,2,0,0), "Icons.Folder.Fill");
|
||||
CreateContent(10, new Thickness(0, 2, 0, 0), "Icons.Folder.Fill");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ namespace SourceGit.Views
|
|||
var geo = this.FindResource(iconKey) as StreamGeometry;
|
||||
if (geo == null)
|
||||
return;
|
||||
|
||||
|
||||
Content = new Path()
|
||||
{
|
||||
Width = size,
|
||||
|
@ -86,7 +86,7 @@ namespace SourceGit.Views
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public partial class BranchTree : UserControl
|
||||
{
|
||||
public static readonly StyledProperty<List<ViewModels.BranchTreeNode>> NodesProperty =
|
||||
|
@ -103,7 +103,7 @@ namespace SourceGit.Views
|
|||
get;
|
||||
private set;
|
||||
} = new AvaloniaList<ViewModels.BranchTreeNode>();
|
||||
|
||||
|
||||
public static readonly RoutedEvent<RoutedEventArgs> SelectionChangedEvent =
|
||||
RoutedEvent.Register<BranchTree, RoutedEventArgs>(nameof(SelectionChanged), RoutingStrategies.Tunnel | RoutingStrategies.Bubble);
|
||||
|
||||
|
@ -180,7 +180,7 @@ namespace SourceGit.Views
|
|||
if (item is ViewModels.BranchTreeNode node)
|
||||
node.IsSelected = false;
|
||||
}
|
||||
|
||||
|
||||
var selected = BranchesPresenter.SelectedItems;
|
||||
if (selected == null || selected.Count == 0)
|
||||
return;
|
||||
|
@ -207,16 +207,16 @@ namespace SourceGit.Views
|
|||
|
||||
prev = row;
|
||||
}
|
||||
|
||||
|
||||
RaiseEvent(new RoutedEventArgs(SelectionChangedEvent));
|
||||
}
|
||||
|
||||
|
||||
private void OnTreeContextRequested(object _1, ContextRequestedEventArgs _2)
|
||||
{
|
||||
var repo = DataContext as ViewModels.Repository;
|
||||
if (repo?.Settings == null)
|
||||
return;
|
||||
|
||||
|
||||
var selected = BranchesPresenter.SelectedItems;
|
||||
if (selected == null || selected.Count == 0)
|
||||
return;
|
||||
|
@ -280,7 +280,7 @@ namespace SourceGit.Views
|
|||
var idx = rows.IndexOf(node);
|
||||
if (idx == -1)
|
||||
return;
|
||||
|
||||
|
||||
if (node.IsExpanded)
|
||||
{
|
||||
var subtree = new List<ViewModels.BranchTreeNode>();
|
||||
|
@ -305,7 +305,7 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnToggleFilter(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ToggleButton toggle && DataContext is ViewModels.Repository repo)
|
||||
|
@ -316,7 +316,7 @@ namespace SourceGit.Views
|
|||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void MakeRows(List<ViewModels.BranchTreeNode> rows, List<ViewModels.BranchTreeNode> nodes, int depth)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
|
@ -326,7 +326,7 @@ namespace SourceGit.Views
|
|||
|
||||
if (!node.IsExpanded || node.Backend is Models.Branch)
|
||||
continue;
|
||||
|
||||
|
||||
MakeRows(rows, node.Children, depth + 1);
|
||||
}
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ namespace SourceGit.Views
|
|||
outs.Add(branch);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
foreach (var sub in node.Children)
|
||||
CollectBranchesInNode(outs, sub);
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace SourceGit.Views
|
|||
Cursor = new Cursor(StandardCursorType.SizeWestEast);
|
||||
e.Pointer.Capture(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
||||
|
@ -163,7 +163,7 @@ namespace SourceGit.Views
|
|||
_lastInSlider = false;
|
||||
Cursor = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace SourceGit.Views
|
|||
Close();
|
||||
}
|
||||
|
||||
private void OnMoveItemUp(object sender, RoutedEventArgs e)
|
||||
private void OnMoveItemUp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Control control && DataContext is ViewModels.InteractiveRebase vm)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
private void OnDataGridKeyDown(object sender, KeyEventArgs e)
|
||||
private void OnDataGridKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
var datagrid = sender as DataGrid;
|
||||
var item = datagrid.SelectedItem as ViewModels.InteractiveRebaseItem;
|
||||
|
|
|
@ -182,7 +182,7 @@ namespace SourceGit.Views
|
|||
private void EndMoveWindow(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
_pressedTitleBar = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPopupSure(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace SourceGit.Views
|
|||
|
||||
private void OnSearchCommitPanelPropertyChanged(object sender, AvaloniaPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.Property == IsVisibleProperty && sender is Grid { IsVisible: true})
|
||||
if (e.Property == IsVisibleProperty && sender is Grid { IsVisible: true })
|
||||
txtSearchCommitsBox.Focus();
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace SourceGit.Views
|
|||
{
|
||||
repo.NavigateToCommit(commit.SHA);
|
||||
}
|
||||
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace SourceGit.Views
|
|||
remoteBranchTree.UnselectAll();
|
||||
tagsList.SelectedItem = null;
|
||||
}
|
||||
|
||||
|
||||
private void OnRemoteBranchTreeSelectionChanged(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
localBranchTree.UnselectAll();
|
||||
|
|
Loading…
Reference in a new issue