Class TextElementExtensions
Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll
Provides extension methods for TextElement.
public static class TextElementExtensions
Inheritance
object ← TextElementExtensions
Methods
SetDisplayTooltipWhenElided<T>(T, bool)
Sets displayTooltipWhenElided.
public static T SetDisplayTooltipWhenElided<T>(this T element, bool value) where T : TextElement
Parameters
element T
The element to modify.
value bool
When true, a tooltip shows the full text when it is elided.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
SetEmojiFallbackSupport<T>(T, bool)
Sets emojiFallbackSupport.
public static T SetEmojiFallbackSupport<T>(this T element, bool value) where T : TextElement
Parameters
element T
The element to modify.
value bool
When true, the global emoji fallback list is searched first.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
SetEnableRichText<T>(T, bool)
Sets enableRichText.
public static T SetEnableRichText<T>(this T element, bool value) where T : TextElement
Parameters
element T
The element to modify.
value bool
When true, rich text tags are parsed.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
SetParseEscapeSequences<T>(T, bool)
Sets parseEscapeSequences.
public static T SetParseEscapeSequences<T>(this T element, bool value) where T : TextElement
Parameters
element T
The element to modify.
value bool
When true, escape sequences such as \n are parsed; otherwise, they are shown as raw text.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
SetTextSelf<T>(T, string)
Sets text.
public static T SetTextSelf<T>(this T element, string value) where T : TextElement
Parameters
element T
The element to modify.
value string
The text to set.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
SetTextSelf<T>(T, int)
Sets the text to a number via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, int value) where T : TextElement
Parameters
element T
The element to modify.
value int
The number to show.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, long)
Sets the text to a number via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, long value) where T : TextElement
Parameters
element T
The element to modify.
value long
The number to show.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, ulong)
Sets the text to a number via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, ulong value) where T : TextElement
Parameters
element T
The element to modify.
value ulong
The number to show.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, float, string)
Sets the text to a number via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, float value, string format = null) where T : TextElement
Parameters
element T
The element to modify.
value float
The number to show.
format string
A standard or custom numeric format string; null for the default format.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, ReadOnlySpan<char>)
Sets the text from a character span via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, ReadOnlySpan<char> value) where T : TextElement
Parameters
element T
The element to modify.
value ReadOnlySpan<char>
The characters to copy.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, StringBuilder)
Sets the text from a StringBuilder via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, StringBuilder value) where T : TextElement
Parameters
element T
The element to modify.
value StringBuilder
The builder whose content to copy.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.
SetTextSelf<T>(T, char[], int, int)
Sets the text from a slice of a character array via SetText, without allocating a string.
public static T SetTextSelf<T>(this T element, char[] value, int start, int length) where T : TextElement
Parameters
element T
The element to modify.
value char[]
The array to copy from.
start int
The index of the first character to copy.
length int
The number of characters to copy.
Returns
T
The element, for chaining.
Type Parameters
T
The element type.
Remarks
Allocates a string while the element is not attached to a panel.