示例#1
0
 /// <summary>
 /// Creates a new AnchorSegment that creates new anchors.
 /// </summary>
 public RenameSegment(TextDocument document, int offset, int length)
 {
     _start = document?.CreateAnchor(offset) ?? throw new ArgumentNullException(nameof(document));
     _start.SurviveDeletion = true;
     _start.MovementType    = AnchorMovementType.BeforeInsertion;
     _end = document.CreateAnchor(offset + length);
     _end.SurviveDeletion = true;
     _end.MovementType    = AnchorMovementType.AfterInsertion;
 }
示例#2
0
 public ITextAnchor CreateAnchor(int offset)
 {
     return(new AnchorAdapter(document.CreateAnchor(offset)));
 }