public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (pguidCmdGroup == GuidList.guidIronStudioCmdSet)
            {
                switch (nCmdID)
                {
                case PkgCmdIDList.cmdidBreakRepl: BreakRepl(this, EventArgs.Empty); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidSmartExecute: SmartExecute(this, EventArgs.Empty); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidResetRepl: ResetRepl(this, EventArgs.Empty); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidReplHistoryNext: HistoryNext(this, EventArgs.Empty); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidReplHistoryPrevious: HistoryPrevious(this, EventArgs.Empty); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidReplClearScreen: _replWindow.ClearScreen(); return(VSConstants.S_OK);

                case PkgCmdIDList.cmdidBreakLine: _replWindow.BreakLine(); return(VSConstants.S_OK);
                }
            }
            else if (pguidCmdGroup == VSConstants.VSStd2K)
            {
                switch ((VSConstants.VSStd2KCmdID)nCmdID)
                {
                case VSConstants.VSStd2KCmdID.RETURN:
                    int res      = VSConstants.S_OK;
                    var position = _replWindow.CurrentView.Caret.Position.BufferPosition.GetContainingLine();
                    if (_commandService != null)
                    {
                        res = ((IOleCommandTarget)_commandService).Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
                    }
                    if (position.LineNumber < _replWindow.CurrentView.Caret.Position.BufferPosition.GetContainingLine().LineNumber)
                    {
                        _replWindow.TryExecuteInput();
                        _replWindow.Caret.EnsureVisible();
                    }
                    return(res);

                default:
                    Action action;
                    if (_commands2k.TryGetValue((VSConstants.VSStd2KCmdID)nCmdID, out action))
                    {
                        action();
                        return(VSConstants.S_OK);
                    }
                    break;
                }
            }
            else if (pguidCmdGroup == VSConstants.GUID_VSStandardCommandSet97)
            {
                Action action;
                if (_commands97.TryGetValue((VSConstants.VSStd97CmdID)nCmdID, out action))
                {
                    action();
                    return(VSConstants.S_OK);
                }
            }
            if (_commandService != null)
            {
                return(((IOleCommandTarget)_commandService).Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
            }

            return(VSConstants.S_OK);
        }