diff --git a/OngekiFumenEditor/AppBootstrapper.cs b/OngekiFumenEditor/AppBootstrapper.cs index d661386d..1c3d98c5 100644 --- a/OngekiFumenEditor/AppBootstrapper.cs +++ b/OngekiFumenEditor/AppBootstrapper.cs @@ -174,7 +174,7 @@ protected override void OnStartup(object sender, StartupEventArgs e) } } - private async void OnStartupForCMD(object sender, StartupEventArgs e) + public async void OnStartupForCMD(object sender, StartupEventArgs e) { await IoC.Get().Init(); @@ -191,7 +191,7 @@ private async void OnStartupForCMD(object sender, StartupEventArgs e) } } - private async void OnStartupForGUI(object sender, StartupEventArgs e) + public async void OnStartupForGUI(object sender, StartupEventArgs e) { InitExceptionCatcher(); LogBaseInfos(); diff --git a/OngekiFumenEditor/OngekiFumenEditor.csproj b/OngekiFumenEditor/OngekiFumenEditor.csproj index 1f3fa63c..1c6d4feb 100644 --- a/OngekiFumenEditor/OngekiFumenEditor.csproj +++ b/OngekiFumenEditor/OngekiFumenEditor.csproj @@ -13,12 +13,23 @@ Resources\Icons\logo.ico + + $([System.DateTime]::UtcNow.AddHours(8).ToString("yyyy/M/dd H:mm:ss.fff")) + + + + + <_Parameter1>BuildDateTime + <_Parameter2>$(BuildDateTime) + + + embedded - embedded + none diff --git a/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml b/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml index 41410bb9..ff5730ca 100644 --- a/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml +++ b/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml @@ -5,8 +5,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:OngekiFumenEditor.UI.Dialogs" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:res="clr-namespace:OngekiFumenEditor.Properties" xmlns:markup="clr-namespace:OngekiFumenEditor.UI.Markup" + xmlns:res="clr-namespace:OngekiFumenEditor.Properties" Title="{markup:Translate [AboutWindow]}" Width="300" Background="{DynamicResource EnvironmentWindowBackground}" @@ -22,6 +23,12 @@ FontWeight="ExtraBlack"> Ongeki Fumen Editor + @@ -31,6 +38,9 @@ + + + @@ -42,33 +52,67 @@ FontSize="15" FontWeight="Bold"> + + + + + + + + diff --git a/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml.cs b/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml.cs index bfe016d9..5b262c0c 100644 --- a/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml.cs +++ b/OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml.cs @@ -1,30 +1,36 @@ using MahApps.Metro.Controls; using OngekiFumenEditor.Utils; +using System; using System.Diagnostics; using System.Linq; +using System.Reflection; namespace OngekiFumenEditor.UI.Dialogs { - /// - /// AboutWindow.xaml 的交互逻辑 - /// - public partial class AboutWindow : MetroWindow - { - public string productVersionStr => FileVersionInfo.GetVersionInfo(typeof(AppBootstrapper).Assembly.Location).ProductVersion; + /// + /// AboutWindow.xaml 的交互逻辑 + /// + public partial class AboutWindow : MetroWindow + { + public string CommitHash => ThisAssembly.GitCommitId[..7]; + public string Version => typeof(AppBootstrapper).Assembly.GetName().Version.ToString(); + public string ProductVersion => ThisAssembly.AssemblyFileVersion.Split("+").FirstOrDefault(); + public string BuildTime => typeof(AboutWindow).Assembly + .GetCustomAttributes() + .FirstOrDefault(x => x.Key == "BuildDateTime") + ?.Value; + public string BuildConfiguration => ThisAssembly.AssemblyConfiguration; + public string CommitDate => ThisAssembly.GitCommitDate.AddHours(8).ToString("yyyy/M/dd H:mm:ss.fff"); - public string CommitHash => productVersionStr.Split("+").LastOrDefault(); - public string Version => typeof(AppBootstrapper).Assembly.GetName().Version.ToString(); - public string ProductVersion => productVersionStr.Split("+").FirstOrDefault(); + public AboutWindow() + { + InitializeComponent(); + DataContext = this; + } - public AboutWindow() - { - InitializeComponent(); - DataContext = this; - } - - private void Label_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) - { - ProcessUtils.OpenUrl(e.Uri.ToString()); - } - } + private void Label_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) + { + ProcessUtils.OpenUrl(e.Uri.ToString()); + } + } }