Click or drag to resize
Location Class
Represents a location inside a possibly nested IAbstractMarkupDataContainer collection.
Inheritance Hierarchy
SystemObject
  Sdl.FileTypeSupport.Framework.BilingualApiLocation

Namespace: Sdl.FileTypeSupport.Framework.BilingualApi
Assembly: Sdl.FileTypeSupport.Framework.Core (in Sdl.FileTypeSupport.Framework.Core.dll) Version: 1.0.0.0 (1.0.2551.0)
Syntax
public class Location : ICloneable

The Location type exposes the following members.

Constructors
  NameDescription
Public methodLocation
Default constructor
Public methodLocation(LevelLocation)
Initializes the location with one level only. This generates a location that is equivalent to the passed-in LevelLocation.
Public methodLocation(Location)
Creates a deep clone
Public methodLocation(IAbstractMarkupDataContainer, IAbstractMarkupData)
Creates a location that corresponds to the position of the item with regards to the specified root container.
Public methodLocation(IAbstractMarkupDataContainer, Boolean)
Initialize the location to the first or last position in the specified root container.
Top
Properties
  NameDescription
Public propertyBottomLevel
Quick access to the most specific level
Public propertyDepth
Returns the number of levels in the location.
Public propertyIsAtEnd
Public propertyIsAtStart
Public propertyIsValid
True if all levels are valid locations and each level corresponds to the location defined in the parent layer.
Public propertyItemAtLocation
Returns the item at the location specified by the bottom level. If the location is not valid, or if there is not item at the location (i.e. if it is a location after the last element in a collection), this property returns null.
Public propertyLevels
Provides access to the actual collection of levels that this location represents.
Top
Methods
  NameDescription
Public methodClone
Creates a deep clone of this object.
Public methodEquals
Returns true if this location refers to the same position as the other location.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Returns the hash code of the levels in this location.
(Overrides ObjectGetHashCode.)
Public methodMoveFirstChild
Changes the location to refer to the position just before the first child node of the item at the current location. If no child node is available (i.e. the current location does not refer to a node that is an IAbstractMarkupDataContainer), the location is not changed, and this method returns false. Note that if the item at the current location is a container, but it has no content, the location is still advanced to a location at the index 0 inside the collection, as it is possible to insert new content there.
Public methodMoveLastChild
Changes the location to just behind the last child node of the item at the current location. If no child node is available (i.e. the current location does not refer to a node that is an IAbstractMarkupDataContainer), the location is not changed, and this method returns false. Note that if the item at the current location is a container, but it has no content, the location is still advanced to a location at the index 0 inside the collection, as it is possible to insert new content there.
Public methodMoveNext
Advances to the next possible location. This will move to the next available position according to the following priority list:
  • First child
  • Next Sibling
  • Next Parent Sibling
If no such location is available (i.e. the location is currently behind the last item in the top level), the location is not changed, and the method returns false. If the location is invalid, the behavior is undefined and exceptions may be thrown.
Public methodMoveNextSibling
Advance the location to the next sibling position in the current bottom layer. If no next sibling position is available (i.e. the location is already behind the last item in the parent collection), the location is not changed, and this method returns false.
Public methodMoveParent
Changes the location to refer to the position just before the parent of the current bottom level location. If no parent location is available (i.e. the location is already in the top layer), the location is not changed, and this method returns false.
Public methodMovePrevious
Moves the location to the preceding available position according to the following priority list:
  • Previous Sibling Last Child
  • Previous Sibling
  • Parent
If no parent is available (i.e. location is before the first item in the top level), the location is not changed, and the method returns false.
Public methodMovePreviousSibling
Moves the location to the preceding sibling position in the current bottom layer. If no previous sibling location is available (i.e. the current location is already at the start of the parent collection), the location is not changed, and this method returns false.
Public methodToString
Overridden to provide more useful information while debugging
(Overrides ObjectToString.)
Top
Remarks

The parent in the top level location (index 0) is the root container (often IParagraph or ISegment). The BottomLevel is the location in the lowest level.

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments