Refactor NoticeHandler

This commit is contained in:
2dust
2024-10-07 10:59:13 +08:00
parent d5c6a42a9a
commit 4ccc7aa92d
37 changed files with 115 additions and 150 deletions
+2 -5
View File
@@ -1,6 +1,4 @@
using Splat;
namespace ServiceLib.Handler
namespace ServiceLib.Handler
{
public sealed class AppHandler
{
@@ -33,7 +31,7 @@ namespace ServiceLib.Handler
#region Init
public AppHandler()
{
{
}
public bool InitApp()
@@ -42,7 +40,6 @@ namespace ServiceLib.Handler
{
return false;
}
Locator.CurrentMutable.RegisterLazySingleton(() => new NoticeHandler(), typeof(NoticeHandler));
Thread.CurrentThread.CurrentUICulture = new(_config.uiItem.currentLanguage);
//Under Win10
@@ -1,6 +1,4 @@
using ServiceLib.Services.CoreConfig;
namespace ServiceLib.Handler
namespace ServiceLib.Handler
{
/// <summary>
/// Core configuration file processing class
@@ -4,6 +4,9 @@ namespace ServiceLib.Handler
{
public class NoticeHandler
{
private static readonly Lazy<NoticeHandler> _instance = new(() => new());
public static NoticeHandler Instance => _instance.Value;
public void Enqueue(string? content)
{
if (content.IsNullOrEmpty())
@@ -1,6 +1,4 @@
using ServiceLib.Services.Statistics;
namespace ServiceLib.Handler
namespace ServiceLib.Handler
{
public class StatisticsHandler
{
+1 -3
View File
@@ -1,6 +1,4 @@
using ServiceLib.Services;
namespace ServiceLib.Handler
namespace ServiceLib.Handler
{
public class TaskHandler
{
+1 -1
View File
@@ -110,7 +110,7 @@ namespace ServiceLib.Handler
}
else
{
SaveLog(result.Description);
SaveLog(result.Description);
}
}
catch (Exception ex)