Re: [mono-android] waiting for result from runonuithread

2011-11-22 Thread Tossing, Chris
Mono for Android Subject: Re: [mono-android] waiting for result from runonuithread Thanks, that works perfectly! Martyn From: monodroid-boun...@lists.ximian.com [mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Tossing, Chris Sent: 17 November 2011 13:27 To: Discussions related to Mono fo

Re: [mono-android] waiting for result from runonuithread

2011-11-22 Thread Martyn Wendon
Thanks, that works perfectly! Martyn From: monodroid-boun...@lists.ximian.com [mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Tossing, Chris Sent: 17 November 2011 13:27 To: Discussions related to Mono for Android Subject: Re: [mono-android] waiting for result from

Re: [mono-android] waiting for result from runonuithread

2011-11-17 Thread Tossing, Chris
Sorry, remove the "private", since this is within a method: bool success = false; System.Threading.AutoResetEvent remoteCommandDoneEvent = new System.Threading.AutoResetEvent(false); RunOnUiThread(() => { success = ExecuteRemoteCommand(command, parameter); remoteCommandDoneEvent.Set(); }); remote

Re: [mono-android] waiting for result from runonuithread

2011-11-17 Thread Tossing, Chris
You can use an AutoResetEvent: bool success = false; private System.Threading.AutoResetEvent remoteCommandDoneEvent = new System.Threading.AutoResetEvent(false); RunOnUiThread(() => { success = ExecuteRemoteCommand(command, parameter); remoteCommandDoneEvent.Set(); }); remoteCommandDoneEvent.WaitO