From 24b175c33188aa9c039c5868431ed828a181200e Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 17 Nov 2020 11:41:01 +0800 Subject: [PATCH] upgrade: upgrade to .net 5.0 --- src/SourceGit.csproj | 4 ++-- src/UI/About.xaml.cs | 3 ++- src/UI/Blame.xaml.cs | 3 +-- src/UI/DiffViewer.xaml.cs | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index 91f80565..94b3e7c4 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -1,6 +1,6 @@ - + - net46 + net5.0-windows WinExe true true diff --git a/src/UI/About.xaml.cs b/src/UI/About.xaml.cs index 4e3a0f90..d355f10e 100644 --- a/src/UI/About.xaml.cs +++ b/src/UI/About.xaml.cs @@ -15,7 +15,8 @@ namespace SourceGit.UI { /// public string Version { get { - return "VERSION : " + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion; + Assembly asm = Assembly.GetExecutingAssembly(); + return "VERSION : " + asm.GetName().Version; } } diff --git a/src/UI/Blame.xaml.cs b/src/UI/Blame.xaml.cs index abf44055..3aa88969 100644 --- a/src/UI/Blame.xaml.cs +++ b/src/UI/Blame.xaml.cs @@ -117,8 +117,7 @@ namespace SourceGit.UI { new Typeface(content.FontFamily, p.FontStyle, p.FontWeight, p.FontStretch), content.FontSize, Brushes.Black, - new NumberSubstitution(), - TextFormattingMode.Ideal); + VisualTreeHelper.GetDpi(this).PixelsPerDip); if (minWidth < formatter.Width) { content.Document.PageWidth = formatter.Width + 16; minWidth = formatter.Width; diff --git a/src/UI/DiffViewer.xaml.cs b/src/UI/DiffViewer.xaml.cs index b4aa5754..868138eb 100644 --- a/src/UI/DiffViewer.xaml.cs +++ b/src/UI/DiffViewer.xaml.cs @@ -212,8 +212,7 @@ namespace SourceGit.UI { new Typeface(leftText.FontFamily, p.FontStyle, p.FontWeight, p.FontStretch), leftText.FontSize, Brushes.Black, - new NumberSubstitution(), - TextFormattingMode.Ideal); + VisualTreeHelper.GetDpi(this).PixelsPerDip); if (minWidth < formatter.Width) minWidth = formatter.Width;