HorizontalPosition Struct
Represents a horizontal positioning which can be expressed with HorizontalPositionType enumeration or System.Double value.
public struct HorizontalPosition : IEquatable<HorizontalPosition>
Public Structure HorizontalPosition
Implements IEquatable(Of HorizontalPosition)
Implements
Constructors
HorizontalPosition(HorizontalPositionType, HorizontalPositionAnchor)
Initializes a new instance of the HorizontalPosition struct with specified alignment.
public HorizontalPosition(HorizontalPositionType alignment, HorizontalPositionAnchor relativeTo)
Public Sub New(alignment As HorizontalPositionType, relativeTo As HorizontalPositionAnchor)
Parameters
alignment
- HorizontalPositionType
The alignment relative to HorizontalPositionAnchor specified by relativeTo
parameter.
relativeTo
- HorizontalPositionAnchor
The location from which alignment
parameter is relative to.
HorizontalPosition(Double, LengthUnit, HorizontalPositionAnchor)
Initializes a new instance of the HorizontalPosition struct with specified absolute position.
public HorizontalPosition(double absolutePosition, LengthUnit unit, HorizontalPositionAnchor rightOf)
Public Sub New(absolutePosition As Double, unit As LengthUnit, rightOf As HorizontalPositionAnchor)
Parameters
absolutePosition
- System.Double
The absolute position in units specified by unit
parameter in direction to the right of location specified by rightOf
parameter.
unit
- LengthUnit
The measurement unit for absolute position value.
rightOf
- HorizontalPositionAnchor
The location from which absolute position is offset from. If absolutePosition
parameter is positive, offset is to the right of HorizontalPositionAnchor specified by rightOf
parameter, otherwise offset is to the left.
Properties
PositionType
Gets the horizontal position type which can either be absolute or relative.
public readonly HorizontalPositionType PositionType { get; }
Public ReadOnly Property PositionType As HorizontalPositionType
Property Value
The horizontal position type which can either be absolute or relative.
RelativeTo
Gets the base location of this horizontal position.
public readonly HorizontalPositionAnchor RelativeTo { get; }
Public ReadOnly Property RelativeTo As HorizontalPositionAnchor
Property Value
The base location of this horizontal position.
Value
Gets the horizontal position absolute value in points if PositionType is Absolute, otherwise value is not applicable.
Property Value
- System.Double
The horizontal position absolute value in points if PositionType is Absolute, otherwise value is not applicable.
Methods
Equals(HorizontalPosition)
Determines whether the other
HorizontalPosition is equal to this HorizontalPosition instance.
public bool Equals(HorizontalPosition other)
Public Function Equals(other As HorizontalPosition) As Boolean
Parameters
other
- HorizontalPosition
The other horizontal position to compare with this horizontal position instance.
Returns
- System.Boolean
true if the other
HorizontalPosition is equal to this HorizontalPosition instance; otherwise, false.
Equals(Object)
Determines whether the specified System.Object is equal to this HorizontalPosition instance.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
- System.Object
The System.Object to compare with this horizontal position instance.
Returns
- System.Boolean
true if the specified System.Object is a HorizontalPosition and is equal to this HorizontalPosition instance; otherwise, false.
Overrides
GetHashCode()
Returns a hash code for this HorizontalPosition instance.
Returns
- System.Int32
An integer value that specifies a hash value for this HorizontalPosition instance.
Overrides
ToString()
Returns a System.String that represents this HorizontalPosition instance.
Returns
- System.String
A System.String that represents this HorizontalPosition instance.
Overrides
Operators
Equality(HorizontalPosition, HorizontalPosition)
Determines whether first
and second
HorizontalPositions are equal.
public static bool operator ==(HorizontalPosition first, HorizontalPosition second)
Public Shared Operator =(first As HorizontalPosition, second As HorizontalPosition) As Boolean
Parameters
first
- HorizontalPosition
The first horizontal position.
second
- HorizontalPosition
The second horizontal position.
Returns
- System.Boolean
true if first
and second
horizontal positions are equal; otherwise, false.
Inequality(HorizontalPosition, HorizontalPosition)
Determines whether first
and second
HorizontalPositions are not equal.
public static bool operator !=(HorizontalPosition first, HorizontalPosition second)
Public Shared Operator <>(first As HorizontalPosition, second As HorizontalPosition) As Boolean
Parameters
first
- HorizontalPosition
The first horizontal position.
second
- HorizontalPosition
The second horizontal position.
Returns
- System.Boolean
true if first
and second
horizontal positions are not equal; otherwise, false.