Hello,
any suggestions would be very appreciated,
In c# code, I'd like to create a library with some GIS functionality. My first GP task in my library is to be a point in polygon intersect.
This involves 2 querytasks/queries. First selects the polygons, the second does the intersect.
I attach the results of my intersects to graphicsLayers, and I want these graphicsLayers to be the returned objects from my methods.
Problem is, I can't figure out how to make my method wait for ESRI's ASync querytasks to finish (and populate the graphics Layers) before it attempts to return the graphics layers.
I???ve tried delegates (denied cross thread access), background worker (cross threads again), and a simple thread.sleep inside a while loop, but nothing.
Simplest would be if i could execute the querytask synchronously, but it doesnt appear that i can.
Below is a simplified version of what I'm trying to do:
[HTML]bool myBool = GetABoolean(5);
public bool GetABoolean(int id)
{
bool aBool;
client.CallAnAsyncMethod(id); // value is returned in a completed event handler. Need to somehow get that value into aBool.
return aBool; // this needs to NOT execute until aBool has a value
}[/HTML]