ControlAttribute.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. namespace Core.StlMes.Client.Qcm
  3. {
  4. public enum ControlAttributeType
  5. {
  6. QueryControl = 1, //如果不填,则二进制只有一位。就无法正常使用枚举的异或、与运算了。
  7. NoQueryControl = 2
  8. }
  9. /// <summary>
  10. /// 用来标识实体类的属性,以被转换器使用。
  11. /// </summary>
  12. [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
  13. class ControlAttribute : Attribute
  14. {
  15. private string _controlName = "";
  16. private bool _isGetValue = false;
  17. private ControlAttributeType _controlAttributeType;
  18. public string ControlName
  19. {
  20. get { return _controlName; }
  21. set { _controlName = value; }
  22. }
  23. public bool IsGetValue
  24. {
  25. get { return _isGetValue; }
  26. set { _isGetValue = value; }
  27. }
  28. public ControlAttributeType ControlAttributeType
  29. {
  30. get { return _controlAttributeType; }
  31. set { _controlAttributeType = value; }
  32. }
  33. /// <summary>
  34. ///
  35. /// </summary>
  36. /// <param name="controlName">控件名称</param>
  37. /// <param name="isGetValue">是获取Value值,还是获取Text值</param>
  38. /// <param name="controlAttributeType"></param>
  39. public ControlAttribute(string controlName, bool isGetValue, ControlAttributeType controlAttributeType)
  40. {
  41. _controlName = controlName;
  42. _isGetValue = isGetValue;
  43. _controlAttributeType = controlAttributeType;
  44. }
  45. }
  46. }