public override int IndexOf(object value, int startIndex, int count)
{
if (startIndex < 0 || startIndex > m_Adaptee.Count)
{
ThrowNewArgumentOutOfRangeException ("startIndex", startIndex,
"Does not specify valid index.");
}
if (count < 0)
{
ThrowNewArgumentOutOfRangeException ("count", count,
"Can't be less than 0.");
}
// re-ordered to avoid possible integer overflow
if (startIndex > m_Adaptee.Count - count) {
// LAMESPEC: Every other method throws ArgumentException
throw new ArgumentOutOfRangeException("count",
"Start index and count do not specify a valid range.");
}
if (value == null)
{
for (int i = startIndex; i < startIndex + count; i++)
{
if (m_Adaptee[i] == null)
{
return i;
}
}
}
else
{
for (int i = startIndex; i < startIndex + count; i++)
{
if (value.Equals(m_Adaptee[i]))
{
return i;
}
}
}
return -1;
}