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

A segment that can be put into a TextSegmentCollection{T}.

A TextSegment can be stand-alone or part of a TextSegmentCollection{T}. If the segment is stored inside a TextSegmentCollection, its Offset and Length will be updated by that collection.

When the document changes, the offsets of all text segments in the TextSegmentCollection will be adjusted accordingly. Start offsets move like AnchorMovementType.AfterInsertion, end offsets move like AnchorMovementType.BeforeInsertion (i.e. the segment will always stay as small as possible).

If a document change causes a segment to be deleted completely, it will be reduced to length 0, but segments are never automatically removed from the collection. Segments with length 0 will never expand due to document changes, and they move as AfterInsertion.

Thread-safety: a TextSegmentCollection that is connected to a TextDocument may only be used on that document's owner thread. A disconnected TextSegmentCollection is safe for concurrent reads, but concurrent access is not safe when there are writes. Keep in mind that reading the Offset properties of a text segment inside the collection is a read access on the collection; and setting an Offset property of a text segment is a write access on the collection.

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

Private Properties

프로퍼티 타입 설명
ToDebugString string

공개 메소드들

메소드 설명
ToString ( ) : string

보호된 메소드들

메소드 설명
OnSegmentChanged ( ) : void

This method gets called when the StartOffset/Length/EndOffset properties are set. It is not called when StartOffset/Length/EndOffset change due to document changes

비공개 메소드들

메소드 설명
ToDebugString ( ) : string

메소드 상세

OnSegmentChanged() 보호된 메소드

This method gets called when the StartOffset/Length/EndOffset properties are set. It is not called when StartOffset/Length/EndOffset change due to document changes
protected OnSegmentChanged ( ) : void
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string