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

            _service = service;
            StartOffset = startOffset;
            Length = length;
        }
Esempio n. 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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 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);
                }
            });
        }
Esempio n. 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);
                }
            });
        }
Esempio n. 6
0
 public BookmarkManager(TextMarkerService textMarkerService)
 {
     _bookmarks         = new ObservableCollection <Bookmark>();
     _textMarkerService = textMarkerService;
 }
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, CodeEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor = editor;
 }
Esempio n. 8
0
 public BookmarkManager(TextMarkerService textMarkerService)
 {
     _bookmarks = new ObservableCollection<Bookmark>();
     _textMarkerService = textMarkerService;
 }
Esempio n. 9
0
 public TextMarkerToolTipProvider(TextMarkerService textMarkerService, CodeEditor editor)
 {
     _textMarkerService = textMarkerService;
     _editor            = editor;
 }