Class LevelLocation
Represents a location inside an IAbstractMarkupDataContainer.
Inheritance
Implements
Inherited Members
Namespace: Sdl.FileTypeSupport.Framework.BilingualApi
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()
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.
LevelLocation(IAbstractMarkupDataContainer, Int32)
Creates from specific parent and index values.
Declaration
public LevelLocation(IAbstractMarkupDataContainer parent, int index)
Parameters
Type | Name | Description |
---|---|---|
IAbstractMarkupDataContainer | parent | |
Int32 | index |
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.
LevelLocation(LevelLocation)
Creates from the values used in another object.
Declaration
public LevelLocation(LevelLocation other)
Parameters
Type | Name | Description |
---|---|---|
LevelLocation | other |
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.
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 |
---|---|
Int32 |
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.
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 |
---|---|
Boolean |
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.
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 |
---|---|
Boolean |
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.
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 |
---|---|
Boolean |
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.
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 |
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.
Parent
The container that this location refers to a position inside.
Declaration
public IAbstractMarkupDataContainer Parent { get; set; }
Property Value
Type | Description |
---|---|
IAbstractMarkupDataContainer |
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.
Methods
Clone()
Create a shallow clone.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object |
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.
Equals(Object)
Compares all properties.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
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.
GetHashCode()
Calculated from index and parent properties
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
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.
ToString()
Overridden to provide more intuitive information for use in the debugger
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
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.