I'm building a simple map interface on a .net component that I need to redistribute around.
Well, my initial thoughts was to create the tools just the way I'm used to do it in ArcMap, inheriting BaseTool and then set the MapControl.CurrentTool = tool in my onclick form events.
What is the best way to accomplish this? This one?
Also, how can I pass the hook to those tools? I'm using this class:
public class CommandPoolManager
{
public ICommandPool _CommandPool;
public ICommandPoolEdit GetCommandPoolEdit
{
get { return (ICommandPoolEdit)_CommandPool; }
}
public ICommandPool GetCommandPool
{
get { return this._CommandPool; }
}
public CommandPoolManager(object hook)
{
this._CommandPool = new CommandPoolClass();
ICommandPoolEdit commandPoolEdit = (ICommandPoolEdit)this._CommandPool;
commandPoolEdit.SetHook(hook);
}
public void AddCommandToPool(ICommand command)
{
ICommandPoolEdit commandPoolEdit = GetCommandPoolEdit;
commandPoolEdit.AddCommand(command,null);
commandPoolEdit.CallOnCreate(command);
}
public void AddCommandToPool(ICommand command,UID uid)
{
ICommandPoolEdit commandPoolEdit = GetCommandPoolEdit;
commandPoolEdit.AddCommand(command, uid);
commandPoolEdit.CallOnCreate(command);
}
}
Would that be the correct way to use CommandPool? I'm without options for testing this, since it's a component to be distributed. The real question is: Am I on the right track?