Class RichTextUnit
Represents a unit of measurement.
Inheritance
Namespace: Telerik.Maui.Controls.RichTextEditor
Assembly: Telerik.Maui.Controls.dll
Syntax
public sealed class RichTextUnit : ValueType, IComparable<RichTextUnit>, IEquatable<RichTextUnit>
Constructors
RichTextUnit(Double)
Initializes a new instance of the RichTextUnit with the specified value in pixels.
Declaration
public RichTextUnit(double value)
Parameters
System.Double
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
System.Double
value
Specifies the value of the measurement unit. |
RichTextUnitType
type
Specifies the type of the measurement unit. |
Properties
Type
Gets the type of the measurement unit type.
Declaration
public RichTextUnitType Type { get; }
Property Value
RichTextUnitType
|
Value
Gets the value of the measurement unit type.
Declaration
public double Value { get; }
Property Value
System.Double
|
Methods
CompareTo(RichTextUnit)
Compares the current RichTextUnit with the specified one.
Declaration
public int CompareTo(RichTextUnit unit)
Parameters
RichTextUnit
unit
Specifies the RichTextUnit to compare to. |
Returns
System.Int32
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; |
Equals(Object)
Determines if the current RichTextUnit is equal to the specified object.
Declaration
public override bool Equals(object other)
Parameters
System.Object
other
Specifies the System.Object to compare to. |
Returns
System.Boolean
True - if the two objects are equal, False - otherwise. |
Equals(RichTextUnit)
Determines if the current RichTextUnit is equal to the specified one.
Declaration
public bool Equals(RichTextUnit unit)
Parameters
RichTextUnit
unit
Specifies the RichTextUnit to compare to. |
Returns
System.Boolean
True - if the current RichTextUnit is equal to the specified one, False - otherwise. |
GetHashCode()
Computes the hash code of the current RichTextUnit.
Declaration
public override int GetHashCode()
Returns
System.Int32
The computed hash code of the current RichTextUnit. |
Parse(String)
Parses the specified string to a RichTextUnit.
Declaration
public static RichTextUnit Parse(string text)
Parameters
System.String
text
Specifies the string to parse to. |
Returns
RichTextUnit
The parsed RichTextUnit. |
Exceptions
System.FormatException
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
System.String
The string representation of the current RichTextUnit. |
ToUnit(RichTextUnitType)
Converts the current RichTextUnit to the specified type.
Declaration
public RichTextUnit ToUnit(RichTextUnitType type)
Parameters
RichTextUnitType
type
Specifies the RichTextUnitType to convert to. |
Returns
RichTextUnit
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
System.String
text
Specifies the string to parse to. |
RichTextUnit
unit
Outputs the parsed RichTextUnit. |
Returns
System.Boolean
True - if the parse operation is successful, False - otherwise. |
Operators
Equality(RichTextUnit, RichTextUnit)
Compares the two operands for equality.
Declaration
public static bool operator ==(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the two operands are equal, False - otherwise. |
Explicit(RichTextUnit to Double)
Converts the specified RichTextUnit to pixels.
Declaration
public static explicit operator double (RichTextUnit unit)
Parameters
RichTextUnit
unit
Specifies the RichTextUnit to convert to. |
Returns
System.Double
|
GreaterThan(RichTextUnit, RichTextUnit)
Determines if the left operand is greater than the right operand.
Declaration
public static bool operator>(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the left operand is greater than the right operand, False - otherwise. |
GreaterThanOrEqual(RichTextUnit, RichTextUnit)
Determines if the left operand is greater or equal the right operand.
Declaration
public static bool operator >=(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the left operand is greater or equal the right operand, False - otherwise. |
Implicit(Double to RichTextUnit)
Converts the specified value in pixels to RichTextUnit.
Declaration
public static implicit operator RichTextUnit(double value)
Parameters
System.Double
value
Specifies the value in pixels to convert to. |
Returns
RichTextUnit
|
Implicit(String to RichTextUnit)
Converts the specified string to a RichTextUnit.
Declaration
public static implicit operator RichTextUnit(string text)
Parameters
System.String
text
Specifies the string to convert to. |
Returns
RichTextUnit
|
Inequality(RichTextUnit, RichTextUnit)
Compares the two operands for inequality.
Declaration
public static bool operator !=(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the two operands are not equal, False - otherwise. |
LessThan(RichTextUnit, RichTextUnit)
Determines if the left operand is less than the right operand.
Declaration
public static bool operator <(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the left operand is less than the right operand, False - otherwise. |
LessThanOrEqual(RichTextUnit, RichTextUnit)
Determines if the left operand is less or equal the right operand.
Declaration
public static bool operator <=(RichTextUnit left, RichTextUnit right)
Parameters
RichTextUnit
left
Specifies the left operand of the comparison. |
RichTextUnit
right
Specifies the right operand of the comparison. |
Returns
System.Boolean
True - if the left operand is less or equal the right operand, False - otherwise. |