mirror of
https://github.com/jie65535/ChineseChess.git
synced 2024-07-27 18:55:00 +08:00
24 lines
652 B
C#
24 lines
652 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Reflection;
|
|
|
|
using ChineseChess.GUI.Contracts.Services;
|
|
|
|
namespace ChineseChess.GUI.Services
|
|
{
|
|
public class ApplicationInfoService : IApplicationInfoService
|
|
{
|
|
public ApplicationInfoService()
|
|
{
|
|
}
|
|
|
|
public Version GetVersion()
|
|
{
|
|
// Set the app version in ChineseChess.GUI > Properties > Package > PackageVersion
|
|
string assemblyLocation = Assembly.GetExecutingAssembly().Location;
|
|
var version = FileVersionInfo.GetVersionInfo(assemblyLocation).FileVersion;
|
|
return new Version(version);
|
|
}
|
|
}
|
|
}
|