Class TextItem
Represents a text item.
Inherited Members
Namespace: Neodynamic.SDK.Printing
Assembly: cs.temp.dll.dll
Syntax
public class TextItem : Item, IXmlTemplate, INotifyPropertyChanged
Constructors
TextItem()
Initializes a new instance of the TextItem class.
Declaration
public TextItem()
TextItem(Double, Double, Double, Double, String)
Initializes a new instance of the TextItem class with the specified location, size and text.
Declaration
public TextItem(double x, double y, double width, double height, string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | The x-coordinate of the upper-left corner of the item relative to the upper-left corner of its container. |
| System.Double | y | The y-coordinate of the upper-left corner of the item relative to the upper-left corner of its container. |
| System.Double | width | The width of the item container. |
| System.Double | height | The height of the item container. |
| System.String | text | The text. |
Properties
BackColor
Gets or sets the background color of the text. Default value is White
Declaration
public Color BackColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
BorderColor
Gets or sets the color of the border of the rectangle container. Default value is Black
Declaration
public Color BorderColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
BorderThickness
Gets or sets the thickness for each side of the rectangle container. Default value is 0 (zero)
Declaration
public FrameThickness BorderThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| FrameThickness |
CornerRadius
Gets or sets the radii of a rectangle's corners. Default value is 0 (zero)
Declaration
public RectangleCornerRadius CornerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| RectangleCornerRadius |
CounterStep
Gets or sets the step for the counter. The counter will increase (positive) or decrease (negative) by this number on every printed label. Default value is 0 (zero)
Declaration
public int CounterStep { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
CounterUseLeadingZeros
Gets or sets whether leading zeros are printed or suppressed when using counters. Default value is false
Declaration
public bool CounterUseLeadingZeros { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CultureName
Gets or sets the Culture Name for text formatting. Default is en-US. Other sample values: de-DE, es-ES, etc. Any value supported by .NET CultureInfo class.
Declaration
public string CultureName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Font
Gets the Font object for the text. Default value is Arial, 8pt
Declaration
public Font Font { get; }
Property Value
| Type | Description |
|---|---|
| Font |
ForeColor
Gets or sets the foreground color of the text. Default value is Black
Declaration
public Color ForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Height
Gets or sets the height of the text item. Default value is 0.5
Declaration
public double Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
HideIfEmpty
Gets or sets whether this text item is not displayed or printed if the value to encode is empty. Default value is false
Declaration
public bool HideIfEmpty { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Mask
Gets or sets the input Mask for the text. Default value is an empty string
Declaration
public string Mask { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
The length of the mask defines the number of characters to be formatted or masked. The mask is aligned to the characters in the target string starting with the right-most position.
The input mask can consist of the following characters: D or d (Decimal numeric 0-9) H or h (Hexadecimal 0�9 plus a-f or A-F) O or o (Octal 0�7) A or a (Alphabetic A�Z or a�z) N or n (Alphanumeric 0�9 plus A�Z or a�z) % (Ignore character or skip)
MaskIncrement
Gets or sets the mask increment. The increment is the value to be added to the text on each label to be printed. Default value is an empty string
Declaration
public string MaskIncrement { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
The default value for the increment is equivalent to a decimal value of 1 (one). The string is composed of any characters defined in the input mask. Invalid characters are assumed to be equal to a value of 0 (zero) in that characters position.
The increment value for alphabetic strings start with 'A' or 'a' as the zero placeholder. This means to increment an alphabetic character by one, a value of 'B' or 'b' must be in the increment string.
For characters that do not get incremented, the '%' character needs to be added to the increment string.
MaxLength
Gets or sets the maximum number of characters allowed for this text item object. Default is 0 which means that unlimited number of characters will be allowed.
Declaration
public int MaxLength { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RightToLeft
Gets or sets whether the text should draw right-to-left for RTL languages. Default value is false
Declaration
public bool RightToLeft { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RotationAngle
Gets or sets the rotation angle to apply on this item. It is measured clockwise from the x-axis. Default value is 0 (zero)
Declaration
public int RotationAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | The specified value is not range from 0 to 360. |
Sizing
Gets or sets the text sizing. Default value is None
Declaration
public TextSizing Sizing { get; set; }
Property Value
| Type | Description |
|---|---|
| TextSizing |
Text
Gets or sets the text. Default value is an empty string
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
TextAlignment
Gets or sets the alignment of the text. Default value is Left
Declaration
public TextAlignment TextAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| TextAlignment |
TextPadding
Gets or sets the amount of space between the container's border and the text content. Default value is 0 (zero)
Declaration
public FrameThickness TextPadding { get; set; }
Property Value
| Type | Description |
|---|---|
| FrameThickness |
Width
Gets or sets the width of the text item. Default value is 1
Declaration
public double Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Methods
Clone()
Creates a copy of the current TextItem.
Declaration
public override Item Clone()
Returns
| Type | Description |
|---|---|
| Item | A copy of the current TextItem. |
Overrides
ConvertToUnit(UnitType)
Declaration
public override void ConvertToUnit(UnitType unit)
Parameters
| Type | Name | Description |
|---|---|---|
| UnitType | unit |
Overrides
GetAutoSize()
Gets the size of this TextItem that fits its content.
Declaration
public Tuple<double, double> GetAutoSize()
Returns
| Type | Description |
|---|---|
| System.Tuple<System.Double, System.Double> | The size of this TextItem that fits its content. Item1 refers to the Width and Item2 refers to the Height. |
GetAutoSize(Double)
Gets the size of this TextItem that fits its content within the specified maximum width.
Declaration
public Tuple<double, double> GetAutoSize(double maxWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | maxWidth | The maximum text width (length) in the specified UnitType of this TextItem. |
Returns
| Type | Description |
|---|---|
| System.Tuple<System.Double, System.Double> | The size of this TextItem that fits its content within the specified maximum width. Item1 refers to the Width and Item2 refers to the Height. |
UpdateFrom(Item)
Declaration
public override void UpdateFrom(Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The TextItem object that is used for updating this TextItem object. |