GetType() public abstract method

public abstract GetType ( int index ) : VARIANT_TYPE
index int
return VARIANT_TYPE
Ejemplo n.º 1
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;
            }
        }
Ejemplo n.º 2
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;
            }
        }
Ejemplo n.º 3
0
        //public override int FindRow( int nRow );
        public override int FindColValue(int nCol, NFIDataList var)
        {
            for (int i = 0; i < mhtRecordVec.Count; i++)
            {
                NFIDataList valueList = (NFIDataList)mhtRecordVec[i];
                switch (valueList.GetType(0))
                {
                case NFIDataList.VARIANT_TYPE.VTYPE_INT:
                    return(FindInt(nCol, var.IntVal(0)));

                case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                    return(FindInt(nCol, var.IntVal(0)));

                case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE:
                    return(FindInt(nCol, var.IntVal(0)));

                case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                    return(FindInt(nCol, var.IntVal(0)));

                case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                    return(FindObject(nCol, var.ObjectVal(0)));

                default:
                    break;
                }
            }


            return(-1);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        public NFCDataList(NFIDataList src)
        {
            for (int i = 0; i < src.Count(); i++)
            {
                switch (src.GetType(i))
                {
                case VARIANT_TYPE.VTYPE_INT:
                    AddInt(src.IntVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_FLOAT:
                    AddFloat(src.FloatVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_STRING:
                    AddString(src.StringVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_OBJECT:
                    AddObject(src.ObjectVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_VECTOR2:
                    AddVector2(src.Vector2Val(i));
                    break;

                case VARIANT_TYPE.VTYPE_VECTOR3:
                    AddVector3(src.Vector3Val(i));
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 7
0
        public NFCDataList(NFIDataList src)
        {
			for (int i = 0; i < src.Count(); i++ )
			{
				switch (src.GetType(i))
				{
					case VARIANT_TYPE.VTYPE_INT:
						AddInt(src.IntVal(i));
					break;
					case VARIANT_TYPE.VTYPE_FLOAT:
						AddFloat(src.FloatVal(i));
					break;
					case VARIANT_TYPE.VTYPE_STRING:
						AddString(src.StringVal(i));
					break;
					case VARIANT_TYPE.VTYPE_OBJECT:
						AddObject(src.ObjectVal(i));
					break;
                    case VARIANT_TYPE.VTYPE_VECTOR2:
                        AddVector2(src.Vector2Val(i));
                        break;
                    case VARIANT_TYPE.VTYPE_VECTOR3:
                        AddVector3(src.Vector3Val(i));
                        break;
                    default:
					break;
				}
			}

        }
Ejemplo n.º 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;
            }

        }
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
0
        public override NFIObject CreateObject(NFGUID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg)
        {
            if (!mhtObject.ContainsKey(self))
            {
                NFIObject xNewObject = new NFCObject(self, nContainerID, nGroupID, strClassName, strConfigIndex);
                mhtObject.Add(self, xNewObject);

                NFCDataList varConfigID = new NFCDataList();
                varConfigID.AddString(strConfigIndex);
                xNewObject.GetPropertyManager().AddProperty("ConfigID", varConfigID);

                NFCDataList varConfigClass = new NFCDataList();
                varConfigClass.AddString(strClassName);
                xNewObject.GetPropertyManager().AddProperty("ClassName", varConfigClass);

                if (arg.Count() % 2 == 0)
                {
                    for (int i = 0; i < arg.Count() - 1; i += 2)
                    {
                        string strPropertyName         = arg.StringVal(i);
                        NFIDataList.VARIANT_TYPE eType = arg.GetType(i + 1);
                        switch (eType)
                        {
                        case NFIDataList.VARIANT_TYPE.VTYPE_INT:
                        {
                            NFIDataList xDataList = new NFCDataList();
                            xDataList.AddInt(arg.IntVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

                        case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                        {
                            NFIDataList xDataList = new NFCDataList();
                            xDataList.AddFloat(arg.FloatVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

                        case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE:
                        {
                            NFIDataList xDataList = new NFCDataList();
                            xDataList.AddDouble(arg.DoubleVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

                        case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                        {
                            NFIDataList xDataList = new NFCDataList();
                            xDataList.AddString(arg.StringVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

                        case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                        {
                            NFIDataList xDataList = new NFCDataList();
                            xDataList.AddObject(arg.ObjectVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

                        default:
                            break;
                        }
                    }
                }

                InitProperty(self, strClassName);
                InitRecord(self, strClassName);

                ClassHandleDel xHandleDel = (ClassHandleDel)mhtClassHandleDel[strClassName];
                if (null != xHandleDel && null != xHandleDel.GetHandler())
                {
                    NFIObject.ClassEventHandler xHandlerList = xHandleDel.GetHandler();
                    xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE, strClassName, strConfigIndex);
                    xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_LOADDATA, strClassName, strConfigIndex);
                    xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH, strClassName, strConfigIndex);
                }

                //NFCLog.Instance.Log(NFCLog.LOG_LEVEL.DEBUG, "Create object: " + self.ToString() + " ClassName: " + strClassName + " SceneID: " + nContainerID + " GroupID: " + nGroupID);
                return(xNewObject);
            }

            return(null);
        }
Ejemplo n.º 11
0
		public override NFIObject CreateObject(NFGUID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg)
		{
			if (!mhtObject.ContainsKey(self))
			{
				NFIObject xNewObject = new NFCObject(self, nContainerID, nGroupID, strClassName, strConfigIndex);
				mhtObject.Add(self, xNewObject);

                NFCDataList varConfigID = new NFCDataList();
                varConfigID.AddString(strConfigIndex);
                xNewObject.GetPropertyManager().AddProperty("ConfigID", varConfigID);

                NFCDataList varConfigClass = new NFCDataList();
                varConfigClass.AddString(strClassName);
                xNewObject.GetPropertyManager().AddProperty("ClassName", varConfigClass);

                if (arg.Count() % 2 == 0)
                {
                    for (int i = 0; i < arg.Count() - 1; i += 2)
                    {
                        string strPropertyName = arg.StringVal(i);
                        NFIDataList.VARIANT_TYPE eType = arg.GetType(i + 1);
                        switch (eType)
                        {
                            case NFIDataList.VARIANT_TYPE.VTYPE_INT:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddInt(arg.IntVal(i+1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddFloat(arg.FloatVal(i + 1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddString(arg.StringVal(i + 1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddObject(arg.ObjectVal(i + 1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddVector2(arg.Vector2Val(i + 1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            case NFIDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                                {
                                    NFIDataList xDataList = new NFCDataList();
                                    xDataList.AddVector3(arg.Vector3Val(i + 1));
                                    xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                                }
                                break;
                            default:
                                break;
                        }
                    }
                }

                InitProperty(self, strClassName);
                InitRecord(self, strClassName);

				ClassHandleDel xHandleDel = (ClassHandleDel)mhtClassHandleDel[strClassName];
                if (null != xHandleDel && null != xHandleDel.GetHandler())
                {
					NFIObject.ClassEventHandler xHandlerList = xHandleDel.GetHandler();
                    xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE, strClassName, strConfigIndex);
					xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_LOADDATA, strClassName, strConfigIndex);
					xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH, strClassName, strConfigIndex);
				}

                //NFCLog.Instance.Log(NFCLog.LOG_LEVEL.DEBUG, "Create object: " + self.ToString() + " ClassName: " + strClassName + " SceneID: " + nContainerID + " GroupID: " + nGroupID);
				return xNewObject;
			}

			return null;
		}
Ejemplo n.º 12
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;
        }
Ejemplo n.º 13
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;
            }
        }