Class NavigationNodePath
- Namespace
- Dynamicweb.CoreUI.Navigation
- Assembly
- Dynamicweb.CoreUI.dll
public sealed class NavigationNodePath : IEquatable<NavigationNodePath>
- Inheritance
-
NavigationNodePath
- Implements
- Inherited Members
Constructors
NavigationNodePath()
Constructs an empty path.
public NavigationNodePath()
NavigationNodePath(IEnumerable<string?>?)
Constructs a new path from the given segments.
public NavigationNodePath(IEnumerable<string?>? segments)
Parameters
segments
IEnumerable<string>List of segments that make up the path.
NavigationNodePath(string?)
Constructs a new path from the given path string.
public NavigationNodePath(string? path)
Parameters
path
stringThe path string to construct the NavigationNodePath from.
Properties
First
Gets the first segment in the path.
public string First { get; }
Property Value
IsEmpty
Gets a value indicating whether the path is empty. Equivalent to "SegmentCount == 0."
public bool IsEmpty { get; }
Property Value
Last
Gets the last segment in the path.
public string Last { get; }
Property Value
Path
Gets the path consisting of all segments joined by the path delimiter. Path starts with the delimiter.
public string Path { get; }
Property Value
SegmentCount
Gets the number of segments in the path.
public int SegmentCount { get; }
Property Value
Segments
Gets the list of segments in the path.
public IEnumerable<string> Segments { get; }
Property Value
Methods
ElementAtPosition(int)
Gets the element at the given position or null
.
public string? ElementAtPosition(int position)
Parameters
position
intThe 1-based position.
Returns
- string
The element at the position if it exists; otherwise
null
.
Equals(NavigationNodePath?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NavigationNodePath? other)
Parameters
other
NavigationNodePathAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
NewWithSegment(string?)
Creates a new NavigationNodePath with the given segment appended.
public NavigationNodePath? NewWithSegment(string? segment)
Parameters
segment
stringThe new segment.
Returns
- NavigationNodePath
A new NavigationNodePath with the given segment appended.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToTrimmedString()
Gets the path without the starting or ending delimiter.
public string ToTrimmedString()
Returns
- string
The trimmed path.