|
|
|
@ -54,6 +54,12 @@ namespace ICSharpCode.AvalonEdit.AddIn |
|
|
|
#region ITextMarkerService
|
|
|
|
#region ITextMarkerService
|
|
|
|
public ITextMarker Create(int startOffset, int length) |
|
|
|
public ITextMarker Create(int startOffset, int length) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
int textLength = codeEditor.Document.TextLength; |
|
|
|
|
|
|
|
if (startOffset < 0 || startOffset > textLength) |
|
|
|
|
|
|
|
throw new ArgumentOutOfRangeException("startOffset", startOffset, "Value must be between 0 and " + textLength); |
|
|
|
|
|
|
|
if (length < 0 || startOffset + length > textLength) |
|
|
|
|
|
|
|
throw new ArgumentOutOfRangeException("length", length, "length must not be negative and startOffset+length must not be after the end of the document"); |
|
|
|
|
|
|
|
|
|
|
|
TextMarker m = new TextMarker(this, startOffset, length); |
|
|
|
TextMarker m = new TextMarker(this, startOffset, length); |
|
|
|
markers.Add(m); |
|
|
|
markers.Add(m); |
|
|
|
// no need to mark segment for redraw: the text marker is invisible until a property is set
|
|
|
|
// no need to mark segment for redraw: the text marker is invisible until a property is set
|
|
|
|
|