Masked text provider for numeric input of the specified type.
Type parameters:
| T |
Constructors
NumericMaskedTextProvider
#public NumericMaskedTextProvider()
Initializes a new instance of the NumericMaskedTextProvider<T> class.
Properties
AllowDecimal
Gets or sets a value indicating that the mask can optionally include a decimal, as specified by the NumericMaskedTextProvider.DecimalCharacter.
Value:
true to allow the decimal; otherwise, false.AllowSign
Gets or sets a value indicating that the mask can optionally include the sign, as specified by NumericMaskedTextProvider.SignCharacters.
Value:
true to allow a sign character; otherwise, false.AltDecimalCharacters
Gets or sets the alternate decimal character that can be accepted.
Remarks: This is useful when the DecimalCharacter is localized but you still want to allow alternate characters
Builder
Gets the underlying string builder for the current mask text value.
Culture
Gets or sets the culture of the NumericMaskedTextProvider.DecimalCharacter and NumericMaskedTextProvider.SignCharacters formatting characters.
DecimalCharacter
Gets or sets the decimal character when NumericMaskedTextProvider.AllowDecimal is
true. Default is '.'.Gets or sets the minimum number of decimal places to include in the output.
DisplayText
Gets the display text, including prompt characters.
EditPositions
Gets an enumeration of all valid edit positions in the mask.
Value: The valid edit positions.
Implements: EditPositions
Gets or sets the format string to use for formatting the value. If specified, this will override the DecimalPlaces and MaximumDecimalPlaces properties.
IsEmpty
Gets a value indicating the mask is empty with no characters filled out.
Value:
true if the mask value is empty; otherwise, false.Implements: IsEmpty
MaskCompleted
Gets a value indicating whether the mask has all required text to pass its validation.
Value:
true if mask is completed; otherwise, false.Overrides: VariableMaskedTextProvider.MaskCompleted
Gets or sets the maximum number of decimal places to include in the output.
SignCharacters
Gets or sets the sign characters when NumericMaskedTextProvider.AllowSign is
true. Default is '+' and '-'.Text
Gets or sets the text, usually excluding prompt or literal characters depending on the mask provider.
Validate
Gets or sets a delegate used to validate the mask.
Methods
Clear
Called to clear a range of characters at the specified position in the masked text.
Remarks: The cleared characters usually show the prompt character after cleared. This is useful for fixed length mask providers. For variable length, this is usually the same as calling VariableMaskedTextProvider.Delete(int, int, bool).
Parameters:
| position (ref int) | Position to clear at. |
| length (int) | Length of text (in the mask) to clear |
| forward (bool) | true to delete the text forward, or false to delete backward |
Returns:
true when the deletion was successful, or false if it failed.Implements: Clear
public override void CommitText()
Called to update the display text after changes to the mask value.
Remarks: This is called after user changes to the mask value is complete, such as when the control loses focus, or when the user presses enter. This allows the mask provider to update the display text after changes are made to the value, while still allowing the user to type in the text without it changing until they are done.
Overrides: VariableMaskedTextProvider.CommitText
Implements: CommitText
Delete
Called to delete a range of characters at the specified position in the masked text.
Insert
Called to insert a character at the specified position in the masked text.
Returns:
true when the insertion was successful, or false if it failed.Overrides: VariableMaskedTextProvider.Insert
Replace
Called to replace a character at the specified position in the masked text.
Returns:
true when the replacement was successful, or false if it failed.Overrides: VariableMaskedTextProvider.Replace