當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。