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.
- 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.
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:
trueif 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.
Inherited Members
- PartBase<T>.TryParseText(IList<IPart>, string, int, CultureInfo, out int)
- PartBase<T>.IsEditable
- PartBase<T>.IsLiteral
- PartBase<T>.IsOptional
- PartBase<T>.Length
- PartBase<T>.StartOffset
- PartBase<T>.StringValue
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()