Skip to content

Commit 41853aa

Browse files
author
Waescher, Andreas
committed
Fix file formattings
1 parent c324066 commit 41853aa

29 files changed

+475
-514
lines changed

RepoZ.Api.Common/Common/FileAppSettingsService.cs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ namespace RepoZ.Api.Common.Common
99
{
1010
public class FileAppSettingsService : IAppSettingsService
1111
{
12-
private AppSettings _settings;
13-
private readonly List<Action> _invalidationHandlers = new List<Action>();
12+
private AppSettings _settings;
13+
private readonly List<Action> _invalidationHandlers = new List<Action>();
1414

15-
public FileAppSettingsService(IAppDataPathProvider appDataPathProvider)
15+
public FileAppSettingsService(IAppDataPathProvider appDataPathProvider)
1616
{
1717
AppDataPathProvider = appDataPathProvider ?? throw new ArgumentNullException(nameof(appDataPathProvider));
1818
}
1919

20-
private AppSettings Load()
20+
private AppSettings Load()
2121
{
2222
string file = GetFileName();
2323

@@ -49,7 +49,7 @@ private void Save()
4949
catch { /* Our app settings are not critical. For our purposes, we want to ignore IO exceptions */ }
5050
}
5151

52-
private string GetFileName() => Path.Combine(AppDataPathProvider.GetAppDataPath(), "appsettings.json");
52+
private string GetFileName() => Path.Combine(AppDataPathProvider.GetAppDataPath(), "appsettings.json");
5353

5454
public IAppDataPathProvider AppDataPathProvider { get; }
5555

@@ -69,25 +69,25 @@ public AutoFetchMode AutoFetchMode
6969
get => Settings.AutoFetchMode;
7070
set
7171
{
72-
if (value != Settings.AutoFetchMode)
73-
{
74-
Settings.AutoFetchMode = value;
72+
if (value != Settings.AutoFetchMode)
73+
{
74+
Settings.AutoFetchMode = value;
7575

76-
NotifyChange();
77-
Save();
78-
}
76+
NotifyChange();
77+
Save();
78+
}
7979
}
8080
}
8181

82-
public void RegisterInvalidationHandler(Action handler)
83-
{
84-
_invalidationHandlers.Add(handler);
85-
}
82+
public void RegisterInvalidationHandler(Action handler)
83+
{
84+
_invalidationHandlers.Add(handler);
85+
}
8686

87-
public void NotifyChange()
88-
{
89-
_invalidationHandlers.ForEach(h => h.Invoke());
90-
}
87+
public void NotifyChange()
88+
{
89+
_invalidationHandlers.ForEach(h => h.Invoke());
90+
}
9191

92-
}
92+
}
9393
}

RepoZ.Api.Common/Common/IAppSettingsService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ public interface IAppSettingsService
77
{
88
AutoFetchMode AutoFetchMode { get; set; }
99

10-
void RegisterInvalidationHandler(Action handler);
10+
void RegisterInvalidationHandler(Action handler);
1111
}
1212
}
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace RepoZ.Api.Common.Common
1+
namespace RepoZ.Api.Common.Common
62
{
73
public interface ITranslationService
84
{
95
string Translate(string value);
10-
string Translate(string value, params object[] args);
11-
}
6+
string Translate(string value, params object[] args);
7+
}
128
}

RepoZ.Api.Common/Git/AutoFetch/DefaultAutoFetchHandler.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77

