我有一个函数需要在 STA 公寓状态下运行。我想检查它是否作为 STA 运行,如果没有生成一个在 STA 中运行的新线程。
如何检查当前线程正在哪个单元状态运行?
System.Threading.Thread.CurrentThread.GetApartmentState()