private bool FindSortIndex()
{
_index = null;
_table._indexesLock.EnterUpgradeableReadLock();
try
{
int count = _table._indexes.Count;
int rowsCount = _table.Rows.Count;
for (int i = 0; i < count; i++)
{
Index ndx = _table._indexes[i];
if (ndx.RecordStates != _recordStates)
continue;
if (!ndx.IsSharable)
{
continue;
}
if (CompareSortIndexDesc(ndx._indexFields))
{
_index = ndx;
return true;
}
}
}
finally
{
_table._indexesLock.ExitUpgradeableReadLock();
}
return false;
}