Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        public override bool SetInt(int nRow, int nCol, Int64 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_INT)
                {
                    if (valueList.IntVal(nCol) != value)
                    {
                        NFCDataList oldValue = new NFCDataList();
                        oldValue.AddInt(valueList.IntVal(nCol));

                        valueList.SetInt(nCol, value);

                        NFCDataList newValue = new NFCDataList();
                        newValue.AddInt(valueList.IntVal(nCol));

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue);
                        }
                    }
                }
                return(true);
            }
            return(false);
        }
Exemplo 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);
        }
Exemplo n.º 4
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_DOUBLE:
                 AddDouble(src.DoubleVal(i));
             break;
             case VARIANT_TYPE.VTYPE_STRING:
                 AddString(src.StringVal(i));
             break;
             case VARIANT_TYPE.VTYPE_OBJECT:
                 AddObject(src.ObjectVal(i));
             break;
                 default:
             break;
         }
     }
 }
Exemplo n.º 5
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_DOUBLE:
                    AddDouble(src.DoubleVal(i));
                    break;

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

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

                default:
                    break;
                }
            }
        }
Exemplo n.º 6
0
 static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal(0));
     Debug.Log(" ");
     Debug.Log(newVar.IntVal(0));
     Debug.Log(" ");
 }
Exemplo n.º 7
0
 static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.IntVal(0));
     Console.Write(" ");
     Console.Write(newVar.IntVal(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 8
0
        public override Int64 QueryInt(int nRow, int nCol)
        {
            NFIDataList valueList = QueryRow(nRow);

            if (null != valueList)
            {
                return(valueList.IntVal(nCol));
            }

            return(0);
        }
Exemplo n.º 9
0
 public override int FindInt(int nCol, Int64 value)
 {
     foreach (int i in mhtRecordVec.Keys)
     {
         NFIDataList valueList = (NFIDataList)mhtRecordVec[i];
         if (valueList.IntVal(nCol) == value)
         {
             return(i);
         }
     }
     return(-1);
 }
Exemplo n.º 10
0
 static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList 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(0));
     Debug.Log(" ");
     Debug.Log(newVar.IntVal(0));
     Debug.Log(" ");
 }
Exemplo n.º 11
0
 static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList 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(0));
     Console.Write(" ");
     Console.Write(newVar.IntVal(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 12
0
        public override NFIObject CreateObject(NFIDENTID 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);

                if (mhtClassHandleDel.ContainsKey(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);
        }
Exemplo n.º 13
0
 static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal(0));
     Debug.Log(" ");
     Debug.Log(newVar.IntVal(0));
     Debug.Log(" ");
 }
Exemplo n.º 14
0
 static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList 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(0));
     Console.Write(" ");
     Console.Write(newVar.IntVal(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 15
0
 static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.IntVal(0));
     Console.Write(" ");
     Console.Write(newVar.IntVal(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 16
0
 static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList 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(0));
     Debug.Log(" ");
     Debug.Log(newVar.IntVal(0));
     Debug.Log(" ");
 }
Exemplo n.º 17
0
        public override NFIObject CreateObject(NFIDENTID 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);
                }
                return xNewObject;
            }

            return null;
        }