Finding the index of a queue that holds a member of a containing object for a given value
Posted
by Luke Mcneice
on Stack Overflow
See other posts from Stack Overflow
or by Luke Mcneice
Published on 2010-03-16T17:00:37Z
Indexed on
2010/03/16
19:21 UTC
Read the original article
Hit count: 302
I have a Queue that contains a collection of objects, one of these objects is a class called GlobalMarker that has a member called GlobalIndex.
What I want to be able to do is find the index of the queue where the GlobalIndex contains a given value (this will always be unique).
Simply using the Contains
method shown below returns a bool
. How can I obtain the queue index of this match?
RealTimeBuffer
.OfType<GlobalMarker>()
.Select(o => o.GlobalIndex)
.Contains(INT_VALUE);
© Stack Overflow or respective owner