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()
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
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 |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text 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 | |
Int32 | offsetIntoText |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
TextLocation(Location, Int32)
Initializes using the specified location and text offset.
Declaration
public TextLocation(Location location, int textOffset)
Parameters
Type | Name | Description |
---|---|---|
Location | location | |
Int32 | textOffset |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
TextLocation(TextLocation)
Protected constructor used in cloning
Declaration
protected TextLocation(TextLocation other)
Parameters
Type | Name | Description |
---|---|---|
TextLocation | other |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
Properties
IsValid
True
if the text location is a valid location
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
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 |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
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 |
---|---|
Int32 |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
Methods
Clone()
Returns a deep clone of the object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object |
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
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 |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
GetHashCode()
Hash code is computed by combining the hashes of the location and the text offset.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.
ToString()
Should be used for debugging purposes only.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Remarks
Consists of a Location and a text offset (0-based). The text offset is used only when the location references a text item.