private void GeoCode_Method1(string myaddress, int waypointIndex, string callingUser)
{
GCService.GeocodeCompleted += new EventHandler<NSpace.GCService.GeocodeCompletedEventArgs>(GeoCode_Method1_GeocodeCompleted);
GCService.GeocodeAsync(request, waypointIndex);
}
void GeoCode_Method1_GeocodeCompleted(object sender, NSpace.GCService.GeocodeCompletedEventArgs e)
{
//***QUESTION: how do I access variable "callinguser" from GeoCode_Method1 in this method??
}
When I call into GeoCode_Method1 I send in “callinguser” string variable, and i would like to access this in GeoCode_Method1_GeocodeCompleted (triggered when the async GeoCodingAsync call is done). How do I do this?
The easiest way to do this is by using a C# lambda expression as the event handler. This lambda expression can then call into the
GeoCode_Method1_GeocodeCompletedmethod and pass along thecallinguserparameter.