Hi,
I have below code part which identifies the MapTool and execute it through ICommand object. But after I am done with the purpose how to stop the execution?
variCommand=FrameworkApplication.GetPlugInWrapper(commandId)asICommand;if(iCommand!=null) {// Let ArcGIS Pro do the work for usif(iCommand.CanExecute(null)) {iCommand.Execute(null); } }
The above code launch MapTool so I want to stop it from code as well.
An ICommand is something that starts and runs until it is done. If this is your constraint, you may need a second ICommand object to do the stopping.
There is also an ITool interface which has a Deactivate function, if you can change your design.
Good Luck
Brent Hoskisson