C# Class System.ComponentModel.MaskedTextProvider

Provides functionality for formatting a test string against a mask string. MaskedTextProvider is stateful, it keeps information about the input characters so multiple call to Add/Remove will work in the same buffer. Most of the operations are performed on a virtual string containing the input characters as opposed to the test string itself, since mask literals cannot be modified (i.e: replacing on a literal position will actually replace on the nearest edit position forward).
Inheritance: ICloneable
Show file Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
Add ( char input ) : bool

Attempts to add the specified charactert to the last unoccupied positions in the test string (append text to the virtual string). Returns true on success, false otherwise.

Add ( char input, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Attempts to add the specified charactert to the last unoccupied positions in the test string (append text to the virtual string). On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives a hint about the operation result reason. Returns true on success, false otherwise.

Add ( string input ) : bool

Attempts to add the characters in the specified string to the last unoccupied positions in the test string (append text to the virtual string). Returns true on success, false otherwise.

Add ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Attempts to add the characters in the specified string to the last unoccupied positions in the test string (append text to the virtual string). On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives a hint about the operation result reason. Returns true on success, false otherwise.

Clear ( ) : void

Resets the state of the test string edit chars. (Remove all characters from the virtual string).

Clear ( MaskedTextResultHint &resultHint ) : void

Resets the state of the test string edit chars. (Remove all characters from the virtual string). The MaskedTextResultHint out param gives more information about the operation result.

FindAssignedEditPositionFrom ( int position, bool direction ) : int

Gets the position of the first edit char in the test string, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.

FindAssignedEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int

Gets the position of the first edit char in the test string in the specified range, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.

FindEditPositionFrom ( int position, bool direction ) : int

Gets the position of the first assigned edit char in the test string, the search starts from the specified position included and in the direction specified (true == forward). The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.

FindEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int

Gets the position of the first assigned edit char in the test string; the search is performed in the specified positions range and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.

FindNonEditPositionFrom ( int position, bool direction ) : int

Gets the position of the first non edit position in the test string; the search is performed from the specified position and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.

FindNonEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int

Gets the position of the first non edit position in the test string; the search is performed in the specified positions range and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.

FindUnassignedEditPositionFrom ( int position, bool direction ) : int

Gets the position of the first edit char in the test string, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.

GetOperationResultFromHint ( MaskedTextResultHint hint ) : bool

Specifies whether the specified MaskedTextResultHint denotes success or not.

InsertAt ( char input, int position ) : bool

Attempts to insert the specified character at the specified position in the test string. (Insert character in the virtual string). Returns true on success, false otherwise.

InsertAt ( char input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Attempts to insert the specified character at the specified position in the test string, shifting characters at upper positions (if any) to make room for the input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

InsertAt ( string input, int position ) : bool

Attempts to insert the characters in the specified string in at the specified position in the test string. (Insert characters in the virtual string). Returns true on success, false otherwise.

InsertAt ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Attempts to insert the characters in the specified string in at the specified position in the test string, shifting characters at upper positions (if any) to make room for the input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

IsAvailablePosition ( int position ) : bool

Checks wheteher the specified position is available for assignment. Returns false if it is assigned or it is not editable, true otherwise.

IsEditPosition ( int position ) : bool

Checks wheteher the specified position in the test string is editable.

IsValidInputChar ( char c ) : bool

Checks wheteher the specified character is a valid input char.

IsValidMaskChar ( char c ) : bool

Checks wheteher the specified character is a valid input char.

IsValidPasswordChar ( char c ) : bool

Checks wheteher the specified character is a valid password char.

MaskedTextProvider ( string mask ) : System

Creates a MaskedTextProvider object from the specified mask.

MaskedTextProvider ( string mask, CultureInfo culture ) : System

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used.

MaskedTextProvider ( string mask, CultureInfo culture, bool restrictToAscii ) : System

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.

MaskedTextProvider ( string mask, CultureInfo culture, bool allowPromptAsInput, char promptChar, char passwordChar, bool restrictToAscii ) : System

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not. 'promptChar' specifies the character to be used for the prompt. 'passwordChar' specifies the character to be used in the password string. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.

MaskedTextProvider ( string mask, CultureInfo culture, char passwordChar, bool allowPromptAsInput ) : System

Creates a MaskedTextProvider object from the specified mask . 'passwordChar' specifies the character to be used in the password string. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not.

MaskedTextProvider ( string mask, bool restrictToAscii ) : System

Creates a MaskedTextProvider object from the specified mask. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.

MaskedTextProvider ( string mask, char passwordChar, bool allowPromptAsInput ) : System

Creates a MaskedTextProvider object from the specified mask . 'passwordChar' specifies the character to be used in the password string. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not.

Remove ( ) : bool

Removes the last character from the formatted string. (Remove last character in virtual string).

Remove ( int &testPosition, MaskedTextResultHint &resultHint ) : bool

Removes the last character from the formatted string. (Remove last character in virtual string). On exit the out param contains the position where the operation was actually performed. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

RemoveAt ( int position ) : bool

Removes the character from the formatted string at the specified position and shifts characters left. True if character shifting is successful.

RemoveAt ( int startPosition, int endPosition ) : bool

Removes all characters in edit position from in the test string at the specified start and end positions and shifts any remaining characters left. (Remove characters from the virtual string). Returns true on success, false otherwise.

RemoveAt ( int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Removes all characters in edit position from in the test string at the specified start and end positions and shifts any remaining characters left. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Replace ( char input, int position ) : bool

Replaces the first editable character in the test string from the specified position, with the specified character (Replace is performed in the virtual string), unless the character at the specified position is to be escaped. Returns true on success, false otherwise.

Replace ( char input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Replaces the first editable character in the test string from the specified position, with the specified character, unless the character at the specified position is to be escaped. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Replace ( char input, int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Replaces the first editable character in the test string from the specified position, with the specified character and removes any remaining characters in the range unless the character at the specified position is to be escaped. If specified range covers more than one assigned edit character, shift-left is performed after replacing the first character. This is useful when in a edit box the user selects text and types a character to replace it. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Replace ( string input, int position ) : bool

Replaces the character at the first edit position from the one specified with the first character in the input; the rest of the characters in the input will be placed in the test string according to the InsertMode (insert/replace). (Replace is performed in the virtual text). Returns true on success, false otherwise.

Replace ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Replaces the character at the first edit position from the one specified with the first character in the input; the rest of the characters in the input will be placed in the test string according to the InsertMode (insert/replace), shifting characters at upper positions (if any) to make room for the entire input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Replace ( string input, int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Replaces the characters in the specified range with the characters in the input string and shifts characters appropriately (removing or inserting characters according to whether the input string is shorter or larger than the specified range. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Set ( string input ) : bool

Sets the edit characters in the test string to the ones specified in the input string if all characters are valid. If passwordChar is assigned, it is rendered in the output string instead of the user-supplied values.

Set ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Sets the edit characters in the test string to the ones specified in the input string if all characters are valid. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. If passwordChar is assigned, it is rendered in the output string instead of the user-supplied values.

ToDisplayString ( ) : string

Returns a formatted string based on the mask, honoring only the PasswordChar property. prompt character and literals are always included. This is the text to be shown in a control when it has the focus.

ToString ( ) : string

Returns a formatted string based on the mask, honoring IncludePrompt and IncludeLiterals but ignoring PasswordChar.

ToString ( bool ignorePasswordChar ) : string

Returns a formatted string based on the mask, honoring the IncludePrompt and IncludeLiterals properties, and PasswordChar depending on the value of the 'ignorePasswordChar' parameter.

ToString ( bool includePrompt, bool includeLiterals ) : string

Returns a formatted string based on the mask, ignoring the PasswordChar and according to the includePrompt and includeLiterals parameters.

ToString ( bool ignorePasswordChar, bool includePrompt, bool includeLiterals, int startPosition, int length ) : string

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, according to the ignorePasswordChar, includePrompt and includeLiterals parameters. Parameters are relative to the test string.

ToString ( bool includePrompt, bool includeLiterals, int startPosition, int length ) : string

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, according to the ignorePasswordChar, includePrompt and includeLiterals parameters. Parameters are relative to the test string.

ToString ( bool ignorePasswordChar, int startPosition, int length ) : string

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, honoring the IncludePrompt, IncludeLiterals properties and PasswordChar depending on the 'ignorePasswordChar' parameter. Parameters are relative to the test string.

ToString ( int startPosition, int length ) : string

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, honoring IncludePrompt and IncludeLiterals but ignoring PasswordChar. Parameters are relative to the test string.

VerifyChar ( char input, int position, MaskedTextResultHint &hint ) : bool

Tests whether the specified character would be set successfully at the specified position.

VerifyEscapeChar ( char input, int position ) : bool

Tests whether the specified character would be escaped at the specified position.

VerifyString ( string input ) : bool

Verifies the test string against the mask.

VerifyString ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Verifies the test string against the mask. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

this ( int index ) : char

Indexer.

Private Methods

Method Description
Clone ( ) : object
FindEditPositionInRange ( int startPosition, int endPosition, bool direction, byte assignedStatus ) : int

Gets the position of the first edit char in the test string in the specified range, according to the assignedRequired parameter; if true, it gets the first assigned position otherwise the first unassigned one. The search starts from the specified position included. Returns InvalidIndex if it doesn't find one.

FindPositionInRange ( int startPosition, int endPosition, bool direction, CharType charTypeFlags ) : int

Finds a position in the test string according to the needed position type (needEditPos). The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.

FindUnassignedEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int
Initialize ( ) : void

Initializes the test string according to the mask and populates the character descirptor table (stringDescriptor).

InsertAtInt ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint, bool testOnly ) : bool

Attempts to insert the characters in the specified string in at the specified position in the test string, shifting characters at upper positions (if any) to make room for the input. It performs the insertion if the testOnly parameter is false and the test passes. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

IsAciiAlphanumeric ( char c ) : bool

Helper function for alphanumeric char in ascii mode.

IsAlphanumeric ( char c ) : bool

Helper function for testing mask language alphanumeric identifiers.

IsAscii ( char c ) : bool

Helper function for testing char in ascii mode.

IsAsciiLetter ( char c ) : bool

Helper function for testing letter char in ascii mode.

IsEditPosition ( CharDescriptor charDescriptor ) : bool
IsLiteralPosition ( CharDescriptor charDescriptor ) : bool

Checks wheteher the character in the specified position is a literal and the same as the specified character.

IsPrintableChar ( char c ) : bool

Checks wheteher the specified character is valid as part of a mask or an input string.

RemoveAtInt ( int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint, bool testOnly ) : bool

Removes all characters in edit position from in the test string at the specified start and end positions and shifts any remaining characters left. If testOnly parameter is set to false and the test passes it performs the operations on the characters. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

ResetChar ( int testPosition ) : void

Resets the test string character at the specified position.

ResetString ( int startPosition, int endPosition ) : void

Resets characters in the test string in the range defined by the specified positions. Position is relative to the test string and count is the number of edit characters to reset.

SetChar ( char input, int position ) : void

Sets the character at the specified position in the test string to the specified value. Returns true on success, false otherwise.

SetChar ( char input, int position, CharDescriptor charDescriptor ) : void

Sets the character at the specified position in the test string to the specified value. SetChar increments the number of assigned characters in the test string.

SetString ( string input, int testPosition ) : void

Sets the characters in the test string starting from the specified position, to the ones in the input string. It assumes there's enough edit positions to hold the characters in the input string (so call TestString before calling SetString). The position is relative to the test string.

SynchronizeInputOptions ( MaskedTextProvider mtp, bool includePrompt, bool includeLiterals ) : void

Upadate the input processing options according to the output formatting options to guarantee text round-tripping, this is: the Text property does not change when setting it to the value obtain from it; for a control: when copying the text to the clipboard and then pasting it back while selecting the entire text.

TestChar ( char input, int position, MaskedTextResultHint &resultHint ) : bool

Tests whether the character at the specified position in the test string can be set to the specified value. The position specified is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

TestEscapeChar ( char input, int position ) : bool

Tests if the character at the specified position in the test string is to be escaped. Returns true on success, false otherwise.

TestEscapeChar ( char input, int position, CharDescriptor charDex ) : bool
TestSetChar ( char input, int position, MaskedTextResultHint &resultHint ) : bool

Tests if the character at the specified position in the test string can be set to the value specified, and sets the character to that value if the test is successful. The position specified is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

TestSetString ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Test the characters in the specified string agaist the test string, starting from the specified position. If the test is successful, the characters in the test string are set appropriately. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

TestString ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool

Test the characters in the specified string agaist the test string, starting from the specified position. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The successCount out param contains the number of characters that would be actually set (not escaped). The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.

Method Details

Add() public method

Attempts to add the specified charactert to the last unoccupied positions in the test string (append text to the virtual string). Returns true on success, false otherwise.
public Add ( char input ) : bool
input char
return bool

Add() public method

Attempts to add the specified charactert to the last unoccupied positions in the test string (append text to the virtual string). On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives a hint about the operation result reason. Returns true on success, false otherwise.
public Add ( char input, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input char
testPosition int
resultHint MaskedTextResultHint
return bool

Add() public method

Attempts to add the characters in the specified string to the last unoccupied positions in the test string (append text to the virtual string). Returns true on success, false otherwise.
public Add ( string input ) : bool
input string
return bool

Add() public method

Attempts to add the characters in the specified string to the last unoccupied positions in the test string (append text to the virtual string). On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives a hint about the operation result reason. Returns true on success, false otherwise.
public Add ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
testPosition int
resultHint MaskedTextResultHint
return bool

Clear() public method

Resets the state of the test string edit chars. (Remove all characters from the virtual string).
public Clear ( ) : void
return void

Clear() public method

Resets the state of the test string edit chars. (Remove all characters from the virtual string). The MaskedTextResultHint out param gives more information about the operation result.
public Clear ( MaskedTextResultHint &resultHint ) : void
resultHint MaskedTextResultHint
return void

FindAssignedEditPositionFrom() public method

Gets the position of the first edit char in the test string, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.
public FindAssignedEditPositionFrom ( int position, bool direction ) : int
position int
direction bool
return int

FindAssignedEditPositionInRange() public method

Gets the position of the first edit char in the test string in the specified range, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.
public FindAssignedEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int
startPosition int
endPosition int
direction bool
return int

FindEditPositionFrom() public method

Gets the position of the first assigned edit char in the test string, the search starts from the specified position included and in the direction specified (true == forward). The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.
public FindEditPositionFrom ( int position, bool direction ) : int
position int
direction bool
return int

FindEditPositionInRange() public method

Gets the position of the first assigned edit char in the test string; the search is performed in the specified positions range and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.
public FindEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int
startPosition int
endPosition int
direction bool
return int

FindNonEditPositionFrom() public method

Gets the position of the first non edit position in the test string; the search is performed from the specified position and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.
public FindNonEditPositionFrom ( int position, bool direction ) : int
position int
direction bool
return int

FindNonEditPositionInRange() public method

Gets the position of the first non edit position in the test string; the search is performed in the specified positions range and in the specified direction. The positions are relative to the test string. Returns InvalidIndex if it doesn't find one.
public FindNonEditPositionInRange ( int startPosition, int endPosition, bool direction ) : int
startPosition int
endPosition int
direction bool
return int

FindUnassignedEditPositionFrom() public method

Gets the position of the first edit char in the test string, the search starts from the specified position included. Returns InvalidIndex if it doesn't find one.
public FindUnassignedEditPositionFrom ( int position, bool direction ) : int
position int
direction bool
return int

GetOperationResultFromHint() public static method

Specifies whether the specified MaskedTextResultHint denotes success or not.
public static GetOperationResultFromHint ( MaskedTextResultHint hint ) : bool
hint MaskedTextResultHint
return bool

InsertAt() public method

Attempts to insert the specified character at the specified position in the test string. (Insert character in the virtual string). Returns true on success, false otherwise.
public InsertAt ( char input, int position ) : bool
input char
position int
return bool

InsertAt() public method

Attempts to insert the specified character at the specified position in the test string, shifting characters at upper positions (if any) to make room for the input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public InsertAt ( char input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input char
position int
testPosition int
resultHint MaskedTextResultHint
return bool

InsertAt() public method

Attempts to insert the characters in the specified string in at the specified position in the test string. (Insert characters in the virtual string). Returns true on success, false otherwise.
public InsertAt ( string input, int position ) : bool
input string
position int
return bool

InsertAt() public method

Attempts to insert the characters in the specified string in at the specified position in the test string, shifting characters at upper positions (if any) to make room for the input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public InsertAt ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
position int
testPosition int
resultHint MaskedTextResultHint
return bool

IsAvailablePosition() public method

Checks wheteher the specified position is available for assignment. Returns false if it is assigned or it is not editable, true otherwise.
public IsAvailablePosition ( int position ) : bool
position int
return bool

IsEditPosition() public method

Checks wheteher the specified position in the test string is editable.
public IsEditPosition ( int position ) : bool
position int
return bool

IsValidInputChar() public static method

Checks wheteher the specified character is a valid input char.
public static IsValidInputChar ( char c ) : bool
c char
return bool

IsValidMaskChar() public static method

Checks wheteher the specified character is a valid input char.
public static IsValidMaskChar ( char c ) : bool
c char
return bool

IsValidPasswordChar() public static method

Checks wheteher the specified character is a valid password char.
public static IsValidPasswordChar ( char c ) : bool
c char
return bool

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask.
public MaskedTextProvider ( string mask ) : System
mask string
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used.
public MaskedTextProvider ( string mask, CultureInfo culture ) : System
mask string
culture System.Globalization.CultureInfo
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.
public MaskedTextProvider ( string mask, CultureInfo culture, bool restrictToAscii ) : System
mask string
culture System.Globalization.CultureInfo
restrictToAscii bool
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask. 'culture' is used to set the separator characters to the correspondig locale character; if null, the current culture is used. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not. 'promptChar' specifies the character to be used for the prompt. 'passwordChar' specifies the character to be used in the password string. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.
public MaskedTextProvider ( string mask, CultureInfo culture, bool allowPromptAsInput, char promptChar, char passwordChar, bool restrictToAscii ) : System
mask string
culture System.Globalization.CultureInfo
allowPromptAsInput bool
promptChar char
passwordChar char
restrictToAscii bool
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask . 'passwordChar' specifies the character to be used in the password string. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not.
public MaskedTextProvider ( string mask, CultureInfo culture, char passwordChar, bool allowPromptAsInput ) : System
mask string
culture System.Globalization.CultureInfo
passwordChar char
allowPromptAsInput bool
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask. 'restrictToAscii' specifies whether the input characters should be restricted to ASCII characters only.
public MaskedTextProvider ( string mask, bool restrictToAscii ) : System
mask string
restrictToAscii bool
return System

MaskedTextProvider() public method

Creates a MaskedTextProvider object from the specified mask . 'passwordChar' specifies the character to be used in the password string. 'allowPromptAsInput' specifies whether the prompt character should be accepted as a valid input or not.
public MaskedTextProvider ( string mask, char passwordChar, bool allowPromptAsInput ) : System
mask string
passwordChar char
allowPromptAsInput bool
return System

Remove() public method

Removes the last character from the formatted string. (Remove last character in virtual string).
public Remove ( ) : bool
return bool

Remove() public method

Removes the last character from the formatted string. (Remove last character in virtual string). On exit the out param contains the position where the operation was actually performed. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public Remove ( int &testPosition, MaskedTextResultHint &resultHint ) : bool
testPosition int
resultHint MaskedTextResultHint
return bool

RemoveAt() public method

Removes the character from the formatted string at the specified position and shifts characters left. True if character shifting is successful.
public RemoveAt ( int position ) : bool
position int
return bool

RemoveAt() public method

Removes all characters in edit position from in the test string at the specified start and end positions and shifts any remaining characters left. (Remove characters from the virtual string). Returns true on success, false otherwise.
public RemoveAt ( int startPosition, int endPosition ) : bool
startPosition int
endPosition int
return bool

RemoveAt() public method

Removes all characters in edit position from in the test string at the specified start and end positions and shifts any remaining characters left. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public RemoveAt ( int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool
startPosition int
endPosition int
testPosition int
resultHint MaskedTextResultHint
return bool

Replace() public method

Replaces the first editable character in the test string from the specified position, with the specified character (Replace is performed in the virtual string), unless the character at the specified position is to be escaped. Returns true on success, false otherwise.
public Replace ( char input, int position ) : bool
input char
position int
return bool

Replace() public method

Replaces the first editable character in the test string from the specified position, with the specified character, unless the character at the specified position is to be escaped. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public Replace ( char input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input char
position int
testPosition int
resultHint MaskedTextResultHint
return bool

Replace() public method

Replaces the first editable character in the test string from the specified position, with the specified character and removes any remaining characters in the range unless the character at the specified position is to be escaped. If specified range covers more than one assigned edit character, shift-left is performed after replacing the first character. This is useful when in a edit box the user selects text and types a character to replace it. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public Replace ( char input, int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input char
startPosition int
endPosition int
testPosition int
resultHint MaskedTextResultHint
return bool

Replace() public method

Replaces the character at the first edit position from the one specified with the first character in the input; the rest of the characters in the input will be placed in the test string according to the InsertMode (insert/replace). (Replace is performed in the virtual text). Returns true on success, false otherwise.
public Replace ( string input, int position ) : bool
input string
position int
return bool

Replace() public method

Replaces the character at the first edit position from the one specified with the first character in the input; the rest of the characters in the input will be placed in the test string according to the InsertMode (insert/replace), shifting characters at upper positions (if any) to make room for the entire input. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public Replace ( string input, int position, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
position int
testPosition int
resultHint MaskedTextResultHint
return bool

Replace() public method

Replaces the characters in the specified range with the characters in the input string and shifts characters appropriately (removing or inserting characters according to whether the input string is shorter or larger than the specified range. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public Replace ( string input, int startPosition, int endPosition, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
startPosition int
endPosition int
testPosition int
resultHint MaskedTextResultHint
return bool

Set() public method

Sets the edit characters in the test string to the ones specified in the input string if all characters are valid. If passwordChar is assigned, it is rendered in the output string instead of the user-supplied values.
public Set ( string input ) : bool
input string
return bool

Set() public method

Sets the edit characters in the test string to the ones specified in the input string if all characters are valid. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. If passwordChar is assigned, it is rendered in the output string instead of the user-supplied values.
public Set ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
testPosition int
resultHint MaskedTextResultHint
return bool

ToDisplayString() public method

Returns a formatted string based on the mask, honoring only the PasswordChar property. prompt character and literals are always included. This is the text to be shown in a control when it has the focus.
public ToDisplayString ( ) : string
return string

ToString() public method

Returns a formatted string based on the mask, honoring IncludePrompt and IncludeLiterals but ignoring PasswordChar.
public ToString ( ) : string
return string

ToString() public method

Returns a formatted string based on the mask, honoring the IncludePrompt and IncludeLiterals properties, and PasswordChar depending on the value of the 'ignorePasswordChar' parameter.
public ToString ( bool ignorePasswordChar ) : string
ignorePasswordChar bool
return string

ToString() public method

Returns a formatted string based on the mask, ignoring the PasswordChar and according to the includePrompt and includeLiterals parameters.
public ToString ( bool includePrompt, bool includeLiterals ) : string
includePrompt bool
includeLiterals bool
return string

ToString() public method

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, according to the ignorePasswordChar, includePrompt and includeLiterals parameters. Parameters are relative to the test string.
public ToString ( bool ignorePasswordChar, bool includePrompt, bool includeLiterals, int startPosition, int length ) : string
ignorePasswordChar bool
includePrompt bool
includeLiterals bool
startPosition int
length int
return string

ToString() public method

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, according to the ignorePasswordChar, includePrompt and includeLiterals parameters. Parameters are relative to the test string.
public ToString ( bool includePrompt, bool includeLiterals, int startPosition, int length ) : string
includePrompt bool
includeLiterals bool
startPosition int
length int
return string

ToString() public method

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, honoring the IncludePrompt, IncludeLiterals properties and PasswordChar depending on the 'ignorePasswordChar' parameter. Parameters are relative to the test string.
public ToString ( bool ignorePasswordChar, int startPosition, int length ) : string
ignorePasswordChar bool
startPosition int
length int
return string

ToString() public method

Returns a formatted string starting at the specified position and for the specified number of character, based on the mask, honoring IncludePrompt and IncludeLiterals but ignoring PasswordChar. Parameters are relative to the test string.
public ToString ( int startPosition, int length ) : string
startPosition int
length int
return string

VerifyChar() public method

Tests whether the specified character would be set successfully at the specified position.
public VerifyChar ( char input, int position, MaskedTextResultHint &hint ) : bool
input char
position int
hint MaskedTextResultHint
return bool

VerifyEscapeChar() public method

Tests whether the specified character would be escaped at the specified position.
public VerifyEscapeChar ( char input, int position ) : bool
input char
position int
return bool

VerifyString() public method

Verifies the test string against the mask.
public VerifyString ( string input ) : bool
input string
return bool

VerifyString() public method

Verifies the test string against the mask. On exit the testPosition contains last position where the primary operation was actually performed if successful, otherwise the first position that made the test fail. This position is relative to the test string. The MaskedTextResultHint out param gives more information about the operation result. Returns true on success, false otherwise.
public VerifyString ( string input, int &testPosition, MaskedTextResultHint &resultHint ) : bool
input string
testPosition int
resultHint MaskedTextResultHint
return bool

this() public method

Indexer.
public this ( int index ) : char
index int
return char