code_style: remove unused namespace using and run dotnet format

This commit is contained in:
leo 2024-08-28 13:42:25 +08:00
parent 4bcdd0ade4
commit 3ea80d99f1
No known key found for this signature in database
9 changed files with 10 additions and 11 deletions

View file

@ -43,7 +43,7 @@ namespace SourceGit
private Action<object> _action = null; private Action<object> _action = null;
} }
public static readonly SimpleCommand OpenPreferenceCommand = new SimpleCommand(() => OpenDialog(new Views.Preference())); public static readonly SimpleCommand OpenPreferenceCommand = new SimpleCommand(() => OpenDialog(new Views.Preference()));
public static readonly SimpleCommand OpenHotkeysCommand = new SimpleCommand(() => OpenDialog(new Views.Hotkeys())); public static readonly SimpleCommand OpenHotkeysCommand = new SimpleCommand(() => OpenDialog(new Views.Hotkeys()));
public static readonly SimpleCommand OpenAppDataDirCommand = new SimpleCommand(() => Native.OS.OpenInFileManager(Native.OS.DataDir)); public static readonly SimpleCommand OpenAppDataDirCommand = new SimpleCommand(() => Native.OS.OpenInFileManager(Native.OS.DataDir));

View file

@ -98,7 +98,7 @@ namespace SourceGit
public static void OpenDialog(Window window) public static void OpenDialog(Window window)
{ {
if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner}) if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
window.ShowDialog(owner); window.ShowDialog(owner);
} }

View file

@ -213,7 +213,7 @@ namespace SourceGit.Models
unsolved.Add(major); unsolved.Add(major);
temp.Paths.Add(major.Path); temp.Paths.Add(major.Path);
} }
colorIdx = (colorIdx + 1) % _penCount; colorIdx = (colorIdx + 1) % _penCount;
} }

View file

@ -302,7 +302,7 @@ namespace SourceGit.ViewModels
e.Handled = true; e.Handled = true;
}; };
menu.Items.Add(reset); menu.Items.Add(reset);
var squash = new MenuItem(); var squash = new MenuItem();
squash.Header = App.Text("CommitCM.SquashCommitsSinceThis"); squash.Header = App.Text("CommitCM.SquashCommitsSinceThis");
squash.Icon = App.CreateMenuIcon("Icons.SquashIntoParent"); squash.Icon = App.CreateMenuIcon("Icons.SquashIntoParent");
@ -314,7 +314,7 @@ namespace SourceGit.ViewModels
App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first."); App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first.");
return; return;
} }
if (PopupHost.CanCreatePopup()) if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Squash(_repo, commit, commit.SHA)); PopupHost.ShowPopup(new Squash(_repo, commit, commit.SHA));

View file

@ -28,7 +28,7 @@ namespace SourceGit.ViewModels
{ {
_node = new RepositoryNode() { Id = Guid.NewGuid().ToString() }; _node = new RepositoryNode() { Id = Guid.NewGuid().ToString() };
_data = Welcome.Instance; _data = Welcome.Instance;
// New welcome page will clear the search filter before. // New welcome page will clear the search filter before.
Welcome.Instance.ClearSearchFilter(); Welcome.Instance.ClearSearchFilter();
} }

View file

@ -614,7 +614,7 @@ namespace SourceGit.ViewModels
Task.Run(RefreshWorkingCopyChanges); Task.Run(RefreshWorkingCopyChanges);
Task.Run(RefreshWorktrees); Task.Run(RefreshWorktrees);
} }
else else
{ {
_watcher.MarkBranchDirtyManually(); _watcher.MarkBranchDirtyManually();

View file

@ -22,7 +22,7 @@ namespace SourceGit.ViewModels
_repo = repo; _repo = repo;
_target = target; _target = target;
_message = new Commands.QueryCommitFullMessage(_repo.FullPath, shaToGetPreferMessage).Result(); _message = new Commands.QueryCommitFullMessage(_repo.FullPath, shaToGetPreferMessage).Result();
View = new Views.Squash() { DataContext = this }; View = new Views.Squash() { DataContext = this };
} }

View file

@ -27,7 +27,7 @@ namespace SourceGit.Views
} }
catch (Exception exception) catch (Exception exception)
{ {
App.RaiseException(string.Empty, $"Failed to select location: {exception.Message}"); App.RaiseException(string.Empty, $"Failed to select location: {exception.Message}");
} }
e.Handled = true; e.Handled = true;

View file

@ -6,7 +6,6 @@ using Avalonia;
using Avalonia.Collections; using Avalonia.Collections;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Documents; using Avalonia.Controls.Documents;
using Avalonia.Controls.Primitives;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Media; using Avalonia.Media;
@ -689,7 +688,7 @@ namespace SourceGit.Views
private void OnCommitListKeyDown(object sender, KeyEventArgs e) private void OnCommitListKeyDown(object sender, KeyEventArgs e)
{ {
if (sender is ListBox { SelectedItems: { Count : > 0 } selected } && if (sender is ListBox { SelectedItems: { Count: > 0 } selected } &&
e.Key == Key.C && e.Key == Key.C &&
e.KeyModifiers.HasFlag(KeyModifiers.Control)) e.KeyModifiers.HasFlag(KeyModifiers.Control))
{ {