Class ExtendedNamedPath
Represents a path with a named base path and an optional extended path component.
public class ExtendedNamedPath : IEquatable<ExtendedNamedPath>
- Inheritance
-
ExtendedNamedPath
- Implements
- Inherited Members
- Extension Methods
Constructors
ExtendedNamedPath()
Initializes a new instance of the ExtendedNamedPath class.
public ExtendedNamedPath()
ExtendedNamedPath(ExtendedNamedPath)
Copy constructor that performs a deep clone including the base named path.
public ExtendedNamedPath(ExtendedNamedPath src)
Parameters
src
ExtendedNamedPathThe source ExtendedNamedPath to copy from
ExtendedNamedPath(NamedPath)
Initializes a new instance of the ExtendedNamedPath class with only a base path.
public ExtendedNamedPath(NamedPath rootNamedPath)
Parameters
rootNamedPath
NamedPathThe base named path
ExtendedNamedPath(NamedPath, string)
Initializes a new instance of the ExtendedNamedPath class with a base path and extended path.
public ExtendedNamedPath(NamedPath rootNamedPath, string extendedPath)
Parameters
Properties
BaseNamedPath
Gets or sets the base named path component.
public NamedPath BaseNamedPath { get; set; }
Property Value
ExtendedPath
Gets or sets the extended path component that is appended to the base path. A null value is acceptable.
public string ExtendedPath { get; set; }
Property Value
FullPath
Gets the full path by combining the base path and extended path.
public string FullPath { get; }
Property Value
Remarks
If the base path is null, returns the extended path or an empty string if that is also null.
Methods
Equals(ExtendedNamedPath)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ExtendedNamedPath other)
Parameters
other
ExtendedNamedPathAn 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.
GetName(StringLocalizer)
Gets the display name of this path, optionally using a string localizer for the base path name.
public string GetName(StringLocalizer loc = null)
Parameters
loc
StringLocalizerOptional string localizer to translate the base path name
Returns
- string
The combined name of the base path and extended path, or the extended path alone if base path is null, or an empty string if both are null
GetUriPara()
Gets a URI parameter representation of this path for use in HTTP requests.
public string GetUriPara()
Returns
- string
A string suitable for use as a URI parameter
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(ExtendedNamedPath, ExtendedNamedPath)
public static bool operator ==(ExtendedNamedPath left, ExtendedNamedPath right)
Parameters
left
ExtendedNamedPathright
ExtendedNamedPath
Returns
operator !=(ExtendedNamedPath, ExtendedNamedPath)
public static bool operator !=(ExtendedNamedPath left, ExtendedNamedPath right)
Parameters
left
ExtendedNamedPathright
ExtendedNamedPath