Пример #1
0
        public void SetInt(string keyName, int value)
        {
            DxBaseValue result;

            if (records.TryGetValue(keyName, out result))
            {
                switch (result.Type)
                {
                case ValueType.VT_Array:
                    ((DxArrayValue)result).Clear();
                    break;

                case ValueType.VT_Map:
                    ((DxRecordValue)result).Clear();
                    break;

                default:
                    result.AsInt = value;
                    return;
                }
                records[keyName] = new DxIntValue(value);
                return;
            }
            records.Add(keyName, new DxIntValue(value));
        }
Пример #2
0
        public void SetInt(int idx, int value)
        {
            idx = ifNilInitArr2idx(idx);
            DxBaseValue v = arrayList[idx];

            if (v != null && v.Type != ValueType.VT_Array && v.Type != ValueType.VT_Map)
            {
                arrayList[idx].AsInt = value;
                return;
            }
            arrayList[idx] = new DxIntValue(value);
        }