fix: 修复进度条的问题
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using server.Services;
|
||||
/// <summary>
|
||||
/// 多线程通信总线
|
||||
/// </summary>
|
||||
public static class MsgBus
|
||||
public sealed class MsgBus
|
||||
{
|
||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
@@ -11,12 +12,39 @@ public static class MsgBus
|
||||
/// </summary>
|
||||
public static UDPServer UDPServer { get { return udpServer; } }
|
||||
|
||||
// 添加静态ProgressTracker引用
|
||||
private static ProgressTracker? _progressTracker;
|
||||
|
||||
/// <summary>
|
||||
/// 设置全局ProgressTracker实例
|
||||
/// </summary>
|
||||
public static void SetProgressTracker(ProgressTracker progressTracker)
|
||||
{
|
||||
_progressTracker = progressTracker;
|
||||
}
|
||||
|
||||
public static ProgressTracker ProgressTracker
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_progressTracker == null)
|
||||
{
|
||||
throw new InvalidOperationException("ProgressTracker is not set.");
|
||||
}
|
||||
return _progressTracker;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isRunning = false;
|
||||
/// <summary>
|
||||
/// 获取通信总线运行状态
|
||||
/// </summary>
|
||||
public static bool IsRunning { get { return isRunning; } }
|
||||
|
||||
private MsgBus() { }
|
||||
|
||||
static MsgBus() { }
|
||||
|
||||
/// <summary>
|
||||
/// 通信总线初始化
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user