void SetTupleValueAndResetColumnSortingIfNeeded(ITuple tuple, int columnIndex, object newValue) { var oldValue = tuple.GetValue(columnIndex); tuple.SetValue(columnIndex, newValue); // Reset column sorting only if needed // Using object.Equals to bypass unboxing if (!object.Equals(oldValue, newValue)) { SetColumnSorting(columnIndex, TableValueSortType.NONE); } }
protected override void UpdateViewsHolder(TTupleValueViewsHolder newOrRecycled) { object value; if (_CurrentTuple == null) // data pending { value = null; } else { value = _CurrentTuple.GetValue(newOrRecycled.ItemIndex); } newOrRecycled.UpdateViews(value, _ColumnsProvider); }
protected void AssertAreSame(ITuple source, ITuple target, int startIndex, int targetStartIndex, int count) { for (int i = 0; i < count; i++) { bool available = source.GetFieldState(i + startIndex).IsAvailable(); try { Assert.AreEqual(available, target.GetFieldState(i + targetStartIndex).IsAvailable()); Assert.AreEqual(source.GetValue(i + startIndex), target.GetValue(i + targetStartIndex)); } catch (AssertionException) { Console.Out.WriteLine(string.Format("Tuple type: {0}", target.GetType().Name)); Console.Out.WriteLine(string.Format("Field Index: {0}", i)); Console.Out.WriteLine(); } } }