コード例 #1
0
        private void LoadErrors(IEnumerable <CompilationError> errors)
        {
            _syntaxEditor.Document.SpanIndicatorLayers.Clear();
            if (errors != null)
            {
                SpanIndicatorLayer spanIndicatorLayer = new SpanIndicatorLayer(null, 0);
                _syntaxEditor.Document.SpanIndicatorLayers.Add(spanIndicatorLayer);

                foreach (CompilationError error in errors)
                {
                    if (error.SourceRange != SourceRange.None)
                    {
                        TextRange       textRange          = GetTextRange(error.SourceRange);
                        SpanIndicator[] existingIndicators = spanIndicatorLayer.GetIndicatorsForTextRange(textRange);
                        if (existingIndicators.Length == 0)
                        {
                            SyntaxErrorSpanIndicator errorIndicator = new SyntaxErrorSpanIndicator();
                            errorIndicator.Tag = error;
                            spanIndicatorLayer.Add(errorIndicator, textRange);
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: ActiproLink.cs プロジェクト: chenzuo/nquery
		private void LoadErrors(IEnumerable<CompilationError> errors)
		{
			_syntaxEditor.Document.SpanIndicatorLayers.Clear();
			if (errors != null)
			{
				SpanIndicatorLayer spanIndicatorLayer = new SpanIndicatorLayer(null, 0);
				_syntaxEditor.Document.SpanIndicatorLayers.Add(spanIndicatorLayer);

				foreach (CompilationError error in errors)
				{
					if (error.SourceRange != SourceRange.None)
					{
						TextRange textRange = GetTextRange(error.SourceRange);
						SpanIndicator[] existingIndicators = spanIndicatorLayer.GetIndicatorsForTextRange(textRange);
						if (existingIndicators.Length == 0)
						{
							SyntaxErrorSpanIndicator errorIndicator = new SyntaxErrorSpanIndicator();
							errorIndicator.Tag = error;
							spanIndicatorLayer.Add(errorIndicator, textRange);
						}
					}
				}
			}
		}