예제 #1
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            int line = GetLineFromMousePosition(e);

            if (!e.Handled && dragDropBookmark != null)
            {
                if (dragStarted)
                {
                    if (line != 0)
                    {
                        dragDropBookmark.Drop(line);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && line != 0)
            {
                IBookmark bm = GetBookmarkFromLine(line);
                if (bm != null)
                {
                    bm.MouseUp(e);
                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left && TextView != null)
                {
                    // no bookmark on the line: create a new breakpoint
                    ITextEditor textEditor = TextView.Services.GetService(typeof(ITextEditor)) as ITextEditor;
                    if (textEditor != null)
                    {
                        DebuggerService.ToggleBreakpointAt(textEditor, line, typeof(BreakpointBookmark));
                        return;
                    }

                    // create breakpoint for the other posible active contents
                    var viewContent = WorkbenchSingleton.Workbench.ActiveContent as AbstractViewContentWithoutFile;
                    if (viewContent != null)
                    {
                        textEditor = viewContent.Services.GetService(typeof(ITextEditor)) as ITextEditor;
                        if (textEditor != null)
                        {
                            DebuggerService.ToggleBreakpointAt(textEditor, line, typeof(DecompiledBreakpointBookmark));
                            return;
                        }
                    }
                }
            }
        }
예제 #2
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            int line = GetLineFromMousePosition(e);

            if (!e.Handled && dragDropBookmark != null)
            {
                if (dragStarted)
                {
                    if (line != 0)
                    {
                        dragDropBookmark.Drop(line);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && line != 0)
            {
                var bm = GetBookmarkFromLine(line);
                if (bm != null)
                {
                    bm.MouseUp(e);

                    if (bm is BookmarkBase)
                    {
                        if ((bm as BookmarkBase).CanToggle)
                        {
                            BookmarkManager.RemoveMark(bm as BookmarkBase);
                            InvalidateVisual();
                        }
                    }
                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left)
                {
                    // see IBookmarkActionEntry interface
                }
                InvalidateVisual();
            }
        }
예제 #3
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            int line = GetLineFromMousePosition(e);

            if (!e.Handled && dragDropBookmark != null)
            {
                if (dragStarted)
                {
                    if (line != 0)
                    {
                        dragDropBookmark.Drop(line);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && line != 0)
            {
                IBookmark bm = GetBookmarkFromLine(line);
                if (bm != null)
                {
                    bm.MouseUp(e);
                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left && TextView != null)
                {
                    // no bookmark on the line: create a new breakpoint
                    ITextEditor textEditor = TextView.GetService(typeof(ITextEditor)) as ITextEditor;
                    if (textEditor != null)
                    {
                        SD.Debugger.ToggleBreakpointAt(textEditor, line);
                        return;
                    }
                }
            }
        }
예제 #4
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            var lineFromMousePosition = GetLineFromMousePosition(e);

            if (!e.Handled && _dragDropBookmark != null)
            {
                if (_dragStarted)
                {
                    if (lineFromMousePosition != 0)
                    {
                        _dragDropBookmark.Drop(lineFromMousePosition);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && lineFromMousePosition != 0)
            {
                var bookmarkFromLine = GetBookmarkFromLine(lineFromMousePosition);
                if (bookmarkFromLine != null)
                {
                    bookmarkFromLine.MouseUp(e);
                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left && TextView != null)
                {
                    var textEditor = TextView.Services.GetService(typeof(ITextEditor)) as ITextEditor;
                    if (textEditor != null)
                    {
                    }
                }
            }
        }
예제 #5
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            int line = GetLineFromMousePosition(e);

            if (!e.Handled && dragDropBookmark != null)
            {
                if (dragStarted)
                {
                    if (line != 0)
                    {
                        dragDropBookmark.Drop(line);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && line != 0)
            {
                IBookmark bm = GetBookmarkFromLine(line);
                if (bm != null)
                {
                    bm.MouseUp(e);
                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left && TextView != null)
                {
                    // no bookmark on the line: create a new breakpoint

                    manager.AddBreakpoint(line);
                }
            }
        }
예제 #6
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
            int line = GetLineFromMousePosition(e);

            if (!e.Handled && dragDropBookmark != null)
            {
                if (dragStarted)
                {
                    if (line != 0)
                    {
                        dragDropBookmark.Drop(line);
                    }
                    e.Handled = true;
                }
                CancelDragDrop();
            }
            if (!e.Handled && line != 0)
            {
                BookmarkBase bm = GetBookmarkFromLine(line);
                if (bm != null)
                {
                    bm.MouseUp(e);

                    if (bm.CanToggle)
                    {
                        BookmarkManager.RemoveMark(bm);
                        InvalidateVisual();
                    }

                    if (e.Handled)
                    {
                        return;
                    }
                }
                if (e.ChangedButton == MouseButton.Left)
                {
                    if (DebugData.CodeMappings != null && DebugData.CodeMappings.Count > 0)
                    {
                        // check if the codemappings exists for this line
                        var storage = DebugData.CodeMappings;
                        int token   = 0;
                        foreach (var key in storage.Keys)
                        {
                            var instruction = storage[key].GetInstructionByLineNumber(line, out token);

                            if (instruction == null)
                            {
                                continue;
                            }

                            // no bookmark on the line: create a new breakpoint
                            DebuggerService.ToggleBreakpointAt(
                                DebugData.DecompiledMemberReferences[key],
                                line,
                                instruction.ILInstructionOffset,
                                DebugData.Language);
                            break;
                        }

                        if (token == 0)
                        {
                            MessageBox.Show(string.Format("Missing code mappings at line {0}.", line),
                                            "Code mappings", MessageBoxButton.OK, MessageBoxImage.Information);
                            return;
                        }
                    }
                }
                InvalidateVisual();
            }
        }