System.ComponentModel.MaskedTextProvider.VerifyChar C# (CSharp) Method

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
        public bool VerifyChar(char input, int position, out MaskedTextResultHint hint)
        {
            hint = MaskedTextResultHint.NoEffect;

            if (position < 0 || position >= _testString.Length)
            {
                hint = MaskedTextResultHint.PositionOutOfRange;
                return false;
            }

            return TestChar(input, position, out hint);
        }

Usage Example

		public void VerifyCharTest00001 ()
		{
			MaskedTextProvider mtp;
			int Int32_out = 0;
			MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
			mtp = new MaskedTextProvider (@"abc");
			mtp.Add (@"a");
			mtp.Add ('\x61');
			mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
			Assert.AreEqual (false, mtp.VerifyChar ('\x0', -1, out MaskedTextResultHint_out), "#0");
			Assert.AreEqual (MaskedTextResultHint.PositionOutOfRange, MaskedTextResultHint_out, "#1");
			MaskedTextProviderTest.AssertProperties (mtp, "VerifyCharTest", 2, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
		}
All Usage Examples Of System.ComponentModel.MaskedTextProvider::VerifyChar