Beispiel #1
0
        public DebuggerResumeAction Show()
        {
            A.InvokeCode("Get-PSBreakpoint -Variable daf01ff6-f004-43bd-b6bf-cf481e9333d3 | Remove-PSBreakpoint");

            if (OnView == null)
            {
                _View.Disabled = true;
            }
            else
            {
                _View.ButtonClicked += OnView;
            }

            switch (_LastAction)
            {
            case DebuggerResumeAction.StepInto: _Dialog.Focused = _Step; break;

            case DebuggerResumeAction.StepOver: _Dialog.Focused = _Over; break;
            }

            while (_Dialog.Show())
            {
                if (_Dialog.Selected == _Step)
                {
                    _LastAction = DebuggerResumeAction.StepInto;
                    return(DebuggerResumeAction.StepInto);
                }

                if (_Dialog.Selected == _Over)
                {
                    _LastAction = DebuggerResumeAction.StepOver;
                    return(DebuggerResumeAction.StepOver);
                }

                if (_Dialog.Selected == _Out)
                {
                    return(DebuggerResumeAction.StepOut);
                }

                if (_Dialog.Selected == _Console)
                {
                    var console = Interactive.Create(false);
                    console.Editor.Open(OpenMode.Modal);
                    continue;
                }

                if (_Dialog.Selected == _Edit)
                {
                    if (_List2.Items.Count > 0)
                    {
                        IEditor editor = Far.Api.CreateEditor();
                        editor.FileName = _InvocationInfo.ScriptName;
                        editor.IsLocked = true;
                        editor.GoToLine(_InvocationInfo.ScriptLineNumber - 1);
                        editor.Open(OpenMode.Modal);
                    }
                    continue;
                }

                if (_Dialog.Selected == _Quit)
                {
                    return(DebuggerResumeAction.Stop);                    //throw new PipelineStoppedException();
                }
            }

            return(DebuggerResumeAction.Continue);
        }