• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • SharpRtfConvert
      • Parser
      • Rtf
      • RtfHtmlSettings
      • RtfSource
    • SharpRtfConvert.Foundation
      • NamedCodePage
      • ParagraphTab
    • SharpRtfConvert.Html
      • HtmlTag
      • HtmlWriterSettings
    • SharpRtfConvert.Model
      • ElementType
      • ExternalPicture
      • Node
      • Picture
    • SharpRtfConvert.Style
      • BorderPosition
      • BorderStyle
      • CellWidthUnit
      • ColorValue
      • Document
      • Font
      • FontFamilyCategory
      • FontPitch
      • HtmlEncapsulation
      • ListLevelDefinition
      • ListStyle
      • ListStyleReference
      • NumberingType
      • TextAlignment
      • UnitType
      • UnitValue
      • VerticalAlignment
      • WritingMode
    • SharpRtfConvert.Tokens
      • AccentSix
      • Author
      • BackgroundColor
      • BackupTime
      • BinaryToken
      • Blue
      • BookmarkEnd
      • BookmarkStart
      • BorderColor
      • BorderShadow
      • BorderSide
      • BorderSpacing
      • BorderStyleTag
      • BorderWidth
      • BottomCellSpacing
      • Category
      • CellBackgroundColor
      • CellBorderSide
      • CellBreak
      • CellDefaults
      • CellMergeHorizontalFirst
      • CellMergeHorizontalPrevious
      • CellMergeVerticalFirst
      • CellMergeVerticalPrevious
      • CellPaddingBottom
      • CellPaddingLeft
      • CellPaddingRight
      • CellPaddingTop
      • CellPaddingUnit
      • CellVerticalAlign
      • CellWidth
      • CellWidthType
      • CellWritingMode
      • CodePage
      • ColorTable
      • Comment
      • Company
      • ContextualSpace
      • ControlTag
      • ControlWord<T>
      • CreateTime
      • Day
      • DefaultCodePage
      • DefaultFontRef
      • DefaultNamedCodePage
      • DefaultTabWidth
      • DiBitmap
      • DocComment
      • EditingTime
      • EmfBlip
      • Field
      • FieldInstructions
      • FieldResult
      • FirstLineIndent
      • FontCategory
      • FontCharSet
      • FontPitchToken
      • FontRef
      • FontSize
      • FontTableTag
      • Footer
      • FooterFirst
      • FooterLeft
      • FooterRight
      • Footnote
      • FootnoteReference
      • ForegroundColor
      • FromHtml
      • GeneratorTag
      • GenericTag
      • GenericWord
      • Green
      • Group
      • GroupEnd
      • HalfCellPadding
      • Header
      • HeaderFirst
      • HeaderLeft
      • HeaderRight
      • HeaderRow
      • Hour
      • HtmlRtf
      • HtmlTagToken
      • HyperlinkBase
      • IToken
      • IWord
      • IgnoreUnrecognized
      • InTable
      • Info
      • InternalVersion
      • IsAllCaps
      • IsBold
      • IsDoubleStrike
      • IsEmbossed
      • IsEngraved
      • IsHidden
      • IsItalic
      • IsOutlined
      • IsShadow
      • IsSmallCaps
      • IsStrikethrough
      • IsUnderline
      • JpegBlip
      • Keywords
      • LeftCellSpacing
      • LeftIndent
      • LevelNumbers
      • LevelText
      • LineBreak
      • LineSpacingMultiple
      • ListDefinition
      • ListId
      • ListLevel
      • ListLevelJustification
      • ListLevelNumber
      • ListLevelType
      • ListOverride
      • ListOverrideTable
      • ListStyleId
      • ListTemplateId
      • ListTextFallback
      • MacPict
      • Manager
      • Minute
      • Month
      • NestedCellBreak
      • NestedRowBreak
      • NestedTableProperties
      • NestingLevel
      • NoNestedTables
      • NonShapePictureTag
      • NumChars
      • NumCharsWs
      • NumPages
      • NumWords
      • NumberingIndent
      • NumberingLevelBody
      • NumberingLevelBullet
      • NumberingLevelContinue
      • NumberingStart
      • NumberingTextAfter
      • NumberingTextBefore
      • NumberingTextFallback
      • NumberingTypeToken
      • ObjectAttachment
      • Operator
      • OutlineLevel
      • PageBreak
      • ParagraphBackgroundColor
      • ParagraphBorderBetween
      • ParagraphBorderSide
      • ParagraphBreak
      • ParagraphDefault
      • ParagraphNumbering
      • PictureBinaryLength
      • PictureHeight
      • PictureHeightGoal
      • PictureScaleX
      • PictureScaleY
      • PictureTag
      • PictureWidth
      • PictureWidthGoal
      • PlainStyle
      • PmMetafile
      • PngBlip
      • PositionOffset
      • PrintTime
      • Red
      • RevisionTime
      • RightCellBoundary
      • RightCellSpacing
      • RightIndent
      • RowAutoFit
      • RowBreak
      • RowDefaults
      • RowHeight
      • RowLeft
      • RowTextAlign
      • Second
      • SectionBreak
      • SectionDefault
      • Shade
      • ShapeInstructions
      • ShapePictureTag
      • ShapeProperty
      • ShapePropertyName
      • ShapePropertyValue
      • ShapeTag
      • SpaceAfter
      • SpaceBefore
      • SpaceBetweenLines
      • StyleRef
      • StyleSheetTag
      • Subject
      • SubscriptStart
      • SuperSubEnd
      • SuperscriptStart
      • Tab
      • TabAlignment
      • TabPosition
      • TableBorderSide
      • TablePaddingBottom
      • TablePaddingLeft
      • TablePaddingRight
      • TablePaddingTop
      • TextAlign
      • TextToken
      • Tint
      • Title
      • TokenType
      • TopCellSpacing
      • UnderlineColor
      • UnderlineDashDot
      • UnderlineDashDotDot
      • UnderlineDashed
      • UnderlineDotted
      • UnderlineDouble
      • UnderlineDoubleWave
      • UnderlineHeavyWave
      • UnderlineLongDash
      • UnderlineThick
      • UnderlineThickDash
      • UnderlineThickDashDot
      • UnderlineThickDashDotDot
      • UnderlineThickDotted
      • UnderlineThickLongDash
      • UnderlineWave
      • UnderlineWord
      • UnicodeTextTag
      • Version
      • WBitmap
      • WmMetafile
      • Year

    Struct UnitValue

    Represents a measurement with units

    Implements
    IEquatable<UnitValue>
    IComparable<UnitValue>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: SharpRtfConvert.Style
    Assembly: SharpRtfConvert.dll
    Syntax
    public struct UnitValue : IEquatable<UnitValue>, IComparable<UnitValue>

    Constructors

    | Edit this page View Source

    UnitValue(double, UnitType)

    Create a new UnitValue

    Declaration
    public UnitValue(double value, UnitType unit)
    Parameters
    Type Name Description
    double value

    The measurement value

    UnitType unit

    The measurement unit

    Properties

    | Edit this page View Source

    Empty

    Declaration
    public static UnitValue Empty { get; }
    Property Value
    Type Description
    UnitValue
    | Edit this page View Source

    HasValue

    Gets whether or not the unit has been initialied with a value

    Declaration
    public bool HasValue { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Unit

    Gets or sets the units of the measurement

    Declaration
    public UnitType Unit { readonly get; set; }
    Property Value
    Type Description
    UnitType
    | Edit this page View Source

    Value

    Gets or sets the value of the measurement

    Declaration
    public double Value { readonly get; set; }
    Property Value
    Type Description
    double

    Methods

    | Edit this page View Source

    Average(IEnumerable<UnitValue>)

    Declaration
    public static UnitValue Average(IEnumerable<UnitValue> values)
    Parameters
    Type Name Description
    IEnumerable<UnitValue> values
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    CompareTo(UnitValue)

    Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

    Declaration
    public int CompareTo(UnitValue other)
    Parameters
    Type Name Description
    UnitValue other

    An object to compare with this instance.

    Returns
    Type Description
    int

    A value that indicates the relative order of the objects being compared. The return value has these meanings:

    Value Meaning
    Less than zero This instance precedes other in the sort order.
    Zero This instance occurs in the same position in the sort order as other.
    Greater than zero This instance follows other in the sort order.
    | Edit this page View Source

    Equals(UnitValue)

    Whether this measurement is exactly equal (in value and unit) to another measurement

    Declaration
    public bool Equals(UnitValue other)
    Parameters
    Type Name Description
    UnitValue other

    Another measurement

    Returns
    Type Description
    bool

    true if they are equal. false otherwise

    | Edit this page View Source

    Equals(object?)

    Whether this measurement is exactly equal (in value and unit) to another measurement

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    Another measurement

    Returns
    Type Description
    bool

    true if they are equal. false otherwise

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    FromHalfPoint(int)

    Declaration
    public static UnitValue FromHalfPoint(int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    FromQuarterPoint(int)

    Declaration
    public static UnitValue FromQuarterPoint(int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    ToPt()

    Convert the measurement to points

    Declaration
    public double ToPt()
    Returns
    Type Description
    double

    The measuremet value in points

    | Edit this page View Source

    ToPx()

    Convert the measurement value to pixels

    Declaration
    public double ToPx()
    Returns
    Type Description
    double

    The measurement in the corresponding number of pixels

    | Edit this page View Source

    ToTwip()

    Convert the measurement to twips

    Declaration
    public int ToTwip()
    Returns
    Type Description
    int

    The measurement in twips

    Operators

    | Edit this page View Source

    operator +(UnitValue, UnitValue)

    Declaration
    public static UnitValue operator +(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    operator /(UnitValue, double)

    Declaration
    public static UnitValue operator /(UnitValue a, double b)
    Parameters
    Type Name Description
    UnitValue a
    double b
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    operator ==(UnitValue, UnitValue)

    Declaration
    public static bool operator ==(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator >(UnitValue, UnitValue)

    Declaration
    public static bool operator >(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator >=(UnitValue, UnitValue)

    Declaration
    public static bool operator >=(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator !=(UnitValue, UnitValue)

    Declaration
    public static bool operator !=(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator <(UnitValue, UnitValue)

    Declaration
    public static bool operator <(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator <=(UnitValue, UnitValue)

    Declaration
    public static bool operator <=(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator *(UnitValue, double)

    Declaration
    public static UnitValue operator *(UnitValue a, double b)
    Parameters
    Type Name Description
    UnitValue a
    double b
    Returns
    Type Description
    UnitValue
    | Edit this page View Source

    operator -(UnitValue, UnitValue)

    Declaration
    public static UnitValue operator -(UnitValue a, UnitValue b)
    Parameters
    Type Name Description
    UnitValue a
    UnitValue b
    Returns
    Type Description
    UnitValue

    Implements

    IEquatable<T>
    IComparable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2018 Eric Domke, 2026 Jérémy Ansel