更新了UIContextOperation的注释

This commit is contained in:
fengjiayi
2024-12-12 20:53:32 +08:00
parent 3d0ed00fba
commit 589c0490bf

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -8,12 +9,30 @@ using System.Threading.Tasks;
namespace Serein.Library.Utils namespace Serein.Library.Utils
{ {
/// <summary> /// <summary>
/// 为类库提供了在UI线程上下文操作的方法如果你在Windows平台上运行不必手动实例化该类 /// 为类库提供了在UI线程上下文操作的方法使用Serein.Workbench时不用处理
/// 在WPF、Winform项目中多线程中直接操作UI线程可能发生非预期的异常
/// 所以当你设置自己的平台时,需要手动实例化这个工具类
/// </summary> /// </summary>
public class UIContextOperation public class UIContextOperation
{ {
private readonly SynchronizationContext context; private readonly SynchronizationContext context;
static UIContextOperation()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
}
}
/// <summary> /// <summary>
/// 传入UI线程上下文 /// 传入UI线程上下文
/// </summary> /// </summary>