Tools implementations

Nov 21, 2006 at 4:35 PM
Hi,
I was looking at the implementation of the various tool in sharpmap MapImage.
I've done something similar in a project.
The very different things i've done is that al tools are developed as classes that implements a common interface(in my case called IBehaviour).
This interface exposes all the mouse events as method that the tool need to implements plus other services method(attack and detach that are used to capture the map control reference and to setup mouse cursors).
So you could put out of the mapImage implementation all this code and isolate it into simple and small classes.
Also, in this way, if a user want to implement a custom tool it can be done by simply developing a class that react to the user action via the aforementioned interface.