コード例 #1
0
        /// <summary>
        /// Delete the given row from the underlying columns and notify consumers
        /// </summary>
        /// <param name="rowIndex"></param>
        public void DeleteRow(int rowIndex)
        {
            // First notify (don't delete first so that consumers can still use the value being deleted)
            var rowUpdate = new TableUpdate(TableUpdateAction.Delete, rowIndex);

            _subject.OnNext(rowUpdate);

            // And then delete from the underlying store
            _rowManager.DeleteRow(rowIndex);
            foreach (var column in Columns)
            {
                column.RemoveField(rowIndex);
            }
        }
コード例 #2
0
        public int AddRow()
        {
            var rowIndex = _rowManager.AddRow();

            for (var index = 0; index < Columns.Count; index++)
            {
                var column = Columns[index];
                column.AddField(rowIndex);
            }

            var rowUpdate = new TableUpdate(TableUpdateAction.Add, rowIndex);

            _subject.OnNext(rowUpdate);
            return(rowIndex);
        }
コード例 #3
0
 private void OnNext(IReactiveTable table, TableUpdate update)
 {
     if (table == _leftTable)
     {
         _leftUpdateCount++;
         if (_leftUpdateCount > _rightUpdateCount)
         {
             _observer.OnNext(update);
         }
     }
     if (table == _rightTable)
     {
         _rightUpdateCount++;
         if (_rightUpdateCount > _leftUpdateCount)
         {
             _observer.OnNext(update);
         }
     }
 }
コード例 #4
0
        public void OnNext(int rowIndex)
        {
            var columnUpdate = new TableUpdate(TableUpdateAction.Update, rowIndex, _column);

            _observers.OnNext(columnUpdate);
        }
コード例 #5
0
 /// <summary>
 /// Whether this change only affects one or more columns, but not the whole row.
 /// </summary>
 /// <param name="update"></param>
 /// <returns></returns>
 public static bool IsColumnUpdate(TableUpdate update)
 {
     return(update.IsColumnUpdate());
 }
コード例 #6
0
 /// <summary>
 /// Whether this change affects the whole row
 /// </summary>
 /// <param name="update"></param>
 /// <returns></returns>
 public static bool IsRowUpdate(TableUpdate update)
 {
     return(update.IsRowUpdate());
 }