using OTSModelSharp.ResourceManage; using System; using System.Collections.Generic; namespace OTSMeasureApp { public class CPropItem { private OTS_SAMPLE_PROP_GRID_ITEMS iSampleId; //样品属性ID private String sSCaptionName; //样品标题名 private OTS_ITEM_TYPES iSampleValType; //样品标题名对应值的类型 private Object sampleVal=""; //样品标题名对应值,全部是string public List comboDownList = new List();//如果iSampleValType是combobox则在此处存储下拉列表 public bool bReadOnly; //值的类型 private string sDescriptionInfo; //描述信息 private string sTag; public OTS_SAMPLE_PROP_GRID_ITEMS SampleId { get => iSampleId; set => iSampleId = value; } public string CaptionName { get => sSCaptionName; set => sSCaptionName = value; } public OTS_ITEM_TYPES SampleValType { get => iSampleValType; set => iSampleValType = value; } public object GetSampleVal() { return sampleVal; } public void SetSampleVal(object value) { sampleVal = value; } public string Description { get => sDescriptionInfo; set => sDescriptionInfo = value; } public string Tag { get => sTag; set => sTag = value; } 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) { var strRes = ResourceData.GetStringResourceByKey(GROUPS, a_nSmplId); if (a_nType == OTS_ITEM_TYPES.COMBO) { comboDownList = strRes.combolist; } if (a_nType == OTS_ITEM_TYPES.BUTTON) { sTag = a_nSmplId.ToString(); } sSCaptionName = strRes.text; sDescriptionInfo = strRes.Description; iSampleId = a_nSmplId; iSampleValType = a_nType; bReadOnly = a_bReadOnly; } } }