StructRichTextUnit
Represents a unit of measurement.
Definition
Namespace:Telerik.Maui.Controls.RichTextEditor
Assembly:Telerik.Maui.Controls.dll
Syntax:
[TypeConverter(typeof(RichTextUnitTypeConverter))]
public struct RichTextUnit : IComparable<RichTextUnit>, IEquatable<RichTextUnit>
Implements:
Constructors
RichTextUnit(double)
Initializes a new instance of the RichTextUnit with the specified value in pixels.
Declaration
public RichTextUnit(double value)
Parameters
value
Specifies the value of the measurement unit in pixels.
RichTextUnit(double, RichTextUnitType)
Initializes a new instance of the RichTextUnit with the specified value and type.
Declaration
public RichTextUnit(double value, RichTextUnitType type)
Parameters
value
Specifies the value of the measurement unit.
type
Specifies the type of the measurement unit.
Properties
Type
Gets the type of the measurement unit type.
Declaration
public readonly RichTextUnitType Type { get; }
Property Value
Methods
CompareTo(RichTextUnit)
Compares the current RichTextUnit with the specified one.
Declaration
public int CompareTo(RichTextUnit unit)
Parameters
unit
Specifies the RichTextUnit to compare to.
Returns
0 - if the current RichTextUnit is equal to the specified one; 1 - if the current RichTextUnit is greater than the specified one; -1 - if the current RichTextUnit is less than the specified one;
Implements
Equals(RichTextUnit)
Determines if the current RichTextUnit is equal to the specified one.
Declaration
public bool Equals(RichTextUnit unit)
Parameters
unit
Specifies the RichTextUnit to compare to.
Returns
True - if the current RichTextUnit is equal to the specified one, False - otherwise.
Implements
Equals(object)
Determines if the current RichTextUnit is equal to the specified object.
GetHashCode()
Computes the hash code of the current RichTextUnit.
Declaration
public override int GetHashCode()
Returns
The computed hash code of the current RichTextUnit.
Overrides
Parse(string)
Parses the specified string to a RichTextUnit.
Declaration
public static RichTextUnit Parse(string text)
Parameters
text
Specifies the string to parse to.
Returns
The parsed RichTextUnit.
Exceptions
If the specified string is not in a valid format.
ToString()
Converts the current RichTextUnit to its string representation.
Declaration
public override string ToString()
Returns
The string representation of the current RichTextUnit.
Overrides
ToUnit(RichTextUnitType)
Converts the current RichTextUnit to the specified type.
Declaration
public RichTextUnit ToUnit(RichTextUnitType type)
Parameters
type
Specifies the RichTextUnitType to convert to.
Returns
The new RichTextUnit with the specified RichTextUnitType.
TryParse(string, out RichTextUnit)
Attempts to parse the specified string to a RichTextUnit.
Declaration
public static bool TryParse(string text, out RichTextUnit unit)
Parameters
text
Specifies the string to parse to.
unit
Outputs the parsed RichTextUnit.
Returns
True - if the parse operation is successful, False - otherwise.
Operators
explicit operator double(RichTextUnit)
Converts the specified RichTextUnit to pixels.
Declaration
public static explicit operator double(RichTextUnit unit)
Parameters
unit
Specifies the RichTextUnit to convert to.
Returns
implicit operator RichTextUnit(double)
Converts the specified value in pixels to RichTextUnit.
Declaration
public static implicit operator RichTextUnit(double value)
Parameters
value
Specifies the value in pixels to convert to.
Returns
implicit operator RichTextUnit(string)
Converts the specified string to a RichTextUnit.
Declaration
public static implicit operator RichTextUnit(string text)
Parameters
text
Specifies the string to convert to.
Returns
operator !=(RichTextUnit, RichTextUnit)
Compares the two operands for inequality.
Declaration
public static bool operator !=(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the two operands are not equal, False - otherwise.
operator <(RichTextUnit, RichTextUnit)
Determines if the left operand is less than the right operand.
Declaration
public static bool operator <(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the left operand is less than the right operand, False - otherwise.
operator <=(RichTextUnit, RichTextUnit)
Determines if the left operand is less or equal the right operand.
Declaration
public static bool operator <=(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the left operand is less or equal the right operand, False - otherwise.
operator ==(RichTextUnit, RichTextUnit)
Compares the two operands for equality.
Declaration
public static bool operator ==(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the two operands are equal, False - otherwise.
operator >(RichTextUnit, RichTextUnit)
Determines if the left operand is greater than the right operand.
Declaration
public static bool operator >(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the left operand is greater than the right operand, False - otherwise.
operator >=(RichTextUnit, RichTextUnit)
Determines if the left operand is greater or equal the right operand.
Declaration
public static bool operator >=(RichTextUnit left, RichTextUnit right)
Parameters
left
Specifies the left operand of the comparison.
right
Specifies the right operand of the comparison.
Returns
True - if the left operand is greater or equal the right operand, False - otherwise.