.NET seems to have a lot of data structure and collection types. Does it have a first-in-first-out collection with a maximum size and no duplication, or something similar to that?
An example usage would be like for storing 5 most recently opened files. If a 6th object is added, dequeue the least recent object to keep the size to 5
You’ll have to create a
QueueSetthat implementsICollection<T>. It can be a wrapper class that contains a collection as a backing store. It can be implemented as follows:I release this code into the public domain.