internal void ResetInternalIndexes(DataColumn column)
{
Debug.Assert(null != _indexes, "unexpected null indexes");
SetShadowIndexes();
try
{
// the length of shadowIndexes will not change
// but the array instance may change during
// events during Index.Reset
int numIndexes = _shadowIndexes.Count;
for (int i = 0; i < numIndexes; i++)
{
Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy()
if (0 < ndx.RefCount)
{
if (null == column)
{
ndx.Reset();
}
else
{
bool found = false;
foreach (IndexField field in ndx._indexFields)
{
if (ReferenceEquals(column, field.Column))
{
found = true;
break;
}
}
if (found)
{
ndx.Reset();
}
}
}
}
}
finally
{
RestoreShadowIndexes();
}
}