// Default protected override bool InternalDefault(Program program, IRow oldRow, IRow newRow, BitArray valueFlags, string columnName, bool isDescending) { if (isDescending && PropagateDefault) { TableNode sourceNode = SourceNode; IRow localOldRow; if (!(oldRow.DataType.Columns.Equivalent(DataType.Columns))) { localOldRow = new Row(program.ValueManager, DataType.RowType); oldRow.CopyTo(localOldRow); } else { localOldRow = oldRow; } try { IRow localNewRow; if (!(newRow.DataType.Columns.Equivalent(DataType.Columns))) { localNewRow = new Row(program.ValueManager, DataType.RowType); newRow.CopyTo(localNewRow); } else { localNewRow = newRow; } try { Row oldSourceRow = new Row(program.ValueManager, sourceNode.DataType.RowType, (NativeRow)localOldRow.AsNative); try { oldSourceRow.ValuesOwned = false; Row newSourceRow = new Row(program.ValueManager, sourceNode.DataType.RowType, (NativeRow)localNewRow.AsNative); try { newSourceRow.ValuesOwned = false; bool changed = sourceNode.Default(program, oldSourceRow, newSourceRow, valueFlags, columnName == String.Empty ? String.Empty : newSourceRow.DataType.Columns[localNewRow.DataType.Columns.IndexOfName(columnName)].Name); if (changed && (newRow != localNewRow)) { localNewRow.CopyTo(newRow); } return(changed); } finally { newSourceRow.Dispose(); } } finally { oldSourceRow.Dispose(); } } finally { if (!ReferenceEquals(newRow, localNewRow)) { localNewRow.Dispose(); } } } finally { if (!ReferenceEquals(oldRow, localOldRow)) { localOldRow.Dispose(); } } } return(false); }