getting index of elements by from a list
<p>Suppose I have a list of objects called <code>TheListOfMyObjects</code>. In that list, there's an object with a property that matches a value: <code>MyObject.TheProperty = SomeValue</code>.</p>

<p>How can I get the previous 3 objects and the next 3 objects from within this list?</p>

<p>Note that if the object that matches <code>SomeValue</code> is in first position then I'd need the 3 objects in position 2-5 and the 3 objects in the last 3 positions for a total of 6 objects.</p>

<p>Thanks for your suggestions.</p>
