ICSharpCode.AvalonEdit.Document.TextDocument.CreateAnchor C# (CSharp) Method

CreateAnchor() public method

Creates a new TextAnchor at the specified offset.
public CreateAnchor ( int offset ) : TextAnchor
offset int
return TextAnchor
        public TextAnchor CreateAnchor(int offset)
        {
            VerifyAccess();
            if (offset < 0 || offset > rope.Length) {
                throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + rope.Length.ToString(CultureInfo.InvariantCulture));
            }
            return anchorTree.CreateAnchor(offset);
        }

Usage Example

Esempio n. 1
0
 public AnchorSegment(TextDocument document, int offset, int length)
 {
     Debug.Assert(document != null);
     this.start = document.CreateAnchor(offset);
     this.start.SurviveDeletion = true;
     this.end = document.CreateAnchor(offset + length);
     this.end.SurviveDeletion = true;
 }
All Usage Examples Of ICSharpCode.AvalonEdit.Document.TextDocument::CreateAnchor