Async Geoprocessing problem with Cancel method

Discussion created by przemyslawt on Feb 5, 2014
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);