protected int SwitchTrackingItem(int oldItem, int newItem)
{
// Create a graphics object for drawinh
using(Graphics g = this.CreateGraphics())
{
// Deselect the old draw command
if (oldItem != -1)
{
//DrawCommand dc = _drawCommands[oldItem] as DrawCommand;
// Draw old item not selected
DrawSingleCommand(g, _drawCommands[oldItem] as DrawCommand, false);
}
_trackItem = newItem;
// Select the new draw command
if (_trackItem != -1)
{
//DrawCommand dc = _drawCommands[_trackItem] as DrawCommand;
// Draw new item selected
DrawSingleCommand(g, _drawCommands[_trackItem] as DrawCommand, true);
}
}
return _trackItem;
}