Пример #1
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);
                }
            });
        }
Пример #2
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);
                }
            });
        }