88
namespace RepoZ.Api.Common.Git.AutoFetch
99
{
10-
public class DefaultAutoFetchHandler : IAutoFetchHandler
11-
{
12-
private bool _active;
13-
private AutoFetchMode? _mode = null;
10+
public class DefaultAutoFetchHandler : IAutoFetchHandler
11+
{
12+
private bool _active;
13+
private AutoFetchMode? _mode = null;
1414
private readonly Timer _timer;
1515
private readonly Dictionary<AutoFetchMode, AutoFetchProfile> _profiles;
1616
private int _lastFetchRepository = -1;
1717

18-
public DefaultAutoFetchHandler(IAppSettingsService appSettingsService,
18+
public DefaultAutoFetchHandler(IAppSettingsService appSettingsService,
1919
IRepositoryInformationAggregator repositoryInformationAggregator,
2020
IRepositoryWriter repositoryWriter)
21-
{
22-
AppSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
21+
{
22+
AppSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
2323
RepositoryInformationAggregator = repositoryInformationAggregator ?? throw new ArgumentNullException(nameof(repositoryInformationAggregator));
2424
RepositoryWriter = repositoryWriter ?? throw new ArgumentNullException(nameof(repositoryWriter));
2525
AppSettingsService.RegisterInvalidationHandler(() => Mode = AppSettingsService.AutoFetchMode);
@@ -99,34 +99,34 @@ private void FetchNext(object timerState)
9999
}
100100
}
101101

102-
public bool Active
103-
{
104-
get => _active;
105-
set
106-
{
107-
_active = value;
102+
public bool Active
103+
{
104+
get => _active;
105+
set
106+
{
107+
_active = value;
108108

109109
if (value && _mode == null)
110-
Mode = AppSettingsService.AutoFetchMode;
110+
Mode = AppSettingsService.AutoFetchMode;
111111

112112
UpdateBehavior();
113113
}
114-
}
114+
}
115115

116-
public AutoFetchMode Mode
117-
{
118-
get => _mode ?? AutoFetchMode.Off;
119-
set
120-
{
121-
if (value == _mode)
122-
return;
116+
public AutoFetchMode Mode
117+
{
118+
get => _mode ?? AutoFetchMode.Off;
119+
set
120+
{
121+
if (value == _mode)
122+
return;
123123

124124
_mode = value;
125125
Console.WriteLine("Auto fetch is: " + _mode.GetValueOrDefault().ToString());
126126

127-
UpdateBehavior();
128-
}
129-
}
127+
UpdateBehavior();
128+
}
129+
}
130130

131131
public IAppSettingsService AppSettingsService { get; }
132132

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace RepoZ.Api.Common.Git.AutoFetch
22
{
3-
public interface IAutoFetchHandler
4-
{
5-
bool Active { get; set; }
6-
}
3+
public interface IAutoFetchHandler
4+
{
5+
bool Active { get; set; }
6+
}
77
}

RepoZ.Api.Common/Git/ProcessExecution/GitCommandException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
2-
using System.Diagnostics;
32

43
namespace RepoZ.Api.Common.Git.ProcessExecution
54
{
65
public class GitCommandException : Exception
76
{
8-
public GitCommandException() : base()
7+
public GitCommandException() : base()
98
{
109
}
1110

RepoZ.Api.Common/Git/ProcessExecution/ProcessExecutingGitCommander.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ protected virtual string Start(Api.Git.Repository repository, string[] command,
128128
var error = new StringBuilder();
129129

130130
using (var outputWaitHandle = new AutoResetEvent(initialState: false))
131-
using (var errorWaitHandle = new AutoResetEvent(initialState: false))
132-
using (var process = new Process())
131+
using (var errorWaitHandle = new AutoResetEvent(initialState: false))
132+
using (var process = new Process())
133133
{
134134
process.StartInfo = psi;
135135

RepoZ.Api.Win/Git/WindowsRepositoryActionProvider.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public RepositoryAction GetSecondaryAction(Repository repository)
4545
return CreateProcessRunnerAction(_translationService.Translate("Open in Windows PowerShell"), "powershell.exe ", $"-executionpolicy bypass -noexit -command \"Set-Location '{repository.SafePath}'\"");
4646
}
4747

48-
public IEnumerable<RepositoryAction> GetContextMenuActions(IEnumerable<Repository> repositories)
49-
{
50-
return GetContextMenuActionsInternal(repositories.Where(r => Directory.Exists(r.SafePath))).Where(a => a != null);
51-
}
48+
public IEnumerable<RepositoryAction> GetContextMenuActions(IEnumerable<Repository> repositories)
49+
{
50+
return GetContextMenuActionsInternal(repositories.Where(r => Directory.Exists(r.SafePath))).Where(a => a != null);
51+
}
5252

5353
private IEnumerable<RepositoryAction> GetContextMenuActionsInternal(IEnumerable<Repository> repositories)
5454
{
@@ -84,15 +84,15 @@ private IEnumerable<RepositoryAction> GetContextMenuActionsInternal(IEnumerable<
8484
yield return new RepositoryAction()
8585
{
8686
Name = _translationService.Translate("Checkout"),
87-
DeferredSubActionsEnumerator =() => singleRepository.LocalBranches
88-
.Take(50)
89-
.Select(branch => new RepositoryAction()
90-
{
91-
Name = branch,
92-
Action = (_, __) => _repositoryWriter.Checkout(singleRepository, branch),
93-
CanExecute = !singleRepository.CurrentBranch.Equals(branch, StringComparison.OrdinalIgnoreCase)
94-
})
95-
.ToArray()
87+
DeferredSubActionsEnumerator = () => singleRepository.LocalBranches
88+
.Take(50)
89+
.Select(branch => new RepositoryAction()
90+
{
91+
Name = branch,
92+
Action = (_, __) => _repositoryWriter.Checkout(singleRepository, branch),
93+
CanExecute = !singleRepository.CurrentBranch.Equals(branch, StringComparison.OrdinalIgnoreCase)
94+
})
95+
.ToArray()
9696
};
9797
}
9898

RepoZ.Api.Win/PInvoke/Combridge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public T GetPropertyValue<T>(string propertyName)
7474
/// <param name="flags">The binding flags to decide whether to invoke methods or to retrieve property values.</param>
7575
/// <returns></returns>
7676
protected T GetValueViaReflection<T>(string memberName, BindingFlags flags)
77-
=> (T)_comType.Value.InvokeMember(memberName, flags, null, ComObject, null);
77+
=> (T)_comType.Value.InvokeMember(memberName, flags, null, ComObject, null);
7878

7979
/// <summary>
8080
/// Gets the wrapped COM object for native access.

RepoZ.Api/Git/DefaultRepositoryInformationAggregator.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
using System.Collections.Generic;
44
using System.Collections.ObjectModel;
55
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
86

97
namespace RepoZ.Api.Git
108
{
@@ -79,10 +77,10 @@ public bool HasRepository(string path)
7977
return GetRepositoryByPath(path) != null;
8078
}
8179

82-
public void Reset()
83-
{
84-
_dataSource.Clear();
85-
}
80+
public void Reset()
81+
{
82+
_dataSource.Clear();
83+
}
8684

8785
public ObservableCollection<RepositoryView> Repositories => _dataSource;
8886
}
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
62

73
namespace RepoZ.Api.Git
84
{
95
public interface IRepositoryActionProvider
106
{
11-
RepositoryAction GetPrimaryAction(Repository repository);
7+
RepositoryAction GetPrimaryAction(Repository repository);
128

13-
RepositoryAction GetSecondaryAction(Repository repository);
9+
RepositoryAction GetSecondaryAction(Repository repository);
1410

15-
IEnumerable<RepositoryAction> GetContextMenuActions(IEnumerable<Repository> repositories);
11+
IEnumerable<RepositoryAction> GetContextMenuActions(IEnumerable<Repository> repositories);
1612
}
1713
}

RepoZ.Api/Git/IRepositoryInformationAggregator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Collections.ObjectModel;
1+
using System.Collections.ObjectModel;
32

43
namespace RepoZ.Api.Git
54
{
@@ -13,7 +12,7 @@ public interface IRepositoryInformationAggregator
1312

1413
ObservableCollection<RepositoryView> Repositories { get; }
1514

16-
void Reset();
15+
void Reset();
1716

1817
bool HasRepository(string path);
1918
}

RepoZ.Api/Git/IRepositoryMonitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ public interface IRepositoryMonitor
99

1010
event EventHandler<string> OnDeletionDetected;
1111

12-
event EventHandler<bool> OnScanStateChanged;
12+
event EventHandler<bool> OnScanStateChanged;
1313

1414
void Stop();
1515

1616
void Observe();
1717

18-
void Reset();
18+
void Reset();
1919

2020
Task ScanForLocalRepositoriesAsync();
2121

RepoZ.Api/Git/IRepositoryObserver.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace RepoZ.Api.Git
84
{
9-
public interface IRepositoryObserver : IDisposable
5+
public interface IRepositoryObserver : IDisposable
106
{
117
void Setup(Repository repository, int detectionToAlertDelayMilliseconds);
128

RepoZ.Api/Git/StatusCompressor.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using RepoZ.Api.Git;
1+
using System.Text;
72

83
namespace RepoZ.Api.Git
94
{
@@ -45,14 +40,14 @@ public string Compress(Repository repository)
4540
else
4641
{
4742
if (isBehind)
48-
builder.Append($"{_statusCharacterMap.ArrowDownSign}{repository.BehindBy.Value}");
43+
builder.Append($"{_statusCharacterMap.ArrowDownSign}{repository.BehindBy.Value}");
4944

50-
if (isAhead)
51-
{
52-
if (isBehind)
53-
builder.Append(" ");
45+
if (isAhead)
46+
{
47+
if (isBehind)
48+
builder.Append(" ");
5449

55-
builder.Append($"{_statusCharacterMap.ArrowUpSign}{repository.AheadBy.Value}");
50+
builder.Append($"{_statusCharacterMap.ArrowUpSign}{repository.AheadBy.Value}");
5651
}
5752
}
5853
}

0 commit comments

Comments
 (0)