Struct
RichTextUnit

Represents a unit of measurement.

Definition

Namespace:Telerik.Maui.Controls.RichTextEditor

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(RichTextUnitTypeConverter))]
public struct RichTextUnit : IComparable<RichTextUnit>, IEquatable<RichTextUnit>

Implements: IComparable<RichTextUnit>IEquatable<RichTextUnit>

Constructors

RichTextUnit(double)

Initializes a new instance of the RichTextUnit with the specified value in pixels.

Declaration

cs-api-definition
public RichTextUnit(double value)

Parameters

value

double

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

cs-api-definition
public RichTextUnit(double value, RichTextUnitType type)

Parameters

value

double

Specifies the value of the measurement unit.

type

RichTextUnitType

Specifies the type of the measurement unit.

Properties

Type

Gets the type of the measurement unit type.

Declaration

cs-api-definition
public readonly RichTextUnitType Type { get; }

Property Value

RichTextUnitType

Value

Gets the value of the measurement unit type.

Declaration

cs-api-definition
public readonly double Value { get; }

Property Value

double

Methods

CompareTo(RichTextUnit)

Compares the current RichTextUnit with the specified one.

Declaration

cs-api-definition
public int CompareTo(RichTextUnit unit)

Parameters

unit

RichTextUnit

Specifies the RichTextUnit to compare to.

Returns

int

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 IComparable<RichTextUnit>.CompareTo(RichTextUnit)

Equals(RichTextUnit)

Determines if the current RichTextUnit is equal to the specified one.

Declaration

cs-api-definition
public bool Equals(RichTextUnit unit)

Parameters

unit

RichTextUnit

Specifies the RichTextUnit to compare to.

Returns

bool

True - if the current RichTextUnit is equal to the specified one, False - otherwise.

Implements IEquatable<RichTextUnit>.Equals(RichTextUnit)

Equals(object)

Determines if the current RichTextUnit is equal to the specified object.

Declaration

cs-api-definition
public override bool Equals(object other)

Parameters

other

object

Specifies the object to compare to.

Returns

bool

True - if the two objects are equal, False - otherwise.

Overrides ValueType.Equals(object)

GetHashCode()

Computes the hash code of the current RichTextUnit.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

The computed hash code of the current RichTextUnit.

Overrides ValueType.GetHashCode()

Parse(string)

Parses the specified string to a RichTextUnit.

Declaration

cs-api-definition
public static RichTextUnit Parse(string text)

Parameters

text

string

Specifies the string to parse to.

Returns

RichTextUnit

The parsed RichTextUnit.

Exceptions

FormatException

If the specified string is not in a valid format.

ToString()

Converts the current RichTextUnit to its string representation.

Declaration

cs-api-definition
public override string ToString()

Returns

string

The string representation of the current RichTextUnit.

Overrides ValueType.ToString()

ToUnit(RichTextUnitType)

Converts the current RichTextUnit to the specified type.

Declaration

cs-api-definition
public RichTextUnit ToUnit(RichTextUnitType type)

Parameters

type

RichTextUnitType

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

cs-api-definition
public static bool TryParse(string text, out RichTextUnit unit)

Parameters

text

string

Specifies the string to parse to.

unit

RichTextUnit

Outputs the parsed RichTextUnit.

Returns

bool

True - if the parse operation is successful, False - otherwise.

Operators

explicit operator double(RichTextUnit)

Converts the specified RichTextUnit to pixels.

Declaration

cs-api-definition
public static explicit operator double(RichTextUnit unit)

Parameters

unit

RichTextUnit

Specifies the RichTextUnit to convert to.

Returns

double

implicit operator RichTextUnit(double)

Converts the specified value in pixels to RichTextUnit.

Declaration

cs-api-definition
public static implicit operator RichTextUnit(double value)

Parameters

value

double

Specifies the value in pixels to convert to.

Returns

RichTextUnit

implicit operator RichTextUnit(string)

Converts the specified string to a RichTextUnit.

Declaration

cs-api-definition
public static implicit operator RichTextUnit(string text)

Parameters

text

string

Specifies the string to convert to.

Returns

RichTextUnit

operator !=(RichTextUnit, RichTextUnit)

Compares the two operands for inequality.

Declaration

cs-api-definition
public static bool operator !=(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

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

cs-api-definition
public static bool operator <(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

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

cs-api-definition
public static bool operator <=(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

True - if the left operand is less or equal the right operand, False - otherwise.

operator ==(RichTextUnit, RichTextUnit)

Compares the two operands for equality.

Declaration

cs-api-definition
public static bool operator ==(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

True - if the two operands are equal, False - otherwise.

operator >(RichTextUnit, RichTextUnit)

Determines if the left operand is greater than the right operand.

Declaration

cs-api-definition
public static bool operator >(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

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

cs-api-definition
public static bool operator >=(RichTextUnit left, RichTextUnit right)

Parameters

left

RichTextUnit

Specifies the left operand of the comparison.

right

RichTextUnit

Specifies the right operand of the comparison.

Returns

bool

True - if the left operand is greater or equal the right operand, False - otherwise.