/// <summary> /// 构造2 /// </summary> /// <param name="paramstring"></param> public QCParams(string paramstring) { if (!string.IsNullOrEmpty(paramstring)) { string[] paramcollection = paramstring.Split(new string[] { ConstRes.cstAndOper }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < paramcollection.Length; i++) { QCParam qcp = String2QCParam(paramcollection[i]); if (!string.IsNullOrEmpty(qcp.Prop)) { _settings.Add(qcp.Prop, qcp); } } } }
void PropertyInfoTree_CellValueChanged(object sender, CellValueChangedEventArgs e) { if (e.Column.FieldName == "值" || e.Column.FieldName == "算符") { string currproperty = e.Node["id"].ToString(); string pv = ((e.Node["值"] == null) || (string.IsNullOrEmpty(e.Node["值"].ToString()))) ? string.Empty : e.Node["值"].ToString(); CompareOp op = (e.Node["算符"] == null) ? CompareOp.None : (CompareOp)e.Node["算符"]; QCParam qcp = new QCParam(currproperty, op, pv); if (_qcParams.Settings.ContainsKey(currproperty)) { // if (!string.IsNullOrEmpty(pv)) _qcParams.Settings[currproperty] = qcp; //else // _qcParams.Settings.Remove(currproperty); } else if (!string.IsNullOrEmpty(pv)) { _qcParams.Settings.Add(currproperty, qcp); } } }
/// <summary> /// 时限设置参数至字符串 /// </summary> /// <param name="qcparam"></param> /// <returns></returns> public static string QCParam2String(QCParam qcparam) { return(qcparam.Prop + CompareOp2String(qcparam.Op) + qcparam.PropValue); }