Assembly: PresentationFramework (in PresentationFramework.dll)
Gets aat the end of content in the text container associated with the current position.
Gets aat the beginning of content in the text container associated with the current position.
Gets a value that indicates whether the text container associated with the current position has a valid (up-to-date) layout.
Gets a value that indicates whether the current position is an insertion position.
Gets a value that indicates whether the current position is at the beginning of a line.
Gets the logical direction associated with the current position which is used to disambiguate content associated with the current position.
Gets the paragraph that scopes the current position, if any.
Gets the logical parent that scopes the current position.
Performs an ordinal comparison between the positions specified by the currentand a second specified .
Deletes the specified number of characters from the position indicated by the current.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Returns the element, if any, that borders the currentin the specified logical direction.
Returns a bounding box (Rect) for content that borders the current in the specified logical direction.
Serves as the default hash function. (Inherited from Object.)
Returns ato the closest insertion position in the specified logical direction.
Returns ato the beginning of a line that is specified relative to the current .
Returns ato the beginning of a line that is specified relative to the current , and reports how many lines were skipped.
Returns a pointer to the next symbol in the specified logical direction.
Returns ato the next insertion position in the specified logical direction.
Returns the count of symbols between the currentand a second specified .
Returns a category indicator for the content adjacent to the currentin the specified logical direction.
Returns ato the position indicated by the specified offset, in symbols, from the beginning of the current .
Returns ato the position indicated by the specified offset, in symbols, from the beginning of the current and in the specified direction.
Returns a string containing any text adjacent to the currentin the specified logical direction.
|GetTextInRun(LogicalDirection, array<Char>^, Int32, Int32)|
Copies the specified maximum number of characters from any adjacent text in the specified direction into a caller-supplied character array.
Returns the number of Unicode characters between the currentand the next non-text symbol, in the specified logical direction.
Inserts a line break at the current position.
Inserts a paragraph break at the current position.
Inserts the specified text into the text Run at the current position.
Indicates whether the specified position is in the same text container as the current position.
This type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.(Overrides Object::ToString().)
Theclass introduces the following terminology:
Position - Inherently, aalways points to a position in content. Such positions either fall between characters in the content, or between flow content element tags that define structure for the content.
Current Position - Because aalways indicates a position, and because many of the operations that can be performed through a are relative to the position currently pointed to by the , it makes sense to simply refer to the position indicated by a as the current position.
Insertion Position - An insertion position is a position where new content may be added without breaking any semantic rules for the associated content. In practice, an insertion position is anywhere in content where a caret may be positioned. An example of a valid Paragraph tags (that is, between the closing tag of the preceding paragraph and the opening tag of the next paragraph).position that is not an insertion position is the position between two adjacent
Symbol - For the purposes ofoperations that involve symbols, any of the following is considered to be a symbol:
An opening or closing tag for a TextElement element.
A UIElement element contained within an InlineUIContainer or BlockUIContainer. Note that such a UIElement is always counted as exactly one symbol; any additional content or elements contained by the UIElement are not counted as symbols.
Each 16-bit Unicode character inside of a text Run element.
Text Container - A text container is the element that forms the ultimate border for the flow content at hand; the position indicated by a FlowDocument or a TextBlock. Generally speaking, operations between instances in different text containers are not supported.always falls within a text container. Currently, a text container must be either a
The TextElement. Some of the operations that facilitates include the following:class is intended to facilitate traversal and manipulation of content that is represented by Windows Presentation Foundation (WPF) flow content elements; in general, such elements derive from
Perform an ordinal comparison of the current position with a second specified position. See the CompareTo method.
Get the text container that scopes the current document. See the Parent property.
Get a specified number of characters preceding or following the current position. See the GetTextInRun method.
Insert a string of characters at the current position. See the InsertTextInRun method.
Perform visual hit testing by translating between a Point representing relative coordinates.position and a
Find a nearby insertion position, or check whether the current position is an insertion position. See the GetInsertionPosition and GetNextInsertionPosition methods and the IsAtInsertionPosition property.
The position and LogicalDirection indicated by a object are immutable. When content is edited or modified, the position indicated by a does not change relative to the surrounding text; rather the offset of that position from the beginning of content is adjusted correspondingly to reflect the new relative position in content. For example, a that indicates a position at the beginning of a given paragraph continues to point to the beginning of that paragraph even when content is inserted or deleted before or after the paragraph.
Theclass does not provide any public constructors. An instance of is created by using properties or methods of other objects (including other objects). The following list provides a few examples of methods and properties that create and return a . This list is not exhaustive:
The following example demonstrates how to use a Run element in a specified text container.to find a position just inside of the first
The following example implements a simplistic find algorithm usingfacilities.
Available since 3.0
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.