[MonoDevelop] One-shot dialogs from add-ins
Chris Howie
cdhowie at gmail.com
Wed Mar 18 14:51:49 EDT 2009
On Wed, Mar 18, 2009 at 2:43 PM, Casey Marshall
<casey.s.marshall at gmail.com> wrote:
> Because, I want to do this:
>
> Application.Invoke(delegate {
> run-dialog-and-get-result();
> signal-caller(); // only signal if not originally in GUI thread?
> });
> wait-to-be-signaled(); // only wait if not in GUI thread?
> use-result();
If you use e.g. a ManualResetEvent then this will work exactly as you
describe. When you signal the caller (via Set()) this will get
stored. If you are running on the same thread, WaitOne will return
immediately since you set it earlier. If you are on separate threads
then the WaitOne will return when Set is called.
--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
More information about the Monodevelop-list
mailing list