当前位置: 首页>>代码示例>>C#>>正文


C# MaskedTextProvider.VerifyString方法代码示例

本文整理汇总了C#中System.ComponentModel.MaskedTextProvider.VerifyString方法的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextProvider.VerifyString方法的具体用法?C# MaskedTextProvider.VerifyString怎么用?C# MaskedTextProvider.VerifyString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.ComponentModel.MaskedTextProvider的用法示例。


在下文中一共展示了MaskedTextProvider.VerifyString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsValidDateTimeAccordingMask

 /// <summary>
 /// Check if the received string value matches with the Introduction Mask for DateTime datatype.
 /// </summary>
 /// <param name="stringValue">String to be checked.</param>
 /// <returns>Returns true if the string matches with Introduction Mask.</returns>
 private bool IsValidDateTimeAccordingMask(string stringValue)
 {
     bool result = true;
     if (mMask != string.Empty)
     {
         MaskedTextProvider maskTextProvider = new MaskedTextProvider(ConvertMask2DisplayMask(mMask));
         result = maskTextProvider.VerifyString(stringValue);
     }
     return result;
 }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:15,代码来源:DateTimePickerPresentation.cs

示例2: VerifyString_string_int_MaskedTextResultHintTest00010

		public void VerifyString_string_int_MaskedTextResultHintTest00010 ()
		{
			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.VerifyString (@"a longer string value", out Int32_out, out MaskedTextResultHint_out), "#12");
			Assert.AreEqual (MaskedTextResultHint.UnavailableEditPosition, MaskedTextResultHint_out, "#13");
			Assert.AreEqual (3, Int32_out, "#14");
			MaskedTextProviderTest.AssertProperties (mtp, "VerifyString_string_int_MaskedTextResultHintTest", 15, 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");
		}
开发者ID:peterdocter,项目名称:mono,代码行数:14,代码来源:MaskedTextProviderTest.cs

示例3: IsValidStringAccordingMask

 /// <summary>
 /// Check if the received string value matches with the Introduction Mask for String datatype.
 /// </summary>
 /// <param name="stringValue">String to be checked.</param>
 /// <returns>Returns true if the received string matches with Introduction Mask.</returns>
 private bool IsValidStringAccordingMask(string stringValue)
 {
     bool result = true;
     if (Mask != string.Empty)
     {
         MaskedTextProvider maskTextProvider = new MaskedTextProvider(Mask);
         maskTextProvider.IncludeLiterals = false;
         maskTextProvider.Set(stringValue);
         result = maskTextProvider.VerifyString(stringValue) && maskTextProvider.MaskCompleted;
     }
     return result;
 }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:17,代码来源:MaskedTextBoxPresentation.cs

示例4: VerifyString_string_int_MaskedTextResultHintTest00007

		public void VerifyString_string_int_MaskedTextResultHintTest00007 ()
		{
			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 (true, mtp.VerifyString (@"a", out Int32_out, out MaskedTextResultHint_out), "#0");
			Assert.AreEqual (MaskedTextResultHint.NoEffect, MaskedTextResultHint_out, "#1");
			Assert.AreEqual (0, Int32_out, "#2");
			MaskedTextProviderTest.AssertProperties (mtp, "VerifyString_string_int_MaskedTextResultHintTest", 3, 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");
		}
开发者ID:peterdocter,项目名称:mono,代码行数:14,代码来源:MaskedTextProviderTest.cs

示例5: HasValue

 /// <summary>
 /// Checks if the editor has value or not.
 /// </summary>
 /// <returns>Return true if the editor has a value.</returns>
 private bool HasValue()
 {
     bool lResult = true;
     if (Mask != null && !Mask.Equals(string.Empty))
     {
         // Only String and Time data types can have masks in this Presentation. Check them separately.
         if (mDataType == ModelType.Time)
         {
             // Get the Time value without Time separators in order to check if the editor control has value.
             string lAuxStringValue = mMaskedTextBoxIT.Text.Replace(mMaskedTextBoxIT.Culture.DateTimeFormat.TimeSeparator, "");
             lResult = !string.IsNullOrEmpty(lAuxStringValue.Trim());
         }
         else
         {
             // String data type.
             MaskedTextProvider maskTextProvider = new MaskedTextProvider(Mask);
             maskTextProvider.IncludeLiterals = false;
             if (!maskTextProvider.VerifyString(mMaskedTextBoxIT.Text))
             {
                 // If the value assigned to the control does not satisfies the mask,
                 // check if the editor control Text has value.
                 lResult = (mMaskedTextBoxIT.Text != string.Empty);
             }
             else
             {
                 // If the value assigned satisfies the mask
                 // (it is not mandatory that the mask has been completed),
                 // assign the value to the MaskTextProvider and then check if
                 // it has value.
                 maskTextProvider.Set(mMaskedTextBoxIT.Text);
                 string auxString = maskTextProvider.ToString(false, false);
                 lResult = !string.IsNullOrEmpty(auxString);
             }
         }
     }
     else
     {
         lResult = !mMaskedTextBoxIT.Text.Equals(string.Empty);
     }
     return lResult;
 }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:45,代码来源:MaskedTextBoxPresentation.cs


注:本文中的System.ComponentModel.MaskedTextProvider.VerifyString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。