Skip to content

Commit

Permalink
add more info
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 21, 2024
1 parent 77f6b1a commit 178cf7c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 29 deletions.
4 changes: 2 additions & 2 deletions OngekiFumenEditor/AppBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ISchedulerManager>().Init();

Expand All @@ -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();
Expand Down
13 changes: 12 additions & 1 deletion OngekiFumenEditor/OngekiFumenEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,23 @@
<ApplicationIcon>Resources\Icons\logo.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup>
<BuildDateTime>$([System.DateTime]::UtcNow.AddHours(8).ToString("yyyy/M/dd H:mm:ss.fff"))</BuildDateTime>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>BuildDateTime</_Parameter1>
<_Parameter2>$(BuildDateTime)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>embedded</DebugType>
<DebugType>none</DebugType>
</PropertyGroup>

<ItemGroup>
Expand Down
56 changes: 50 additions & 6 deletions OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -22,6 +23,12 @@
FontWeight="ExtraBlack">
Ongeki Fumen Editor
</Label>
<Label
Margin="10,0"
HorizontalAlignment="Right"
Opacity="0.5">
Let's play ONGEKI forever!!!
</Label>
<Grid Margin="10,15,10,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
Expand All @@ -31,6 +38,9 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<Label VerticalAlignment="Center" FontSize="15">Product Verion</Label>
Expand All @@ -42,33 +52,67 @@
FontSize="15"
FontWeight="Bold">
</Label>

<Label
Grid.Row="1"
VerticalAlignment="Center"
FontSize="15">
Verion
Commit Hash
</Label>
<Label
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Center"
d:Content="1.5.0"
Content="{Binding Version}"
d:Content="abcdefg"
Content="{Binding CommitHash}"
FontSize="15"
FontWeight="Bold">
</Label>

<Label
Grid.Row="2"
VerticalAlignment="Center"
FontSize="15">
Commit Hash
Commit Time
</Label>
<Label
Grid.Row="2"
Grid.Column="1"
VerticalAlignment="Center"
d:Content="abcdefg"
Content="{Binding CommitHash}"
Content="{Binding CommitDate}"
FontSize="15"
FontWeight="Bold">
</Label>

<Label
Grid.Row="3"
VerticalAlignment="Center"
FontSize="15">
Build Time
</Label>
<Label
Grid.Row="3"
Grid.Column="1"
VerticalAlignment="Center"
d:Content="abcdefg"
Content="{Binding BuildTime}"
FontSize="15"
FontWeight="Bold">
</Label>

<Label
Grid.Row="4"
VerticalAlignment="Center"
FontSize="15">
Build Configuration
</Label>
<Label
Grid.Row="4"
Grid.Column="1"
VerticalAlignment="Center"
d:Content="abcdefg"
Content="{Binding BuildConfiguration}"
FontSize="15"
FontWeight="Bold">
</Label>
Expand Down
46 changes: 26 additions & 20 deletions OngekiFumenEditor/UI/Dialogs/AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// AboutWindow.xaml 的交互逻辑
/// </summary>
public partial class AboutWindow : MetroWindow
{
public string productVersionStr => FileVersionInfo.GetVersionInfo(typeof(AppBootstrapper).Assembly.Location).ProductVersion;
/// <summary>
/// AboutWindow.xaml 的交互逻辑
/// </summary>
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<AssemblyMetadataAttribute>()
.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());
}
}
}

0 comments on commit 178cf7c

Please sign in to comment.