CPropItem.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. private string sTag;
  16. public OTS_SAMPLE_PROP_GRID_ITEMS SampleId { get => iSampleId; set => iSampleId = value; }
  17. public string CaptionName { get => sSCaptionName; set => sSCaptionName = value; }
  18. public OTS_ITEM_TYPES SampleValType { get => iSampleValType; set => iSampleValType = value; }
  19. public object GetSampleVal()
  20. {
  21. return sampleVal;
  22. }
  23. public void SetSampleVal(object value)
  24. {
  25. sampleVal = value;
  26. }
  27. public string Description { get => sDescriptionInfo; set => sDescriptionInfo = value; }
  28. public string Tag { get => sTag; set => sTag = value; }
  29. 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)
  30. {
  31. var strRes = ResourceData.GetStringResourceByKey(GROUPS, a_nSmplId);
  32. if (a_nType == OTS_ITEM_TYPES.COMBO)
  33. {
  34. comboDownList = strRes.combolist;
  35. }
  36. if (a_nType == OTS_ITEM_TYPES.BUTTON)
  37. {
  38. sTag = a_nSmplId.ToString();
  39. }
  40. sSCaptionName = strRes.text;
  41. sDescriptionInfo = strRes.Description;
  42. iSampleId = a_nSmplId;
  43. iSampleValType = a_nType;
  44. bReadOnly = a_bReadOnly;
  45. }
  46. }
  47. }