I'm using ReplaceMouseTool(typeof(GoToolLinkingNew),myNewLinkingTool) and it works great... But just for the first time. From the second time and on when i replace the mouse tool it still uses the first one even if i set it to null!!!.
ReplaceMouseTool(typeof(GoToolLinkingNew), new GraphViewLinkingNewTool(this));
you have to do:
ReplaceMouseTool(typeof(GraphViewLinkingNewTool), null);
to remove it.
or... FindMouseTool actually gives you the option to search for a subclass of the type
ReplaceMouseTool(typeof(GoToolLinkingNew), new GraphViewLinkingNewTool(this)); IGoTool t = FindMouseTool(typeof(GoToolLinkingNew), true); ReplaceMouseTool(t.GetType(), null);
So, In my case, when i try to replace the linking tool with the same type (myLinkingTool) but another instance it has no effect because you see that the type is the same and ignore it… Am i correct? if so, then i must find other ways to replace the tool behavior.
Thanks,
Adi