Example #1
0
        public static bool HasBPAtCurrentCaretPosition()
        {
            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return(false);
            }
            var location = textView.TextEditor.TextArea.Caret.Location;

            return(BreakpointHelper.GetBreakpointBookmarks(textView, location.Line, location.Column).Count != 0);
        }
Example #2
0
        public void Initialize(TextViewContext context, MenuItem menuItem)
        {
            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return;
            }
            var location = textView.TextEditor.TextArea.Caret.Location;
            var bpms     = BreakpointHelper.GetBreakpointBookmarks(textView, location.Line, location.Column);

            EnableAndDisableBreakpointCommand.InitializeMenuItem(bpms, menuItem, BackgroundType.ContextMenuItem);
        }
Example #3
0
        public static bool DebugToggleBreakpoint()
        {
            if (DebuggerService.CurrentDebugger != null)
            {
                var textView = MainWindow.Instance.ActiveTextView;
                if (textView == null)
                {
                    return(false);
                }
                var location = textView.TextEditor.TextArea.Caret.Location;
                BreakpointHelper.Toggle(textView, location.Line, location.Column);
                return(true);
            }

            return(false);
        }
Example #4
0
        public static bool DebugEnableDisableBreakpoint()
        {
            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return(false);
            }
            var  location  = textView.TextEditor.TextArea.Caret.Location;
            var  bpms      = BreakpointHelper.GetBreakpointBookmarks(textView, location.Line, location.Column);
            bool isEnabled = bpms.IsEnabled();

            foreach (var bpm in bpms)
            {
                bpm.IsEnabled = !isEnabled;
            }
            return(bpms.Count > 0);
        }
Example #5
0
        public void Initialize(TextViewContext context, MenuItem menuItem)
        {
            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return;
            }
            var location = textView.TextEditor.TextArea.Caret.Location;
            var bpms     = BreakpointHelper.GetBreakpointBookmarks(textView, location.Line, location.Column);

            if (bpms.Count == 0)
            {
                menuItem.Header = "_Add Breakpoint";
            }
            else if (bpms.IsEnabled())
            {
                menuItem.Header = bpms.Count == 1 ? "D_elete Breakpoint" : "D_elete Breakpoints";
            }
            else
            {
                menuItem.Header = bpms.Count == 1 ? "_Enable Breakpoint" : "_Enable Breakpoints";
            }
        }
Example #6
0
 public void Execute(DecompilerTextView textView, int line)
 {
     BreakpointHelper.Toggle(textView, line, 0);
 }