tags:

views:

34

answers:

2

Hi all,

If I where to have a Queue holding a collection of objects (Custom object,bool,bool,bool,bool) and the custom object holds three doubles itself.

Can I use the .Take(IntegerValue) command to only take one of the doubles (for the specified take length) from the custom entity contained in the queue and cast it to a double array, possibly with the .ToArray<double> function?

Thanks,

Luke

+1  A: 
queue.Select(o => o.Member).Take(integerValue).ToArray();
dkackman
A: 

If your custom object contains a double array, then you can do something like this:

queue.OfType<CustomObject>().Select(o => o.doubleArray[0]).Take(1).ToArray();
Dan Bryant
thanks Dan, exactly what I was looking for
Luke Mcneice