代码:
public List<Interfaces.Test> IJ_;
IEnumerator<Interfaces.Test> Ij_ = Objects.GetEnumerator();
int count = IJ_.Count;
Ij_.MoveNext();
for (int x = 0; x < count; x++)
{
if (x >= count)
break;
Test MyBase = IJ_.Current;
if (MyBase == null)
obj_.MoveNext(); //here the error
}
错误:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
请帮我。