In This Article

FormattedPartBase<T> Class

Represents a part that uses a format for text conversion.

public abstract class FormattedPartBase<T> : PartBase<T>, IPart
Type Parameters:
T -

The part value type.

Inheritance:
object PartBase<T> object
Derived:
NumberPartBase<T>
Implements:
IPart

Constructors

FormattedPartBase(string?)

Initializes an instance of the class.

protected FormattedPartBase(string? format = null)
Parameter Type Description
format string

The format.

Properties

Format

The format.

public string? Format { get; set; }

Property Value

string

Methods

CoerceFormat(string?)

Coerces a new Format value.

protected virtual string? CoerceFormat(string? value)
Parameter Type Description
value string

The new value being set.

Returns

string:

The coerced value to set.

IsTextInputAllowed(string, int, CultureInfo)

Indicates whether the input text is allowed.

public override bool IsTextInputAllowed(string text, int offset, CultureInfo culture)
Parameter Type Description
text string

The text to examine.

offset int

The absolute offset at which the text would be input if allowed, which can be compared to StartOffset to determine the relative offset within the part.

culture CultureInfo

The CultureInfo to use.

Returns

bool:

true if the text input is allowed; otherwise, false.

Remarks

This method is only called when the corresponding edit box has enabled input filtering.

See Also

OnFormatChanged()

Called after the value of the Format property changes.

protected virtual void OnFormatChanged()

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods