Esempio n. 1
0
 private void DisposeValueAt(int index)
 {
     if (_list.Values[index] != null)
     {
         DataValue.DisposeNative(Manager, _list.DataTypes[index], _list.Values[index]);
     }
 }
Esempio n. 2
0
        /// <summary>This is a by-reference access of the value, changes made to the resulting DataValue will be refelected in the actual row.</summary>
        public object this[int index]
        {
            get
            {
                                #if USEDATATYPESINNATIVEROW
                if (_row.DataTypes[index] is Schema.IScalarType)
                                #else
                if (DataType.Columns[AIndex].DataType is Schema.IScalarType)
                                #endif
                { return(_row.Values[index]); }
                return(FromNativeRow(Manager, DataType, _row, index));
            }
            set
            {
                if (_row.Values[index] != null)
                                        #if USEDATATYPESINNATIVEROW
                { DataValue.DisposeNative(Manager, _row.DataTypes[index], _row.Values[index]); }
                                        #else
                { DataValue.DisposeNative(Manager, DataType.Columns[AIndex].DataType, FRow.Values[AIndex]); }
                                        #endif

                IDataValue tempValue = value as IDataValue;
                if (tempValue != null)
                {
                                        #if USEDATATYPESINNATIVEROW
                    _row.DataTypes[index] = tempValue.DataType;
                                        #endif
                    _row.Values[index] = tempValue.CopyNative();
                }
                else if (value != null)
                {
                                        #if USEDATATYPESINNATIVEROW
                    if ((DataType.Columns[index].DataType.Equals(Manager.DataTypes.SystemGeneric)) || (DataType.Columns[index].DataType.Equals(Manager.DataTypes.SystemScalar)))
                    {
                        _row.DataTypes[index] = Manager.GetRuntimeType(value.GetType());
                    }
                    else
                    {
                        _row.DataTypes[index] = DataType.Columns[index].DataType;
                    }
                    _row.Values[index] = DataValue.CopyNative(Manager, _row.DataTypes[index], value);
                                        #else
                    FRow.Values[AIndex] = DataValue.CopyNative(Manager, DataType.Columns[AIndex].DataType, value);
                                        #endif
                }
                else
                {
                                        #if USEDATATYPESINNATIVEROW
                    _row.DataTypes[index] = DataType.Columns[index].DataType;
                                        #endif
                    _row.Values[index] = null;
                }

                if (_row.ModifiedFlags != null)
                {
                    _row.ModifiedFlags[index] = true;
                }
            }
        }
Esempio n. 3
0
        public void ClearValue(int index)
        {
            if (_row.Values[index] != null)
            {
                if (ValuesOwned)
                                        #if USEDATATYPESINNATIVEROW
                { DataValue.DisposeNative(Manager, _row.DataTypes[index], _row.Values[index]); }
                                        #else
                { DataValue.DisposeNative(Manager, DataType.Columns[AIndex].DataType, FRow.Values[AIndex]); }
                                        #endif

                                #if USEDATATYPESINNATIVEROW
                _row.DataTypes[index] = DataType.Columns[index].DataType;
                                #endif
                _row.Values[index] = null;
            }
        }
Esempio n. 4
0
 public void DisposeValue(IValueManager manager, object value)
 {
     DataValue.DisposeNative(manager, _listType.ElementType, value);
 }
Esempio n. 5
0
 public void DisposeData(IValueManager manager, NativeRow data)
 {
     DataValue.DisposeNative(manager, DataRowType, data);
 }
Esempio n. 6
0
 public void DisposeKey(IValueManager manager, NativeRow key)
 {
     DataValue.DisposeNative(manager, KeyRowType, key);
 }