fix: Dynamic load copyright (#1030)

This commit is contained in:
GadflyFang 2025-02-27 21:14:24 +08:00 committed by GitHub
parent caca1dcaaf
commit 57cb9d0909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 14 additions and 13 deletions

View file

@ -11,11 +11,21 @@ namespace SourceGit.Views
private set;
}
public string Copyright
{
get;
private set;
}
public About()
{
var ver = Assembly.GetExecutingAssembly().GetName().Version;
if (ver != null)
Version = $"{ver.Major}.{ver.Minor}";
var attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length > 0)
Copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
DataContext = this;
InitializeComponent();