skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI UI for Xamarin

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Release History
  • Migrate to .NET MAUI
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RichTextUnit

Represents a unit of measurement.

Inheritance
System.Object
RichTextUnit
Namespace: Telerik.XamarinForms.RichTextEditor
Assembly: Telerik.XamarinForms.RichTextEditor.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.

Sample Applications
  • Telerik Tagit
  • iOS Demo App
  • Android Demo App
Support Resources
  • iOS Wrappers
  • Android Wrappers
  • Xamarin.Forms SDK Examples
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.