예제 #1
0
        public override bool SetDouble(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_DOUBLE)
                {
                    if (valueList.DoubleVal(nCol) - value > NFIDataList.EPS_DOUBLE ||
                        valueList.DoubleVal(nCol) - value < -NFIDataList.EPS_DOUBLE)
                    {
                        NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE);
                        NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE);

                        oldValue.Set(valueList.DoubleVal(nCol));
                        newValue.Set(value);

                        valueList.SetDouble(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return(true);
            }
            return(false);
        }
예제 #2
0
        public override bool SetObject(int nRow, int nCol, NFGUID 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_OBJECT)
                {
                    if (valueList.ObjectVal(nCol) != value)
                    {
                        NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_OBJECT);
                        NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_OBJECT);

                        oldValue.Set(valueList.ObjectVal(nCol));
                        newValue.Set(value);

                        valueList.SetObject(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return(true);
            }

            return(false);
        }
예제 #3
0
파일: NFCProperty.cs 프로젝트: ketoo/NFrame
        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_DOUBLE:
                    mxData.Set(varData.DoubleVal(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;
                default:
                    break;
            }
        }
예제 #4
0
        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_DOUBLE:
                mxData.Set(varData.DoubleVal(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;

            default:
                break;
            }
        }
예제 #5
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFIDataList.TData oldVar, NFIDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }
예제 #6
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFIDataList.TData oldVar, NFIDataList.TData newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal());
     Debug.Log(" ");
     Debug.Log(newVar.IntVal());
     Debug.Log(" ");
 }
        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);
        }
예제 #8
0
        public void OnPropertyHandler(NFGUID self, string strPropertyName, NFIDataList.TData oldVar, NFIDataList.TData newVar)
        {
            NFIObject   xObject   = NFCKernelModule.Instance.GetObject(self);
            NFIProperty xProperty = xObject.GetPropertyManager().GetProperty(strPropertyName);

            if (!xProperty.GetUpload())
            {
                return;
            }

            switch (oldVar.GetType())
            {
            case NFIDataList.VARIANT_TYPE.VTYPE_INT:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyInt(self, strPropertyName, newVar);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyFloat(self, strPropertyName, newVar);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyString(self, strPropertyName, newVar);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyObject(self, strPropertyName, newVar);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyVector2(self, strPropertyName, newVar);
            }
            break;

            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3:
            {
                NFStart.Instance.GetFocusSender().RequirePropertyVector3(self, strPropertyName, newVar);
            }
            break;
            }
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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((float)x.DoubleVal());
                    break;

                case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE:
                    SetDouble(x.DoubleVal());
                    break;

                case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                    SetObject(x.ObjectVal());
                    break;

                default:
                    break;
                }

                return(true);
            }

            return(false);
        }
예제 #15
0
 static void OnRecordEventHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList.TData oldVar, NFIDataList.TData newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strRecordName);
     Debug.Log(" ");
     Debug.Log(eType.ToString());
     Debug.Log(" ");
     Debug.Log(nRow);
     Debug.Log(" ");
     Debug.Log(nCol);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal());
     Debug.Log(" ");
     Debug.Log(newVar.IntVal());
     Debug.Log(" ");
 }
예제 #16
0
파일: NFCProperty.cs 프로젝트: ketoo/NFrame
        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;
        }
예제 #17
0
파일: NFCProperty.cs 프로젝트: ketoo/NFrame
        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;
        }
예제 #18
0
파일: NFCProperty.cs 프로젝트: ketoo/NFrame
        public override bool SetFloat(float value)
        {
            if (mxData.DoubleVal() - value > NFIDataList.EPS_DOUBLE
                || mxData.DoubleVal() - 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;
        }
예제 #19
0
 public abstract NFIProperty AddProperty(string strPropertyName, NFIDataList.TData varData);
예제 #20
0
 static void OnRecordEventHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList.TData oldVar, NFIDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strRecordName);
     Console.Write(" ");
     Console.Write(eType.ToString());
     Console.Write(" ");
     Console.Write(nRow);
     Console.Write(" ");
     Console.Write(nCol);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }
예제 #21
0
        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;
        }
예제 #22
0
        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;
        }
예제 #23
0
 public NFCProperty(NFGUID self, string strPropertyName, NFIDataList.TData varData)
 {
     mSelf          = self;
     msPropertyName = strPropertyName;
     mxData         = new NFIDataList.TData(varData);
 }
예제 #24
0
파일: NFCProperty.cs 프로젝트: ketoo/NFrame
 public NFCProperty(NFGUID self, string strPropertyName, NFIDataList.TData varData)
 {
     mSelf = self;
     msPropertyName = strPropertyName;
     mxData = new NFIDataList.TData(varData);
 }
예제 #25
0
        public void OnRecordHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList.TData oldVar, NFIDataList.TData newVar)
        {
            NFIObject xObject = NFCKernelModule.Instance.GetObject(self);
            NFIRecord xRecord = xObject.GetRecordManager().GetRecord(strRecordName);

            if (!xRecord.GetUpload())
            {
                return;
            }

            switch (eType)
            {
            case NFIRecord.eRecordOptype.Add:
            {
                NFStart.Instance.GetFocusSender().RequireAddRow(self, strRecordName, nRow);
            }
            break;

            case NFIRecord.eRecordOptype.Del:
            {
                NFStart.Instance.GetFocusSender().RequireRemoveRow(self, strRecordName, nRow);
            }
            break;

            case NFIRecord.eRecordOptype.Swap:
            {
                NFStart.Instance.GetFocusSender().RequireSwapRow(self, strRecordName, nRow, nCol);
            }
            break;

            case NFIRecord.eRecordOptype.Update:
            {
                switch (oldVar.GetType())
                {
                case NFIDataList.VARIANT_TYPE.VTYPE_INT:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordInt(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordFloat(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordString(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordObject(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordVector2(self, strRecordName, nRow, nCol, newVar);
                }
                break;

                case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                {
                    NFStart.Instance.GetFocusSender().RequireRecordVector3(self, strRecordName, nRow, nCol, newVar);
                }
                break;
                }
            }
            break;
            }
        }
예제 #26
0
 public abstract bool SetData(NFIDataList.TData x);
예제 #27
0
        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;
        }