Commit 9fb027ea by liulongfei

限制任务在加载场景时进行更新

parent 727863f5
......@@ -131,5 +131,10 @@ namespace VIZ.Package.Domain
/// 当前页
/// </summary>
public static PageModelBase CurrentPage { get; set; }
/// <summary>
/// 场景是否正在加载
/// </summary>
public static bool IsSceneLoading { get; set; }
}
}
......@@ -417,6 +417,7 @@ namespace VIZ.Package.Module
// 设置主窗口不可用
WPFHelper.Invoke(() =>
{
ApplicationDomainEx.IsSceneLoading = true;
service?.SetIsEnabled(false);
});
......@@ -434,6 +435,7 @@ namespace VIZ.Package.Module
// 恢复主窗口可用
WPFHelper.Invoke(() =>
{
ApplicationDomainEx.IsSceneLoading = false;
service?.SetIsEnabled(true);
});
}
......
......@@ -221,8 +221,8 @@ namespace VIZ.Package.Module
/// <param name="task">任务</param>
private void ExecuteTask(PackageTaskModel task)
{
// 任务没有在运行状态 || 任务不可以执行
if (!task.IsRunning || !task.CanExecute)
// 任务没有在运行状态 || 任务不可以执行 || 正在加载场景
if (!task.IsRunning || !task.CanExecute || ApplicationDomainEx.IsSceneLoading)
return;
List<string> updateMessage = new List<string>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment