CreateAnchor() public method

Creates a new TextAnchor at the specified offset.
public CreateAnchor ( int offset ) : TextAnchor
offset int
return TextAnchor
Beispiel #1
0
 /// <summary>
 ///     Creates a new AnchorSegment that creates new anchors.
 /// </summary>
 public AnchorSegment(TextDocument document, int offset, int length)
 {
     if (document == null)
     {
         throw new ArgumentNullException("document");
     }
     start = document.CreateAnchor(offset);
     start.SurviveDeletion = true;
     start.MovementType    = AnchorMovementType.AfterInsertion;
     end = document.CreateAnchor(offset + length);
     end.SurviveDeletion = true;
     end.MovementType    = AnchorMovementType.BeforeInsertion;
 }