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.WaitOne();

The calling thread will be blocked until the AutoResetEvent is set in the 
lambda expression.

Chris Tossing
Software Engineer
Touchcom
A G4S Technology Company
Direct Dial:      +1 (781) 457-0779
Cell:                +1 (847) 942-0359
ctoss...@touchcominc.com<mailto:ctoss...@touchcominc.com>
www.touchcominc.com<http://www.touchcominc.com/>
21 North Avenue, Burlington, Massachusetts USA

P Please consider the environment before printing this email

The details of this company are as follows:
Touchcom Inc, Registered Office: 21 North Avenue, Burlington, MA 01803.

This communication may contain information which is confidential, personal 
and/or privileged.

It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, 
forwarding, copying or use of this communication or the information in it is 
strictly prohibited.

Any personal views expressed in this e-mail are those of the individual sender 
and the company does not endorse or accept responsibility for them.

Prior to taking any action based upon this e-mail message, you should seek 
appropriate confirmation of its authenticity.

This e-mail has been scanned for all viruses by MessageLabs.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to