如何检查当前线程的公寓状态?
-
24-09-2019 - |
题
我的功能需要在STA公寓状态下运行。我不想检查它是否作为STA运行,如果不产生在STA中运行的新线程。
如何检查当前线程正在运行的哪个公寓状态?
解决方案
System.Threading.Thread.CurrentThread.GetApartmentState()
其他提示
在功能中使用此或类似方法:
System.Threading.Thread.CurrentThread.GetApartmentState
不隶属于 StackOverflow