Skip to content

Commit 01caa5b

Browse files
committed
Merge pull request haacked#78 from Haacked/upgrades
Upgrades
2 parents 355c35b + fa184a9 commit 01caa5b

25 files changed

+90
-277
lines changed

.nuget/NuGet.Config

-6
This file was deleted.

.nuget/NuGet.exe

-1.59 MB
Binary file not shown.

.nuget/NuGet.targets

-144
This file was deleted.

SeeGit.sln

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11

2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeeGitApp", "SeeGitApp\SeeGitApp.csproj", "{455C90CF-CB4E-41FB-8DB8-04AD1B104F64}"
57
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{AC22554C-AC27-42A3-91FA-16D49BBC0A4D}"
79
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8B481ABB-96B1-4480-B8CA-EF43A860156E}"
9-
ProjectSection(SolutionItems) = preProject
10-
.gitignore = .gitignore
11-
README.md = README.md
12-
EndProjectSection
13-
EndProject
1410
Global
1511
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1612
Debug|Any CPU = Debug|Any CPU

SeeGit.sln.DotSettings

-8
This file was deleted.

SeeGitApp/App.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
-->
2424
<add key="SHALength" value="8"/>
2525
</appSettings>
26-
</configuration>
26+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>

SeeGitApp/App.xaml.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ namespace SeeGit
77
/// </summary>
88
public class App : Application
99
{
10+
public const string LayoutAlgorithm = "EfficientSugiyama"; // Others include: "CompoundFDP"
1011
}
1112
}

SeeGitApp/Bases/NotifyPropertyChanged.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ protected void RaisePropertyChanged(string propertyName)
1313
{
1414
var handler = PropertyChanged;
1515

16-
if (handler != null)
17-
handler(this, new PropertyChangedEventArgs(propertyName));
16+
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
1817
}
1918

