CPropItem.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using OTSModelSharp.ResourceManage;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace OTSMeasureApp
  5. {
  6. public class CPropItem
  7. {
  8. private OTS_SAMPLE_PROP_GRID_ITEMS iSampleId; //样品属性ID
  9. private String sSCaptionName; //样品标题名
  10. private OTS_ITEM_TYPES iSampleValType; //样品标题名对应值的类型
  11. private Object sampleVal=""; //样品标题名对应值,全部是string
  12. public List<String> comboDownList = new List<string>();//如果iSampleValType是combobox则在此处存储下拉列表
  13. public bool bReadOnly; //值的类型
  14. private string sDescriptionInfo; //描述信息
  15. public OTS_SAMPLE_PROP_GRID_ITEMS SampleId { get => iSampleId; set => iSampleId = value; }
  16. public string CaptionName { get => sSCaptionName; set => sSCaptionName = value; }
  17. public OTS_ITEM_TYPES SampleValType { get => iSampleValType; set => iSampleValType = value; }
  18. public object GetSampleVal()
  19. {
  20. return sampleVal;
  21. }
  22. public void SetSampleVal(object value)
  23. {
  24. sampleVal = value;
  25. }
  26. public string Description { get => sDescriptionInfo; set => sDescriptionInfo = value; }
  27. 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)
  28. {
  29. var strRes = ResourceData.GetStringResourceByKey(GROUPS, a_nSmplId);
  30. if (a_nType == OTS_ITEM_TYPES.COMBO)
  31. {
  32. comboDownList = strRes.combolist;
  33. }
  34. sSCaptionName = strRes.text;
  35. sDescriptionInfo = strRes.Description;
  36. iSampleId = a_nSmplId;
  37. iSampleValType = a_nType;
  38. bReadOnly = a_bReadOnly;
  39. }
  40. }
  41. }