I have a function named "Search" which invokes another method "SearchIndividuals" as shown below. In the "SearchIndividuals" it invokes another method "Send" which is defined as asynchronous and as soon as it is done with processing it returns the result using a "callback". In the "SendCallback" method the "Result" variable will be set.
In the "Search" method it needs to process the "Result". How can I make sure it reads the "Result" variable only after it is set in the "SendCallback" method.
Thanks for any help or suggestions.
//class level variable
private string Result = null;
private void Search(object sender, SearchEventArgs args)
if(Result! = null)
private void SearchIndividuals(string name)
private void SendCallback(object sender, ResponseXml e)
Result = e.Response