Exemple #1
0
        /// <summary>
        /// Adds the specified DataRowMx to the DataRowMxCollection
        /// </summary>
        /// <param name="row"></param>

        public void Add(DataRowMx row)
        {
            _rows.Add(row);
            int rowIndex = _rows.Count - 1;

            row._inRowList = true;             // set the flag that the row is now in the list
            row.RowState   = DataRowState.Added;

            _dataTable.CallDataChangedEventHandlers(ListChangedType.ItemAdded, row, rowIndex);
            return;
        }
Exemple #2
0
        /// <summary>
        /// Set the value of the associated ItemArray entry
        /// </summary>
        /// <param name="component"></param>
        /// <param name="value"></param>

        public override void SetValue(object component, object value)
        {
            DataRowMx row = (DataRowMx)component;

            row[_dataColumn.Ordinal] = value;
            _dataTable.CallDataChangedEventHandlers(ListChangedType.ItemChanged, row);
        }
Exemple #3
0
        public DataTableMx _table;         // associated DataTableMx

        /// <summary>
        /// Get/set a single element in the ItemArray object array
        /// </summary>
        /// <param name="columnIndex"></param>
        /// <returns></returns>

        public object this[int columnIndex]
        {
            get
            {
                if (_itemArray == null)
                {
                    DebugMx.InvalidConditionException("_itemArray == null");
                }

                if (columnIndex < 0 || columnIndex >= _itemArray.Length)
                {
                    DebugMx.InvalidConditionException("columnIndex = " + columnIndex + " out of range for DataRow of size = " + _itemArray.Length);
                }

                object o = _itemArray[columnIndex];
                if (o == null || o is DBNull)
                {
                    return(o);
                }

                else if (Table == null || Table.UseNativeDataTypes)
                {
                    return(o);
                }

                else
                {
                    return(MobiusDataType.ConvertToPrimitiveValue(o));
                }
            }

            set
            {
                _itemArray[columnIndex] = value;
                RowState = DataRowState.Modified;                 // say the row is now modified
                _table.CallDataChangedEventHandlers(ListChangedType.ItemChanged, this);
            }
        }