I find myself in a situation where I'm not sure which Collection would best suit my needs.
I have a series of task objects that will be used in the following manner...
- The tasks will execute repeatedly during the application's runtime.
- The tasks will execute in a specific order based on the priority I assign each of them. (I don't care in what order tasks with matching priorities execute.)
- No task will execute twice during a single iteration through the sequence, so no duplicate entries.
- Between iterations, tasks may be added to or removed from anywhere in the sequence based on their priority.
Were I doing this in Java, I'd be looking for a SortedSet of some kind, but Sets in C# seem to be much less straightforward. Can anyone lend some advice?
Thanks!
EDIT: Thank you to all who suggested a variety of List collections, but Lists allow duplicates. :(