Exemplo n.º 1
0
        public override bool SetInt(int nRow, int nCol, Int64 value)
        {
            if (nRow >= 0 && nRow < mnRow)
            {
                if (!mhtRecordVec.ContainsKey(nRow))
                {
                    AddRow(nRow);
                }
                AFIDataList valueList = (AFIDataList)mhtRecordVec[nRow];
                if (valueList.GetType(nCol) == AFIDataList.VARIANT_TYPE.VTYPE_INT)
                {
                    if (valueList.Int64Val(nCol) != value)
                    {
                        AFCDataList oldValue = new AFCDataList();
                        oldValue.AddInt64(valueList.Int64Val(nCol));

                        valueList.SetInt64(nCol, value);

                        AFCDataList newValue = new AFCDataList();
                        newValue.AddInt64(valueList.Int64Val(nCol));

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue);
                        }
                    }
                }
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        //public override int FindRow( int nRow );
        public override int FindColValue(int nCol, AFIDataList var)
        {
            for (int i = 0; i < mhtRecordVec.Count; i++)
            {
                AFIDataList valueList = (AFIDataList)mhtRecordVec[i];
                switch (valueList.GetType(0))
                {
                case AFIDataList.VARIANT_TYPE.VTYPE_INT:
                    return(FindInt(nCol, var.Int64Val(0)));

                case AFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                    return(FindInt(nCol, var.Int64Val(0)));

                case AFIDataList.VARIANT_TYPE.VTYPE_DOUBLE:
                    return(FindInt(nCol, var.Int64Val(0)));

                case AFIDataList.VARIANT_TYPE.VTYPE_STRING:
                    return(FindInt(nCol, var.Int64Val(0)));

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

                default:
                    break;
                }
            }


            return(-1);
        }
Exemplo n.º 3
0
        public AFCDataList(AFIDataList src)
        {
            for (int i = 0; i < src.Count(); i++)
            {
                switch (src.GetType(i))
                {
                case VARIANT_TYPE.VTYPE_INT:
                    AddInt64(src.Int64Val(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.º 4
0
 static void OnPropertydHandler(AFIDENTID self, string strProperty, AFIDataList oldVar, AFIDataList newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.Int64Val(0));
     Debug.Log(" ");
     Debug.Log(newVar.Int64Val(0));
     Debug.Log(" ");
 }
Exemplo n.º 5
0
 static void OnPropertydHandler(AFIDENTID self, string strProperty, AFIDataList oldVar, AFIDataList newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.Int64Val(0));
     Console.Write(" ");
     Console.Write(newVar.Int64Val(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 6
0
        public override Int64 QueryInt(int nRow, int nCol)
        {
            AFIDataList valueList = QueryRow(nRow);

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

            return(0);
        }
Exemplo n.º 7
0
 public override int FindInt(int nCol, Int64 value)
 {
     foreach (int i in mhtRecordVec.Keys)
     {
         AFIDataList valueList = (AFIDataList)mhtRecordVec[i];
         if (valueList.Int64Val(nCol) == value)
         {
             return(i);
         }
     }
     return(-1);
 }
Exemplo n.º 8
0
 static void OnRecordEventHandler(AFIDENTID self, string strRecordName, AFIRecord.eRecordOptype eType, int nRow, int nCol, AFIDataList oldVar, AFIDataList 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.Int64Val(0));
     Debug.Log(" ");
     Debug.Log(newVar.Int64Val(0));
     Debug.Log(" ");
 }
Exemplo n.º 9
0
 static void OnRecordEventHandler(AFIDENTID self, string strRecordName, AFIRecord.eRecordOptype eType, int nRow, int nCol, AFIDataList oldVar, AFIDataList 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.Int64Val(0));
     Console.Write(" ");
     Console.Write(newVar.Int64Val(0));
     Console.WriteLine(" ");
 }
Exemplo n.º 10
0
        public override AFIObject CreateObject(AFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, AFIDataList arg)
        {
            if (!mhtObject.ContainsKey(self))
            {
                AFIObject xNewObject = new AFCObject(self, nContainerID, nGroupID, strClassName, strConfigIndex);
                mhtObject.Add(self, xNewObject);

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

                AFCDataList varConfigClass = new AFCDataList();
                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);
                        AFIDataList.VARIANT_TYPE eType = arg.GetType(i + 1);
                        switch (eType)
                        {
                        case AFIDataList.VARIANT_TYPE.VTYPE_INT:
                        {
                            AFIDataList xDataList = new AFCDataList();
                            xDataList.AddInt64(arg.Int64Val(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList);
                        }
                        break;

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

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

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

                        case AFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                        {
                            AFIDataList xDataList = new AFCDataList();
                            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())
                    {
                        AFIObject.ClassEventHandler xHandlerList = xHandleDel.GetHandler();
                        xHandlerList(self, nContainerID, nGroupID, AFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE, strClassName, strConfigIndex);
                        xHandlerList(self, nContainerID, nGroupID, AFIObject.CLASS_EVENT_TYPE.OBJECT_LOADDATA, strClassName, strConfigIndex);
                        xHandlerList(self, nContainerID, nGroupID, AFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH, strClassName, strConfigIndex);
                    }
                }

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

            return(null);
        }