Class TextLocation
Reference to a location inside the bilingual content model that may be inside a text node
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 |
---|---|---|
IAbstract |
item |
TextLocation(IText, int)
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
TextLocation(Location, int)
Initializes using the specified location and text offset.
Declaration
public TextLocation(Location location, int textOffset)
Parameters
TextLocation(TextLocation)
Protected constructor used in cloning
Declaration
protected TextLocation(TextLocation other)
Parameters
Type | Name | Description |
---|---|---|
Text |
other |
Properties
IsValid
True
if the text location is a valid location
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Location
The location of the item referred to. If this is an IText the
Text
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 |
---|---|
int |
Methods
Clone()
Returns a deep clone of the object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
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 |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
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 |
---|---|
int |
Overrides
ToString()
Should be used for debugging purposes only.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |