Select to view content in your preferred language

Async Geoprocessing problem with Cancel method

843
0
02-05-2014 09:37 AM
PrzemyslawTyrtania
Deactivated User
I have a simple geoprocessor that runs as async

_geoProcessorResult = (IGeoProcessorResult2)Geoprocessor.ExecuteAsync(ArcPadGeoprocessorToolName, operationalParameters);


as the process is working I would like to have an option to cancel it so then I call

if (_geoProcessorResult != null) _geoProcessorResult.Cancel();


I have an event wired for ToolExecuted and other events and after I call Cancel the process does not cancel, ToolExecuted is not called and eventually it will finish processing and call to ToolExecuted is made with status 'success' so know its wired right.

here are some events that I've wired

            Geoprocessor.MessagesCreated += new EventHandler<MessagesCreatedEventArgs>(Geoprocessor_MessagesCreated);
            Geoprocessor.ToolExecuting += new EventHandler<ToolExecutingEventArgs>(Geoprocessor_ToolExecuting);
            Geoprocessor.ToolExecuted += new EventHandler<ToolExecutedEventArgs>(Geoprocessor_ToolExecuted);
0 Kudos
0 Replies