C# 클래스 AvalonStudio.TextEditor.Document.TextAnchor

The TextAnchor class references an offset (a position between two characters). It automatically updates the offset when text is inserted/removed in front of the anchor.

Use the Offset property to get the offset from a text anchor. Use the TextDocument.CreateAnchor method to create an anchor from an offset.

The document will automatically update all text anchors; and because it uses weak references to do so, the garbage collector can simply collect the anchor object when you don't need it anymore.

Moreover, the document is able to efficiently update a large number of anchors without having to look at each anchor object individually. Updating the offsets of all anchors usually only takes time logarithmic to the number of anchors. Retrieving the Offset property also runs in O(lg N).

If you want to track a segment, you can use the AnchorSegment class which implements ISegment using two text anchors.

상속: ITextAnchor
파일 보기 프로젝트 열기: VitalElement/AvalonStudio 1 사용 예제들

공개 메소드들

메소드 설명
ToString ( ) : string

비공개 메소드들

메소드 설명
OnDeleted ( DelayedEvents delayedEvents ) : void
TextAnchor ( TextDocument document ) : System

메소드 상세

ToString() 공개 메소드

public ToString ( ) : string
리턴 string