private void GeoprocessorTask_JobCompleted(object sender, ESRI.ArcGIS.Client.Tasks.JobInfoEventArgs e)
{
WaitGrid.Visibility = Visibility.Collapsed;
if (e.JobInfo.JobStatus == esriJobStatus.esriJobSucceeded)
{
Geoprocessor geoprocessorTask = sender as Geoprocessor;
System.Threading.Thread.Sleep(2000);
resultLayer = geoprocessorTask.GetResultMapServiceLayer(e.JobInfo.JobId);
resultLayer.InitializationFailed += new EventHandler<EventArgs>(resultLayer_InitializationFailed);
resultLayer.DisplayName = e.JobInfo.JobId;
if (resultLayer != null)
{
_displayViewshedInfo = true;
MyMap.Layers.Add(resultLayer);
}
}
else
{
MessageBox.Show("Geoprocessor service failed");
_displayViewshedInfo = false;
}
}