GridEditorRow.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. namespace TSZ.DotNetDll.WinForms
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.CompilerServices;
  6. public class GridEditorRow
  7. {
  8. private List<object> m_Values;
  9. public GridEditorRow()
  10. {
  11. }
  12. public GridEditorRow(string strLable, object[] values, bool isNumberValue) : this(strLable, values, ((values != null) && (values.Length > 0)) ? values[0] : null, isNumberValue)
  13. {
  14. }
  15. public GridEditorRow(string strLable, object[] values, object defaultValue, bool isNumberValue)
  16. {
  17. this.Lable = strLable;
  18. this.m_Values = new List<object>(values);
  19. this.DefaultValue = defaultValue;
  20. this.IsNumberValue = isNumberValue;
  21. }
  22. public GridEditorRow(string strLable, object[] values, object defaultValue, bool isNumberValue, object tag)
  23. {
  24. this.Lable = strLable;
  25. if ((values != null) && (values.Length > 0))
  26. {
  27. this.m_Values = new List<object>(values);
  28. }
  29. this.DefaultValue = defaultValue;
  30. this.IsNumberValue = isNumberValue;
  31. this.Tag = tag;
  32. }
  33. public object DefaultValue { get; set; }
  34. public bool IsNumberValue { get; set; }
  35. public string Lable { get; set; }
  36. public object Tag { get; set; }
  37. public List<object> Values
  38. {
  39. get
  40. {
  41. if (this.m_Values == null)
  42. {
  43. this.m_Values = new List<object>();
  44. }
  45. return this.m_Values;
  46. }
  47. }
  48. }
  49. }