Class TextLocation
Reference to a location inside the bilingual content model that may be inside a text node
Inheritance
Implements
Inherited Members
Namespace: Sdl.FileTypeSupport.Framework.BilingualApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public class TextLocation : ICloneable
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
Constructors
TextLocation()
Constructs an uninitialized location object.
Declaration
public TextLocation()
TextLocation(IAbstractMarkupData)
Constructs from a markup data item; the location will reference the position just in front of the item.
Declaration
public TextLocation(IAbstractMarkupData item)
Parameters
Type | Name | Description |
---|---|---|
IAbstractMarkupData | item |
TextLocation(IText, Int32)
Constructs from a markup data text item; the location will reference the specified character offset into the text.
Declaration
public TextLocation(IText textItem, int offsetIntoText)
Parameters
Type | Name | Description |
---|---|---|
IText | textItem | |
System.Int32 | offsetIntoText |
TextLocation(Location, Int32)
Initializes using the specified location and text offset.
Declaration
public TextLocation(Location location, int textOffset)
Parameters
Type | Name | Description |
---|---|---|
Location | location | |
System.Int32 | textOffset |
TextLocation(TextLocation)
Protected constructor used in cloning
Declaration
protected TextLocation(TextLocation other)
Parameters
Type | Name | Description |
---|---|---|
TextLocation | other |
Properties
IsValid
True
if the text location is a valid location
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Location
The location of the item referred to. If this is an IText the TextOffset property determines the location inside that text. The root of the location should be a IParagraph container.
Declaration
public Location Location { get; set; }
Property Value
Type | Description |
---|---|
Location |
TextOffset
When the Location property refers to an IText item, this property indicates the 0-based character index inside the text that the text position refers to. This property should be a valid 0-based index into the text. It should be less than or equal to the number of characters in the text.
Declaration
public int TextOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Clone()
Returns a deep clone of the object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object |
Equals(Object)
Objects are considered equal if they refer to the same location and text offset.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Hash code is computed by combining the hashes of the location and the text offset.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToString()
Should be used for debugging purposes only.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |