示例#1
0
        private void errorDoubleClick(object sender, MouseEventArgs args)
        {
            DataGridRow  row    = sender as DataGridRow;
            CompileError result = row.DataContext as CompileError;
            IDEEditor    editor = ideTabs.OpenFile(new FileLeafItem {
                Path = result.File,
                Name = result.File.Replace(IDEProject.inst().ProjectDir, "")
            });

            if (result.Line != -1)
            {
                editor.Editor.TextArea.Caret.Line = result.Line;
                editor.Editor.ScrollToLine(result.Line);
            }
        }
        public void Draw(TextView textView, System.Windows.Media.DrawingContext drawingContext)
        {
            if (pen == null)
            {
                pen = new Pen(textView.FindResource("WavyBrush") as Brush, 4);
            }
            Size renderSize = textView.RenderSize;

            if (textView != null && textView.VisualLinesValid)
            {
                foreach (VisualLine line in textView.VisualLines)
                {
                    CompileError err = IDEProject.inst().CompileErrors.FirstOrDefault(l => l.Line == line.FirstDocumentLine.LineNumber && l.File.Equals(file.Path));
                    if (err != null)
                    {
                        drawingContext.DrawLine(pen,
                                                new Point(0, line.VisualTop + line.Height - textView.ScrollOffset.Y),
                                                new Point(renderSize.Width, line.VisualTop - textView.ScrollOffset.Y + line.Height));
                    }
                }
            }
        }