在.net中替换OpenFileDialog/SaveFileDialog [英] Replacing OpenFileDialog / SaveFileDialog in .net
问题描述
在我正在处理的应用程序中,我一直试图将SaveFileDialog和OpenFileDialog用于其常规用途(保存和打开文件.)
In the application I'm working on, I've been trying to use the SaveFileDialog and OpenFileDialog for their customary purpose (saving and opening files.)
但是,由于拥有UI的线程上发生了太多对时间敏感的事情,因此应用程序不崩溃就不能支持模式形式/对话框.
However, the application can't support modal forms/dialogs without crashing because too many time-sensitive things happen on the thread that owns the UI.
在近期内,重写应用程序以将这些功能移出UI拥有线程是不切实际的.要完成我一直在研究的功能,我需要替代两个文件对话框,最好是可以以非模式形式存在的控件.
Rewriting the application to move those features off the UI-owning thread is not practical in the immediate term. To finish the feature I've been working on, I need a substitute for the two file dialogs, preferably a control that can live on a non-modal form.
有没有可以阻止UI拥有线程的东西?
Is there anything out there I can use that won't block my UI-owning thread?
推荐答案
我知道的唯一现有选项是 Dialog Workshop.NET ,一种商业产品.它们具有一组对话框,这些对话框可以选择为无模式(或直接嵌入到Windows窗体而不是单独的窗口中).
The only existing option I know of is Dialog Workshop.NET, a commercial product. They have a set of dialogs that have the option of being modeless (or embedded directly into a windows form instead of a separate window).
但是,我真的会考虑尝试将对时间敏感的逻辑移到单独的线程中.拥有无模式对话框可能会使用户感到困惑,因为它的行为不会像文件对话框那样.拥有不可阻塞的UI还会带来其他潜在后果.
However, I'd really think about trying to move your time sensitive logic into a separate thread, instead. Having a modeless dialog will potentially confuse users, since it will not behave the way a file dialog is supposed to behave. There are also other potential consequences to having a non-blockable UI.
这篇关于在.net中替换OpenFileDialog/SaveFileDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!