CPropItem.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using OTSDataType;
  2. using OTSModelSharp.ResourceManage;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace OTSMeasureApp
  6. {
  7. public class CPropItem
  8. {
  9. private OTS_SAMPLE_PROP_GRID_ITEMS iSampleId; //样品属性ID
  10. private String sSCaptionName; //样品标题名
  11. private OTS_ITEM_TYPES iSampleValType; //样品标题名对应值的类型
  12. private Object itemVal=""; //样品标题名对应值,全部是string
  13. public List<String> comboDownList = new List<string>();//如果iSampleValType是combobox则在此处存储下拉列表
  14. public bool bReadOnly; //值的类型
  15. private string sDescriptionInfo; //描述信息
  16. private string sTag;
  17. public OTS_SAMPLE_PROP_GRID_ITEMS SampleId { get => iSampleId; set => iSampleId = value; }
  18. public string CaptionName { get => sSCaptionName; set => sSCaptionName = value; }
  19. public OTS_ITEM_TYPES ItemValType { get => iSampleValType; set => iSampleValType = value; }
  20. public object GetItemVal()
  21. {
  22. return itemVal;
  23. }
  24. public void SetItemVal(object value)
  25. {
  26. itemVal = value;
  27. }
  28. public string Description { get => sDescriptionInfo; set => sDescriptionInfo = value; }
  29. public string Tag { get => sTag; set => sTag = value; }
  30. public void InitialSmplParameter(OTS_SAMPLE_PROP_GRID_ITEM_GROUPS GROUPS, OTS_SAMPLE_PROP_GRID_ITEMS a_nSmplId, OTS_ITEM_TYPES a_nType, bool a_bReadOnly, bool a_bShow)
  31. {
  32. var strRes = ResourceData.GetStringResourceByKey(GROUPS, a_nSmplId);
  33. if (a_nType == OTS_ITEM_TYPES.COMBO)
  34. {
  35. if (GROUPS == OTS_SAMPLE_PROP_GRID_ITEM_GROUPS.IMAGESCAN && a_nSmplId == OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION)
  36. {
  37. List<string> resolution = new List<string>();
  38. foreach (var str in otsdataconst.RESOLUTION_STRINGS)
  39. {
  40. resolution.Add(str);
  41. }
  42. comboDownList = resolution;
  43. }
  44. else
  45. {
  46. comboDownList = strRes.combolist;
  47. }
  48. }
  49. if (a_nType == OTS_ITEM_TYPES.BUTTON)
  50. {
  51. sTag = a_nSmplId.ToString();
  52. }
  53. sSCaptionName = strRes.text;
  54. sDescriptionInfo = strRes.Description;
  55. iSampleId = a_nSmplId;
  56. iSampleValType = a_nType;
  57. bReadOnly = a_bReadOnly;
  58. }
  59. }
  60. }