MaskedTextProvider.VerifyEscapeChar(Char, Int32) 方法

定义

测试指定的字符是否将在指定位置转义。Tests whether the specified character would be escaped at the specified position.

public:
 bool VerifyEscapeChar(char input, int position);
public bool VerifyEscapeChar (char input, int position);
member this.VerifyEscapeChar : char * int -> bool
Public Function VerifyEscapeChar (input As Char, position As Integer) As Boolean

参数

input
Char

要测试的 Char 值。The Char value to test.

position
Int32

测试输入字符时所根据的掩码位置。The position in the mask to test the input character against.

返回

如果指定的字符将在指定位置转义,则为 true;否则为 falsetrue if the specified character would be escaped at the specified position; otherwise, false.

注解

如果字符是有效的输入,但未分配给带格式的字符串中的位置,则会被称为转义字符。A character is said to be escaped if it is valid input, but is not assigned to that position in the formatted string. 转义字符分为以下三个类别:Escaped characters fall into the following three categories:

  • 如果属性为true,则将AllowPromptAsInput对提示字符进行转义。Prompt characters are escaped if the AllowPromptAsInput property is true.

  • 如果输入字符与掩码中的文本具有相同的值,并且SkipLiterals属性为true,则为。Input characters are escaped if they have the same value as the literal in the mask, and if the SkipLiterals property is true.

  • 如果属性为true,则对ResetOnSpace空格字符进行转义。Space characters are escaped if the ResetOnSpace property is true.

如果VerifyEscapeChar false 参数小于Mask零或大于Length的,则该方法也将返回。 posThe VerifyEscapeChar method will also return false if the pos parameter is less than zero or greater than the Length of the Mask.

适用于

另请参阅