public override bool SetVector3(int nRow, int nCol, NFVector3 value) { if (nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { AddRow(nRow); } NFIDataList valueList = (NFIDataList)mhtRecordVec[nRow]; if (valueList.GetType(nCol) == NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3) { if (valueList.Vector3Val(nCol) != value) { NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3); oldValue.Set(valueList.Vector3Val(nCol)); newValue.Set(value); valueList.SetVector3(nCol, value); if (null != doHandleDel) { doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue); } } } return(true); } return(false); }
public override bool SetFloat(int nRow, int nCol, double value) { if (nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { AddRow(nRow); } NFIDataList valueList = (NFIDataList)mhtRecordVec[nRow]; if (valueList.GetType(nCol) == NFIDataList.VARIANT_TYPE.VTYPE_FLOAT) { if (valueList.FloatVal(nCol) - value > NFIDataList.EPS_DOUBLE || valueList.FloatVal(nCol) - value < -NFIDataList.EPS_DOUBLE) { NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_FLOAT); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_FLOAT); oldValue.Set(valueList.FloatVal(nCol)); newValue.Set(value); valueList.SetFloat(nCol, value); if (null != doHandleDel) { doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue); } } } return(true); } return(false); }
public override NFIProperty AddProperty(string strPropertyName, NFIDataList.TData varData) { NFIProperty xProperty = null; if (!mhtProperty.ContainsKey(strPropertyName)) { xProperty = new NFCProperty(mSelf, strPropertyName, varData); mhtProperty[strPropertyName] = xProperty; } return(xProperty); }
public override bool SetVector3(NFVector3 value) { if (mxData.Vector3Val() != value) { NFIDataList.TData oldValue = new NFIDataList.TData(mxData); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3); newValue.Set(value); mxData.Set(value); if (null != doHandleDel) { doHandleDel(mSelf, msPropertyName, oldValue, newValue); } } return(true); }
public override bool SetObject(NFGUID value) { if (mxData.ObjectVal() != value) { NFIDataList.TData oldValue = new NFIDataList.TData(mxData); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_OBJECT); newValue.Set(value); mxData.Set(value); if (null != doHandleDel) { doHandleDel(mSelf, msPropertyName, oldValue, newValue); } } return(true); }
public override bool SetString(string value) { if (mxData.StringVal() != value) { NFIDataList.TData oldValue = new NFIDataList.TData(mxData); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_STRING); newValue.Set(value); mxData.Set(value); if (null != doHandleDel) { doHandleDel(mSelf, msPropertyName, oldValue, newValue); } } return(true); }
public override bool SetFloat(double value) { if (mxData.FloatVal() - value > NFIDataList.EPS_DOUBLE || mxData.FloatVal() - value < -NFIDataList.EPS_DOUBLE) { NFIDataList.TData oldValue = new NFIDataList.TData(mxData); NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_FLOAT); newValue.Set(value); mxData.Set(value); if (null != doHandleDel) { doHandleDel(mSelf, msPropertyName, oldValue, newValue); } } return(true); }
public override bool SetData(NFIDataList.TData x) { if (NFIDataList.VARIANT_TYPE.VTYPE_UNKNOWN == mxData.GetType() || x.GetType() == mxData.GetType()) { switch (mxData.GetType()) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: SetInt(x.IntVal()); break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: SetString(x.StringVal()); break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: SetFloat(x.FloatVal()); break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: SetObject(x.ObjectVal()); break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2: SetVector2(x.Vector2Val()); break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3: SetVector3(x.Vector3Val()); break; default: break; } return(true); } return(false); }
public NFCProperty(NFGUID self, string strPropertyName, NFIDataList varData) { mSelf = self; msPropertyName = strPropertyName; mxData = new NFIDataList.TData(varData.GetType(0)); switch (varData.GetType(0)) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: mxData.Set(varData.IntVal(0)); break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: mxData.Set(varData.FloatVal(0)); break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: mxData.Set(varData.ObjectVal(0)); break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: mxData.Set(varData.StringVal(0)); break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2: mxData.Set(varData.Vector2Val(0)); break; case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3: mxData.Set(varData.Vector3Val(0)); break; default: break; } }
public abstract bool SetData(NFIDataList.TData x);
public NFCProperty(NFGUID self, string strPropertyName, NFIDataList.TData varData) { mSelf = self; msPropertyName = strPropertyName; mxData = new NFIDataList.TData(varData); }
public abstract NFIProperty AddProperty(string strPropertyName, NFIDataList.TData varData);