Bug fix for IsAdministrator

This reverts commit 7618f9f7d4.
This commit is contained in:
2dust
2024-10-13 20:15:43 +08:00
parent e530789739
commit 4eb443e547
4 changed files with 18 additions and 7 deletions
+14
View File
@@ -2,11 +2,14 @@
{
public sealed class AppHandler
{
#region Property
private static readonly Lazy<AppHandler> _instance = new(() => new());
private Config _config;
private int? _statePort;
private int? _statePort2;
private Job? _processJob;
private bool? _isAdministrator;
public static AppHandler Instance => _instance.Value;
public Config Config => _config;
@@ -28,6 +31,17 @@
}
}
public bool IsAdministrator
{
get
{
_isAdministrator ??= Utils.IsAdministrator();
return _isAdministrator.Value;
}
}
#endregion Property
#region Init
public AppHandler()