Ok - seems like you might be implimenting your own version of a Queue, which internally is using List? In which case you would need to work out an algorithm for this... Anyway, assuming you are using System.Collections.Generic.Queue<T> you can use the "Contains" method, for example:
Queue<string> q = new Queue<string>();
//Initialise Queue here
bool b = q.Contains("Hello world");
As for getting based on an ID number, Im not sure what you are wanting: -If you want to do this like an index number (i.e. "Get the second item in the queue"), you can use an iterator (see foreach), or can cast it to an array (using ToArray) before getting the value. -If each item in the Queue has a unique id number, which does not correspond to its index in the queue, you could try iterating until a condition is met For example:
foreach(item x in queue)
{
if(x.Id == IdWeAreSearchingFor)
{
//Found a match, so do whatever we need to do with it
break;
}
}
Maybe one of these approaches will help you get a bit further, but if not let me know. It would be helpful to know if you are using Queue or making your own Queue class based on List if none of these suggestions helped! Chris