private void OnColumnChanged(object sender, DataColumnChangeEventArgs args)
{
// You should not be able to make DataRow field changes if the DataRow is deleted
Debug.Assert(args.Row.RowState != DataRowState.Deleted);
if (_ignoreDataSetEvents)
return;
bool wasIgnoreXmlEvents = _ignoreXmlEvents;
_ignoreXmlEvents = true;
bool wasFoliationEnabled = IsFoliationEnabled;
IsFoliationEnabled = false;
try
{
DataRow row = args.Row;
DataColumn col = args.Column;
object oVal = args.ProposedValue;
if (row.RowState == DataRowState.Detached)
{
XmlBoundElement be = row.Element;
Debug.Assert(be != null);
if (be.IsFoliated)
{
// Need to sync changes from ROM to DOM
OnColumnValueChanged(row, col, be);
}
}
}
finally
{
IsFoliationEnabled = wasFoliationEnabled;
_ignoreXmlEvents = wasIgnoreXmlEvents;
}
}