Class BlockElement<T>
A BlockElement<T> will try to take up as much horizontal space as available to it on the canvas or page.
public abstract class BlockElement<T> : AbstractElement<T>, IAccessibleElement, IBlockElement, IAbstractElement, IElement, IPropertyContainer where T : IElement
Type Parameters
T
the type of the implementation
- Inheritance
-
BlockElement<T>
- Implements
- Derived
- Inherited Members
Remarks
A BlockElement<T> will try to take up as much horizontal space as available to it on the canvas or page. The concept is comparable to the block element in HTML. Also like in HTML, the visual representation of the object can be delimited by padding, a border, and/or a margin.
Constructors
BlockElement()
Creates a BlockElement.
protected BlockElement()
Methods
GetAccessibilityProperties()
public abstract AccessibilityProperties GetAccessibilityProperties()
Returns
GetDefaultProperty<T1>(int)
public override T1 GetDefaultProperty<T1>(int property)
Parameters
property
int
Returns
- T1
Type Parameters
T1
GetHeight()
Gets the height property of a block 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 a block 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
IsKeepWithNext()
Returns whether the end of this BlockElement<T> and the start of the next sibling of this element should be placed in the same area.
public virtual bool? IsKeepWithNext()
Returns
- bool?
the current value of the KEEP_WITH_NEXT property
SetHeight(float)
Sets the height property a block element as a point-value.
public virtual T SetHeight(float height)
Parameters
height
floata floating point value for the new height
Returns
- T
the block element itself.
SetHeight(UnitValue)
Sets the height property of a block element with a UnitValue.
public virtual T SetHeight(UnitValue height)
Parameters
Returns
- T
this Element.
SetKeepTogether(bool)
Sets whether the BlockElement<T> should be kept together as much as possible.
public virtual T SetKeepTogether(bool keepTogether)
Parameters
keepTogether
boolthe new value of the KEEP_TOGETHER property
Returns
- T
this element
SetKeepWithNext(bool)
Sets whether the end of this BlockElement<T> and the start of the next sibling of this element should be placed in the same area.
public virtual T SetKeepWithNext(bool keepWithNext)
Parameters
keepWithNext
boolthe new value of the KEEP_WITH_NEXT property
Returns
- T
this element
Remarks
Sets whether the end of this BlockElement<T> and the start of the next sibling of this element should be placed in the same area. Note that this will only work for high-level elements, i.e. elements added to the RootElement<T>.
SetMargin(float)
Sets all margins around the element to the same width.
public virtual T SetMargin(float commonMargin)
Parameters
commonMargin
floatthe new margin width
Returns
- T
this element
SetMarginBottom(float)
Sets the bottom margin width of the element.
public virtual T SetMarginBottom(float value)
Parameters
value
floatthe new bottom margin width
Returns
- T
this element
SetMarginLeft(float)
Sets the left margin width of the element.
public virtual T SetMarginLeft(float value)
Parameters
value
floatthe new left margin width
Returns
- T
this element
SetMarginRight(float)
Sets the right margin width of the element.
public virtual T SetMarginRight(float value)
Parameters
value
floatthe new right margin width
Returns
- T
this element
SetMarginTop(float)
Sets the top margin width of the element.
public virtual T SetMarginTop(float value)
Parameters
value
floatthe new top margin width
Returns
- T
this element
SetMargins(float, float, float, float)
Sets the margins around the element to a series of new widths.
public virtual T 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
- T
this element
SetMaxHeight(float)
Sets the max-height of a block element as point-unit value.
public virtual T SetMaxHeight(float maxHeight)
Parameters
maxHeight
floata floating point value for the new max-height
Returns
- T
the block element itself
SetMaxHeight(UnitValue)
Sets the max-height property of a block element with a UnitValue.
public virtual T SetMaxHeight(UnitValue maxHeight)
Parameters
Returns
- T
the block element itself
SetMaxWidth(float)
Sets the max-width of a block element as point-unit value.
public virtual T SetMaxWidth(float maxWidth)
Parameters
maxWidth
floata floating point value for the new max-width
Returns
- T
the block element itself
SetMaxWidth(UnitValue)
Sets the max-width property of a block element with a UnitValue.
public virtual T SetMaxWidth(UnitValue maxWidth)
Parameters
Returns
- T
the block element itself
SetMinHeight(float)
Sets the min-height of a block element as point-unit value.
public virtual T SetMinHeight(float minHeight)
Parameters
minHeight
floata floating point value for the new min-height
Returns
- T
the block element itself
SetMinHeight(UnitValue)
Sets the min-height property of a block element with a UnitValue.
public virtual T SetMinHeight(UnitValue minHeight)
Parameters
Returns
- T
the block element itself
SetMinWidth(float)
Sets the min-width of a block element as point-unit value.
public virtual T SetMinWidth(float minWidth)
Parameters
minWidth
floata floating point value for the new min-width
Returns
- T
the block element itself
SetMinWidth(UnitValue)
Sets the min-width property of a block element with a UnitValue.
public virtual T SetMinWidth(UnitValue minWidth)
Parameters
Returns
- T
the block element itself
SetNeutralRole()
Give this element a neutral role.
public virtual T SetNeutralRole()
Returns
- T
this Element
Remarks
Give this element a neutral role. See also SetRole(string).
SetPadding(float)
Sets all paddings around the element to the same width.
public virtual T SetPadding(float commonPadding)
Parameters
commonPadding
floatthe new padding width
Returns
- T
this element
SetPaddingBottom(float)
Sets the bottom padding width of the element.
public virtual T SetPaddingBottom(float value)
Parameters
value
floatthe new bottom padding width
Returns
- T
this element
SetPaddingLeft(float)
Sets the left padding width of the element.
public virtual T SetPaddingLeft(float value)
Parameters
value
floatthe new left padding width
Returns
- T
this element
SetPaddingRight(float)
Sets the right padding width of the element.
public virtual T SetPaddingRight(float value)
Parameters
value
floatthe new right padding width
Returns
- T
this element
SetPaddingTop(float)
Sets the top padding width of the element.
public virtual T SetPaddingTop(float value)
Parameters
value
floatthe new top padding width
Returns
- T
this element
SetPaddings(float, float, float, float)
Sets the paddings around the element to a series of new widths.
public virtual T 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
- T
this element
SetRotationAngle(double)
Sets the rotation angle.
public virtual T SetRotationAngle(double angleInRadians)
Parameters
angleInRadians
doublethe new rotation angle, as a
double
, in radians
Returns
- T
this element
SetRotationAngle(float)
Sets the rotation radAngle.
public virtual T SetRotationAngle(float angleInRadians)
Parameters
angleInRadians
floatthe new rotation radAngle, as a
float
, in radians
Returns
- T
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 T 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
- T
this element
SetVerticalAlignment(VerticalAlignment?)
Sets the vertical alignment of the element.
public virtual T SetVerticalAlignment(VerticalAlignment? verticalAlignment)
Parameters
verticalAlignment
VerticalAlignment?the vertical alignment setting
Returns
- T
this element
SetWidth(float)
Sets the width property of a block element, measured in points.
public virtual T SetWidth(float width)
Parameters
width
floata value measured in points.
Returns
- T
this Element.
SetWidth(UnitValue)
Sets the width property of a block element with a UnitValue.
public virtual T SetWidth(UnitValue width)
Parameters
Returns
- T
this Element.