In C#, How can I serialize Queue<>? (.Net 2.0)
It would be easier (and more appropriate IMO) to serialize the data from the queue - perhaps in a flat array or List<T>
. Since Queue<T>
implements IEnumerable<T>
, you should be able to use:
List<T> list = new List<T>(queue);