I am getting a following exception while enumerating through a queue:
System.InvalidOperationException: Collection was modified; enumeration opera
I think all you need to do is stop using the foreach and instead switch it over to a for loop
for(int i = 0; i < tpotActionQueue.Length; i++)
{
TpotAction action = tpotActionQueue[i];
if (action is WriteChannel)
{
channelWrites.Add((WriteChannel)action);
lock(tpotActionQueue)
{
action.Status = RecordStatus.Batched;
}
}
}
Regards, Mike.