增加公开属性

This commit is contained in:
ww-rm
2025-03-22 23:11:13 +08:00
parent 979181fc3b
commit 28d1275023

View File

@@ -5,13 +5,38 @@ namespace SpineViewer
{ {
internal static class Program internal static class Program
{ {
public const string Name = "SpineViewer"; /// <summary>
/// 程序路径
/// </summary>
public static readonly string FilePath = Environment.ProcessPath;
/// <summary>
/// 程序名
/// </summary>
public static readonly string Name = Path.GetFileNameWithoutExtension(FilePath);
/// <summary>
/// 程序目录
/// </summary>
public static readonly string RootDir = Path.GetDirectoryName(FilePath);
/// <summary>
/// 程序临时目录
/// </summary>
public static readonly string TempDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Name)).FullName; public static readonly string TempDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Name)).FullName;
/// <summary>
/// 程序进程
/// </summary>
public static readonly Process Process = Process.GetCurrentProcess(); public static readonly Process Process = Process.GetCurrentProcess();
/// <summary>
/// 程序日志器
/// </summary>
public static readonly Logger Logger = LogManager.GetCurrentClassLogger(); public static readonly Logger Logger = LogManager.GetCurrentClassLogger();
/// <summary> /// <summary>
/// The main entry point for the application. /// 应用入口点
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main()