Class Style
Container object for style properties of an element.
public class Style : ElementPropertyContainer<Style>, IPropertyContainer
- Inheritance
-
Style
- Implements
- Inherited Members
Remarks
Container object for style properties of an element. A style can be used as an effective way to define multiple equal properties to several elements. Used in AbstractElement<T>. The properties set via Style have a lower priority than directly set properties. For example, if the same property is set directly and added via Style, then, no matter in which order they are set, the one set directly will be chosen.
Constructors
Style()
public Style()
Style(Style)
public Style(Style style)
Parameters
style
Style
Methods
GetHeight()
Gets the height property of the element.
public virtual UnitValue GetHeight()
Returns
- UnitValue
the height of the element, as a floating point value. Null if the property is not present
GetMarginBottom()
Gets the current bottom margin width of the element.
public virtual UnitValue GetMarginBottom()
Returns
GetMarginLeft()
Gets the current left margin width of the element.
public virtual UnitValue GetMarginLeft()
Returns
GetMarginRight()
Gets the current right margin width of the element.
public virtual UnitValue GetMarginRight()
Returns
GetMarginTop()
Gets the current top margin width of the element.
public virtual UnitValue GetMarginTop()
Returns
GetPaddingBottom()
Gets the current bottom padding width of the element.
public virtual UnitValue GetPaddingBottom()
Returns
GetPaddingLeft()
Gets the current left padding width of the element.
public virtual UnitValue GetPaddingLeft()
Returns
GetPaddingRight()
Gets the current right padding width of the element.
public virtual UnitValue GetPaddingRight()
Returns
GetPaddingTop()
Gets the current top padding width of the element.
public virtual UnitValue GetPaddingTop()
Returns
GetWidth()
Gets the width property of the element.
public virtual UnitValue GetWidth()
Returns
- UnitValue
the width of the element, with a value and a measurement unit.
- See Also
IsKeepTogether()
Returns whether the BlockElement<T> should be kept together as much as possible.
public virtual bool? IsKeepTogether()
Returns
- bool?
the current value of the KEEP_TOGETHER property
SetHeight(float)
Sets the height property the element as a point-value.
public virtual Style SetHeight(float height)
Parameters
height
floata floating point value for the new height
Returns
- Style
the block element itself.
SetHeight(UnitValue)
Sets the height property of the element with a UnitValue.
public virtual Style SetHeight(UnitValue height)
Parameters
Returns
- Style
this Element.
SetKeepTogether(bool)
Sets whether the BlockElement<T> should be kept together as much as possible.
public virtual Style SetKeepTogether(bool keepTogether)
Parameters
keepTogether
boolthe new value of the KEEP_TOGETHER property
Returns
- Style
this element
SetMargin(float)
Sets all margins around the element to the same width.
public virtual Style SetMargin(float commonMargin)
Parameters
commonMargin
floatthe new margin width
Returns
- Style
this element
SetMarginBottom(float)
Sets the bottom margin width of the element.
public virtual Style SetMarginBottom(float value)
Parameters
value
floatthe new bottom margin width
Returns
- Style
this element
SetMarginLeft(float)
Sets the left margin width of the element.
public virtual Style SetMarginLeft(float value)
Parameters
value
floatthe new left margin width
Returns
- Style
this element
SetMarginRight(float)
Sets the right margin width of the element.
public virtual Style SetMarginRight(float value)
Parameters
value
floatthe new right margin width
Returns
- Style
this element
SetMarginTop(float)
Sets the top margin width of the element.
public virtual Style SetMarginTop(float value)
Parameters
value
floatthe new top margin width
Returns
- Style
this element
SetMargins(float, float, float, float)
Sets the margins around the element to a series of new widths.
public virtual Style SetMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
Parameters
marginTop
floatthe new margin top width
marginRight
floatthe new margin right width
marginBottom
floatthe new margin bottom width
marginLeft
floatthe new margin left width
Returns
- Style
this element
SetMaxHeight(float)
Sets the max-height of the element as point-unit value.
public virtual Style SetMaxHeight(float maxHeight)
Parameters
maxHeight
floata floating point value for the new max-height
Returns
- Style
the block element itself
SetMaxHeight(UnitValue)
Sets the max-height property of the element with a UnitValue.
public virtual Style SetMaxHeight(UnitValue maxHeight)
Parameters
Returns
- Style
the block element itself
SetMaxWidth(float)
Sets the max-width of the element as point-unit value.
public virtual Style SetMaxWidth(float maxWidth)
Parameters
maxWidth
floata floating point value for the new max-width
Returns
- Style
the block element itself
SetMaxWidth(UnitValue)
Sets the max-width property of the element with a UnitValue.
public virtual Style SetMaxWidth(UnitValue maxWidth)
Parameters
Returns
- Style
the block element itself
SetMinHeight(float)
Sets the min-height of the element as point-unit value.
public virtual Style SetMinHeight(float minHeight)
Parameters
minHeight
floata floating point value for the new min-height
Returns
- Style
the block element itself
SetMinHeight(UnitValue)
Sets the min-height property of the element with a UnitValue.
public virtual Style SetMinHeight(UnitValue minHeight)
Parameters
Returns
- Style
the block element itself
SetMinWidth(float)
Sets the min-width of the element as point-unit value.
public virtual Style SetMinWidth(float minWidth)
Parameters
minWidth
floata floating point value for the new min-width
Returns
- Style
the block element itself
SetMinWidth(UnitValue)
Sets the min-width property of the element with a UnitValue.
public virtual Style SetMinWidth(UnitValue minWidth)
Parameters
Returns
- Style
the block element itself
SetPadding(float)
Sets all paddings around the element to the same width.
public virtual Style SetPadding(float commonPadding)
Parameters
commonPadding
floatthe new padding width
Returns
- Style
this element
SetPaddingBottom(float)
Sets the bottom padding width of the element.
public virtual Style SetPaddingBottom(float value)
Parameters
value
floatthe new bottom padding width
Returns
- Style
this element
SetPaddingLeft(float)
Sets the left padding width of the element.
public virtual Style SetPaddingLeft(float value)
Parameters
value
floatthe new left padding width
Returns
- Style
this element
SetPaddingRight(float)
Sets the right padding width of the element.
public virtual Style SetPaddingRight(float value)
Parameters
value
floatthe new right padding width
Returns
- Style
this element
SetPaddingTop(float)
Sets the top padding width of the element.
public virtual Style SetPaddingTop(float value)
Parameters
value
floatthe new top padding width
Returns
- Style
this element
SetPaddings(float, float, float, float)
Sets the paddings around the element to a series of new widths.
public virtual Style SetPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
Parameters
paddingTop
floatthe new padding top width
paddingRight
floatthe new padding right width
paddingBottom
floatthe new padding bottom width
paddingLeft
floatthe new padding left width
Returns
- Style
this element
SetRotationAngle(double)
Sets the rotation angle.
public virtual Style SetRotationAngle(double angle)
Parameters
angle
doublethe new rotation angle, as a
double
Returns
- Style
this element
SetRotationAngle(float)
Sets the rotation radAngle.
public virtual Style SetRotationAngle(float radAngle)
Parameters
radAngle
floatthe new rotation radAngle, as a
float
Returns
- Style
this element
SetSpacingRatio(float)
Sets a ratio which determines in which proportion will word spacing and character spacing be applied when horizontal alignment is justified.
public virtual Style SetSpacingRatio(float ratio)
Parameters
ratio
floatthe ratio coefficient. It must be between 0 and 1, inclusive. It means that ratio part of the free space will be compensated by word spacing, and 1-ratio part of the free space will be compensated by character spacing. If ratio is 1, additional character spacing will not be applied. If ratio is 0, additional word spacing will not be applied.
Returns
- Style
this element
SetVerticalAlignment(VerticalAlignment?)
Sets the vertical alignment of the element.
public virtual Style SetVerticalAlignment(VerticalAlignment? verticalAlignment)
Parameters
verticalAlignment
VerticalAlignment?the vertical alignment setting
Returns
- Style
this element
SetWidth(float)
Sets the width property of the element, measured in points.
public virtual Style SetWidth(float width)
Parameters
width
floata value measured in points.
Returns
- Style
this Element.
SetWidth(UnitValue)
Sets the width property of the element with a UnitValue.
public virtual Style SetWidth(UnitValue width)
Parameters
Returns
- Style
this Element.