长时间运行时显示状态/请等待屏幕? [英] Show Status during long running operation / Please wait screen?

查看:80
本文介绍了长时间运行时显示状态/请等待屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在使用Beth的AWESOME教程,介绍如何使用Outlook InterOp :)谢谢Beth!

So I'm using Beth's AWESOME tutorial on how to use outlook InterOp :) Thanks Beth!

所以现在我正在与outlook沟通,但创建电子邮件需要一会儿。所以我想在客户端上显示一个状态...某些地方。

So now i'm communicating with outlook, but creating the emails takes a while. So i want to display a status... some where on the client.

当它现在在LS的beta 2中运行时"请等待"有一个微调器显示,但是我想在屏幕上的###中记录一些###,以便用户可以弄清楚他们是否需要吃午饭。

When it runs now in beta 2 of LS a "Please Wait" with a spinner shows, however I would like it to say On Record ## out of ### some where on the screen so the users can figure out if they need to take lunch or not.

是的我必须通过outlook发送,因为用户想要在他们外出之前查看电子邮件,所以这里没有服务器代码所有interOp并将电子邮件添加到草稿文件夹以便稍后发送。

Yes i have to send via outlook as the user wants to look over the emails before they go out, so no server code here it's all interOp and adding the emails to the drafts folder to be sent later.

只需要显示一个状态,因为它会在用户草稿文件夹中放入200多封电子邮件....

Just need to display a status as it's chucking 200+ emails or so into the users drafts folder....

 

推荐答案

查看此LS的文本"Please Wait"不直接支持微调器。

Chaning the text of this LS "Please Wait" spinner is not directly supported.

但你可以做一些不同的事情。 当您的InterOp代码很慢时,您可能想要旋转一个单独的线程,并在那里做大部分事情。  (您可能希望首先收集默认线程中的所有数据,并将其传递给后台线程。 
如果您在后台线程中直接访问LS对象,它将抛出。)  后台线程可以更新预定义的屏幕属性(通过BeginInvoke以确保它在正确的线程中更新)以指示进程的进度。 
后一个可以在屏幕上用户界面显示进度。

But you can do something different.  When your InterOp code is slow, you might want to spin a seperated thread, and do most things there.  (You may want to collect all the data in the default thread first, and pass it to a background thread.  If you directly access LS object in the background thread, it will throw.)   The background thread can update pre-defined screen property (through BeginInvoke to ensure it is updated in the right thread) to indicate the progress of the process.  The later one can be bount to UI on the screen to show the progress.

您可能想要禁用屏幕中的某些功能,因此它不会重新进入过程,在完成之前。 通过这种方式,您可以允许用户在流程中间取消操作。

You might want to disable certain functions in the screen, so it won't reentry to the process, before it is done.  In this way, you may allow users to cancel the operation in the middle of the process.

 


这篇关于长时间运行时显示状态/请等待屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