Feat: Show Release Note when confirm

This commit is contained in:
ChsBuffer
2021-03-22 11:09:16 +08:00
parent 15a1db3b21
commit 1ffbae6135
2 changed files with 17 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -89,5 +90,19 @@ namespace Netch.Controllers
fileName = match.Groups["filename"].Value;
sha256 = match.Groups["sha256"].Value;
}
public static string GetLatestReleaseContent()
{
var sb = new StringBuilder();
foreach (string l in LatestRelease.body.GetLines(false).SkipWhile(l => l.FirstOrDefault() != '#'))
{
if (l.Contains("校验和"))
break;
sb.AppendLine(l);
}
return sb.ToString();
}
}
}

View File

@@ -579,7 +579,8 @@ namespace Netch.Forms
return;
}
if (MessageBoxX.Show(i18N.Translate("Download and install now?"), confirm: true) != DialogResult.OK)
if (MessageBoxX.Show(i18N.Translate($"Download and install now?\n\n{UpdateChecker.GetLatestReleaseContent()}"), confirm: true) !=
DialogResult.OK)
return;
NotifyTip(i18N.Translate("Start downloading new version"));