VerificationAttribute.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // ***********************************************************************
  2. // Assembly : HZH_Controls
  3. // Created : 2019-09-27
  4. //
  5. // ***********************************************************************
  6. // <copyright file="VerificationAttribute.cs">
  7. // Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
  8. // </copyright>
  9. //
  10. // Blog: https://www.cnblogs.com/bfyx
  11. // GitHub:https://github.com/kwwwvagaa/NetWinformControl
  12. // gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
  13. //
  14. // If you use this code, please keep this note.
  15. // ***********************************************************************
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Linq;
  19. using System.Text;
  20. namespace HZH_Controls.Controls
  21. {
  22. /// <summary>
  23. /// Class VerificationAttribute.
  24. /// Implements the <see cref="System.Attribute" />
  25. /// </summary>
  26. /// <seealso cref="System.Attribute" />
  27. public class VerificationAttribute : Attribute
  28. {
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="VerificationAttribute"/> class.
  31. /// </summary>
  32. /// <param name="strRegex">The string regex.</param>
  33. /// <param name="strErrorMsg">The string error MSG.</param>
  34. public VerificationAttribute(string strRegex = "", string strErrorMsg = "")
  35. {
  36. Regex = strRegex;
  37. ErrorMsg = strErrorMsg;
  38. }
  39. /// <summary>
  40. /// Gets or sets the regex.
  41. /// </summary>
  42. /// <value>The regex.</value>
  43. public string Regex { get; set; }
  44. /// <summary>
  45. /// Gets or sets the error MSG.
  46. /// </summary>
  47. /// <value>The error MSG.</value>
  48. public string ErrorMsg { get; set; }
  49. }
  50. }