Beispiel #1
0
        public TextMarker(TextMarkerService service, int startOffset, int length)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            _service = service;
            StartOffset = startOffset;
            Length = length;
        }
Beispiel #2
0
        public Bookmark(BookmarkType bookmarkType, TextMarkerService textMarkerService, int lineNumber, int column, int startOffset, int length, string message, string fileName)
        {
            BookmarkType = bookmarkType;
            LineNumber = lineNumber;
            Message = message;

            _textMarkerService = textMarkerService;
            _errorList = IoC.Get<IErrorList>();

            InitializeBookmark(textMarkerService, lineNumber, column, startOffset, length, message, fileName);
        }
        public RunbookView()
        {
            InitializeComponent();
            //Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));

            _textMarkerService = new TextMarkerService(TextEditor);
            TextEditor.TextArea.TextView.BackgroundRenderers.Add(_textMarkerService);
            TextEditor.TextArea.TextView.LineTransformers.Add(_textMarkerService);

            TextEditor.MouseRightButtonDown += OnMouseRightButtonDown;
        }
Beispiel #4
0
        private void InitializeBookmark(TextMarkerService textMarkerService, int lineNumber, int column, int startOffset, int length, string message, string fileName)
        {
            // Create a text marker
            OffsetInLine = column;
            TextMarker   = textMarkerService.TryCreate(startOffset, length);

            if (TextMarker != null)
            {
                switch (BookmarkType)
                {
                case BookmarkType.AnalyzerInfo:
                    TextMarker.MarkerColor = Colors.AliceBlue;
                    break;

                case BookmarkType.AnalyzerWarning:
                    TextMarker.MarkerColor = Colors.DarkGoldenrod;
                    break;
                }
            }

            var errorListItemType = default(ErrorListItemType);

            switch (BookmarkType)
            {
            case BookmarkType.AnalyzerInfo:
                errorListItemType = ErrorListItemType.Message;
                break;

            case BookmarkType.AnalyzerWarning:
                errorListItemType = ErrorListItemType.Warning;
                break;
            }

            // Create an error list item
            Execute.OnUIThread(() =>
            {
                lock (_lock)
                {
                    ErrorListItem = new ErrorListItem(errorListItemType, _errorList.Items.Count, message, fileName, lineNumber, column);
                    _errorList.Items.Add(ErrorListItem);
                }
            });
        }
Beispiel #5
0
        private void InitializeBookmark(TextMarkerService textMarkerService, int lineNumber, int column, int startOffset, int length, string message, string fileName)
        {
            // Create a text marker
            OffsetInLine = column;
            TextMarker = textMarkerService.TryCreate(startOffset, length);

            if (TextMarker != null)
            {
                switch (BookmarkType)
                {
                    case BookmarkType.AnalyzerInfo:
                        TextMarker.MarkerColor = Colors.AliceBlue;
                        break;
                    case BookmarkType.AnalyzerWarning:
                        TextMarker.MarkerColor = Colors.DarkGoldenrod;
                        break;
                }
            }

            var errorListItemType = default(ErrorListItemType);

            switch (BookmarkType)
            {
                case BookmarkType.AnalyzerInfo:
                    errorListItemType = ErrorListItemType.Message;
                    break;
                case BookmarkType.AnalyzerWarning:
                    errorListItemType = ErrorListItemType.Warning;
                    break;
            }

            // Create an error list item
            Execute.OnUIThread(() =>
            {
                lock (_lock)
                {
                    ErrorListItem = new ErrorListItem(errorListItemType, _errorList.Items.Count, message, fileName, lineNumber, column);
                    _errorList.Items.Add(ErrorListItem);
                }
            });
        }
 public BookmarkManager(TextMarkerService textMarkerService)
 {
     _bookmarks         = new ObservableCollection <Bookmark>();
     _textMarkerService = textMarkerService;
 }
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, CodeEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor = editor;
 }
 public BookmarkManager(TextMarkerService textMarkerService)
 {
     _bookmarks = new ObservableCollection<Bookmark>();
     _textMarkerService = textMarkerService;
 }
Beispiel #9
0
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, CodeEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor            = editor;
 }