2019
protected void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpression)
@@ -27,19 +26,19 @@ private string ExtractPropertyName<T>(Expression<Func<T>> propertyExpression)
2726
{
2827
if (propertyExpression == null)
2928
{
30-
throw new ArgumentNullException("propertyExpression");
29+
throw new ArgumentNullException(nameof(propertyExpression));
3130
}
3231

3332
var memberExpression = propertyExpression.Body as MemberExpression;
3433
if (memberExpression == null)
3534
{
36-
throw new ArgumentException("propertyExpression");
35+
throw new ArgumentException(nameof(propertyExpression));
3736
}
3837

3938
var property = memberExpression.Member as PropertyInfo;
4039
if (property == null)
4140
{
42-
throw new ArgumentException("propertyExpression");
41+
throw new ArgumentException(nameof(propertyExpression));
4342
}
4443

4544
return memberExpression.Member.Name;

SeeGitApp/Extensions/CommitTemplatedAdorner.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ internal class CommitTemplatedAdorner : Adorner
1313
///
1414
/// </summary>
1515
/// <param name="adornedElement"></param>
16+
/// <param name="frameworkElementAdorner"></param>
1617
public CommitTemplatedAdorner(UIElement adornedElement, FrameworkElement frameworkElementAdorner)
1718
: base(adornedElement)
1819
{
@@ -33,10 +34,7 @@ protected override Visual GetVisualChild(int index)
3334
/// <summary>
3435
///
3536
/// </summary>
36-
protected override int VisualChildrenCount
37-
{
38-
get { return 1; }
39-
}
37+
protected override int VisualChildrenCount => 1;
4038

4139
/// <summary>
4240
///

SeeGitApp/Extensions/ModelExtensions.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ public static string AtMost(this string s, int characterCount)
2020

2121
public static string GetGitRepositoryPath(string path)
2222
{
23-
if (path == null) throw new ArgumentNullException("path");
23+
if (path == null) throw new ArgumentNullException(nameof(path));
2424

2525
//If we are passed a .git directory, just return it straightaway
26-
DirectoryInfo pathDirectoryInfo = new DirectoryInfo(path);
27-
if (pathDirectoryInfo.Name == ".git")
26+
var pathDirectoryInfo = new DirectoryInfo(path);
27+
if (pathDirectoryInfo.Name == GitDirectoryName)
2828
{
2929
return path;
3030
}
3131

32-
if (!pathDirectoryInfo.Exists) return Path.Combine(path, ".git");
32+
if (!pathDirectoryInfo.Exists) return Path.Combine(path, GitDirectoryName);
3333

34-
DirectoryInfo checkIn = pathDirectoryInfo;
34+
var checkIn = pathDirectoryInfo;
3535

3636
while (checkIn != null)
3737
{
38-
string pathToTest = Path.Combine(checkIn.FullName, ".git");
38+
string pathToTest = Path.Combine(checkIn.FullName, GitDirectoryName);
3939
if (Directory.Exists(pathToTest))
4040
{
4141
return pathToTest;
@@ -48,12 +48,12 @@ public static string GetGitRepositoryPath(string path)
4848

4949
// This is not good, it relies on the rest of the code being ok
5050
// with getting a non-git repo dir
51-
return Path.Combine(path, ".git");
51+
return Path.Combine(path, GitDirectoryName);
5252
}
5353

5454
public static IObservable<FileSystemEventArgs> CreateGitRepositoryCreationObservable(string path)
5555
{
56-
string expectedGitDirectory = Path.Combine(path, ".git");
56+
string expectedGitDirectory = Path.Combine(path, GitDirectoryName);
5757
return new FileSystemWatcher(path)
5858
{
5959
IncludeSubdirectories = false,

SeeGitApp/MainWindow.xaml.cs

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
using SeeGit.Models;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Configuration;
5-
using System.Windows.Controls;
1+
using System;
62
using System.IO;
7-
using System.Linq;
83
using System.Windows;
94
using System.Windows.Input;
5+
using SeeGit.Models;
106

117
namespace SeeGit
128
{
139
public partial class MainWindow : Window
1410
{
1511
private readonly MainWindowViewModel _viewModel;
16-
private static readonly Settings _configuration = new Settings();
1712

1813
public MainWindow()
1914
{
@@ -26,10 +21,7 @@ public MainWindow()
2621
/// <summary>
2722
/// A reference to the configuration.
2823
/// </summary>
29-
public static Settings Configuration
30-
{
31-
get { return _configuration; }
32-
}
24+
public static Settings Configuration { get; } = new Settings();
3325

3426
private void OnChooseRepository(object sender, RoutedEventArgs args)
3527
{
@@ -45,13 +37,13 @@ private void OnToggleSettings(object sender, RoutedEventArgs args)
4537
{
4638
if (!_viewModel.ToggleSettings())
4739
{
48-
foreach (CommitVertex vertex in _viewModel.Graph.Vertices)
40+
foreach (var vertex in _viewModel.Graph.Vertices)
4941
{
50-
vertex.AdornerMessageVisibilityType = _configuration.GetSetting("AdornerCommitMessageVisibility", "ExpandedHidden");
51-
vertex.DescriptionShown = _configuration.GetSetting<bool>("DescriptionInExpander", false);
52-
vertex.ShaLength = _configuration.GetSetting<int>("SHALength", 8);
42+
vertex.AdornerMessageVisibilityType = Configuration.GetSetting("AdornerCommitMessageVisibility", "ExpandedHidden");
43+
vertex.DescriptionShown = Configuration.GetSetting("DescriptionInExpander", false);
44+
vertex.ShaLength = Configuration.GetSetting("SHALength", 8);
5345
}
54-
_configuration.Save();
46+
Configuration.Save();
5547
_viewModel.Refresh();
5648
}
5749
}

SeeGitApp/Models/BranchReference.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override int GetHashCode()
1818
{
1919
unchecked
2020
{
21-
int result = (Name != null ? Name.GetHashCode() : 0);
21+
int result = Name?.GetHashCode() ?? 0;
2222
result = (result*397) ^ IsRemote.GetHashCode();
2323
result = (result*397) ^ IsCurrent.GetHashCode();
2424
return result;

SeeGitApp/Models/CommitEdge.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public override int GetHashCode()
5252
{
5353
unchecked
5454
{
55-
int result = (Target != null ? Target.GetHashCode() : 0);
56-
result = (result * 397) ^ (Source != null ? Source.GetHashCode() : 0);
55+
int result = Target?.GetHashCode() ?? 0;
56+
result = (result * 397) ^ (Source?.GetHashCode() ?? 0);
5757
return result;
5858
}
5959
}

0 commit comments

Comments
 (0)