1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using OTSDataType;
- 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 itemVal=""; //样品标题名对应值,全部是string
- public List<String> comboDownList = new List<string>();//如果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 ItemValType { get => iSampleValType; set => iSampleValType = value; }
- public object GetItemVal()
- {
- return itemVal;
- }
- public void SetItemVal(object value)
- {
- itemVal = 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)
- {
- if (GROUPS == OTS_SAMPLE_PROP_GRID_ITEM_GROUPS.IMAGESCAN && a_nSmplId == OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION)
- {
- List<string> resolution = new List<string>();
- foreach (var str in otsdataconst.RESOLUTION_STRINGS)
- {
- resolution.Add(str);
- }
- comboDownList = resolution;
- }
- else
- {
- 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;
- }
- }
- }
|