Exemplo n.º 1
0
        private void MakeStateOpen(CommandState commandDown, Point pt)
        {
            // Remove any tooltip
            KillTooltip();

            // If current command is not the new one, then revert it
            RevertCurrentCommandState(commandDown);

            // Make this the new command
            _currentCmdState = commandDown;

            // Do we have a valid command to open?
            if (_currentCmdState != null)
            {
                // Switch to the hot tracking mode
                _currentCmdState.State = ItemState.Open;

                // Make sure it is repainted
                Invalidate(_currentCmdState.DrawRect);

                // Cast to expected interface
                ICommandOpen commandOpen = commandDown.Command as ICommandOpen;

                // Ask the command to open itself now
                commandOpen.Open(pt);
            }
        }