internal void HandleDependentColumnList(DataExpression oldExpression, DataExpression newExpression)
{
DataColumn[] dependency;
// remove this column from the dependentColumn list of the columns this column depends on.
if (oldExpression != null)
{
dependency = oldExpression.GetDependency();
foreach (DataColumn col in dependency)
{
Debug.Assert(null != col, "null datacolumn in expression dependencies");
col.RemoveDependentColumn(this);
if (col._table != _table)
{
_table.RemoveDependentColumn(this);
}
}
_table.RemoveDependentColumn(this);
}
if (newExpression != null)
{
// get the list of columns that this expression depends on
dependency = newExpression.GetDependency();
// add this column to dependent column list of each column this column depends on
foreach (DataColumn col in dependency)
{
col.AddDependentColumn(this);
if (col._table != _table)
{
_table.AddDependentColumn(this);
}
}
_table.AddDependentColumn(this);
}
}
}