交叉调用 - .net 1.1 2.0 升级后许多控制重型 GUI 应用程序 - 最好的方法?
我最近将 .net1.1 解决方案升级到 .net2.0。 因为这是一个非常繁重的 GUI 应用程序,具有大量控件和许多更新 GUI 的多线程操作。 虽然这些操作在 .net1.1 中无缝运行,但在升级后会引发跨线程非法操作。 考虑到有大量网格、按钮和状态标签需要通过这些多线程操作进行更新,我决定编写代码来检查 InvokeRequired 解决方案,但是为每个控件执行此操作可能不是最好的方法它。
我想知道您是否可以建议一种更好的方法来解决这个问题,或者提出任何基于 OOPS 的类结构,我可以对其进行编码以使代码看起来更好。
如果我的问题不清楚,请告诉我。
提前致谢
I have recently upgraded a .net1.1 solution to .net2.0.
AS this is a very heavy GUI appilcation with loads of controls and many multithreaded operations that update the GUI.
While these operations worked seamlessly in .net1.1 it is throwing up Cross Threaded Illegal operations after the upgrade.
Considering the fact that tehre are numerous grids, buttons and status labels that need to be updated via these multi threaded operations, I decided to code for checking the InvokeRequired solution, however doing that for every control would probably not be the best way to go about it.
I was wondering if you could suggest a better way of how I can go about it or propose any OOPS based class structure that I could code around to make the code look better.
Please do let me know if my question is unclear.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一篇关于您的问题的好文章:
http://www.perceler.com/articles1。 php?art=crossthreads1
快速而肮脏的技巧是完全禁用检查:
Here's a good article about your problem:
http://www.perceler.com/articles1.php?art=crossthreads1
The quick and dirty hack is to disable the check altogether: