示例#1
0
        private void PopulateArrayWithValue(ISFSArray arr)
        {
            switch (type)
            {
            case VariableType.NULL:
                arr.AddNull();
                break;

            case VariableType.BOOL:
                arr.AddBool(GetBoolValue());
                break;

            case VariableType.INT:
                arr.AddInt(GetIntValue());
                break;

            case VariableType.DOUBLE:
                arr.AddDouble(GetDoubleValue());
                break;

            case VariableType.STRING:
                arr.AddUtfString(GetStringValue());
                break;

            case VariableType.OBJECT:
                arr.AddSFSObject(GetSFSObjectValue());
                break;

            case VariableType.ARRAY:
                arr.AddSFSArray(GetSFSArrayValue());
                break;
            }
        }
示例#2
0
        public virtual ISFSArray ToSFSArray()
        {
            ISFSArray iSFSArray = SFSArray.NewInstance();

            iSFSArray.AddUtfString(name);
            iSFSArray.AddByte((byte)type);
            PopulateArrayWithValue(iSFSArray);
            return(iSFSArray);
        }