本文介绍了C#确定当前线程是否是主GUI线程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嘿所有, 只是好奇,有没有人知道是否有办法检查当前正在执行的线程是否是主要的WPF GUI线程? 我想拥有它,以便当前线程是WPF GUI线程时,非线程远程调用将失败。原因是长时间运行的调用会锁定GUI,在此期间,我们希望它保持响应。 检查它是否是背景线程做的伎俩? 谢谢!解决方案 你能用System.Reflection命名空间吗? Hey All,Just curious, does anyone know if there is a way to check if the current executing thread is the main WPF GUI thread?I want to have it so that a non-threaded remoting call will fail if the current thread is the WPF GUI thread. The reason for this is that a long running call locks up the GUI, and during this time, we would like it to stay responsive.Does checking to see if it''s a background thread do the trick?Thanks! 解决方案 这篇关于C#确定当前线程是否是主GUI线程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 05:53
查看更多