Class LevelLocation
Represents a location inside an IAbstractMarkupDataContainer.
Implements
Inherited Members
Namespace: SdlSdl.FileTypeSupportFrameworkBilingualApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public class LevelLocation : ICloneable
Remarks
The Parent property specifies the parent container,
and the Index property represents the item index
in the container. An index of 0 indicates a position between the
first item in the parent, and an index of Parent.Count
indicates a
position after the last item.
If you need to refer to an item in a nested container, use a Location instead.
Since the position includes an index into the parent, if the content of the parent changes (e.g. new items are inserted, or existing ones removed or replaced), the position may no longer point to the same item.
Use a location marker instead if you need to refer to a specific location that may change as part of operations on the data.
Constructors
LevelLocation()
Creates an uninitialized object.
Declaration
public LevelLocation()
LevelLocation(IAbstractMarkupDataContainer, int)
Creates from specific parent and index values.
Declaration
public LevelLocation(IAbstractMarkupDataContainer parent, int index)
Parameters
Type | Name | Description |
---|---|---|
IAbstractMarkupDataContainer | parent | |
int | index |
LevelLocation(LevelLocation)
Creates from the values used in another object.
Declaration
public LevelLocation(LevelLocation other)
Parameters
Type | Name | Description |
---|---|---|
LevelLocation | other |
Properties
Index
The index in the parent collection that defines the location.
Index 0 refers to the location before the first item in the collection. The index Parent.Count indicates a location after the last item in the collection.
Declaration
public int Index { get; set; }
Property Value
Type | Description |
---|---|
int |
IsAtEndOfParent
True if the location is valid and refers to the position after the last item in the parent
Declaration
public bool IsAtEndOfParent { get; }
Property Value
Type | Description |
---|---|
bool |
IsAtStartOfParent
True if the location is valid and refers to the first item in the parent
Declaration
public bool IsAtStartOfParent { get; }
Property Value
Type | Description |
---|---|
bool |
IsValid
The location is valid if the parent is set, and the index is a value within the range: 0 <= index <= Parent.Content.Count
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
ItemAtLocation
Returns the item with the same index in the parent collection as the Index of this location, or null if there is no item with that index (e.g. if the index indicates a position after the last item in the collection).
Declaration
public IAbstractMarkupData ItemAtLocation { get; }
Property Value
Type | Description |
---|---|
IAbstractMarkupData |
Parent
The container that this location refers to a position inside.
Declaration
public IAbstractMarkupDataContainer Parent { get; set; }
Property Value
Type | Description |
---|---|
IAbstractMarkupDataContainer |
Methods
Clone()
Create a shallow clone.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
object |
Equals(object)
Compares all properties.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
GetHashCode()
Calculated from index and parent properties
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
ToString()
Overridden to provide more intuitive information for use in the debugger
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |