Parameterise heterogeneous index-enabled objects
<p>Is there a way to parameterise an object based on the fact that it has an index property?</p>

<p><strong>Example</strong>:</p>

<pre><code>public void LoopThroughIndexer(IndexEnabledClass parameter)
{
    object value1 = parameter[1]
    object value2 = parameter[2]
    //Do stuff with value1 and value2
}
</code></pre>

<p>Thanks in advance everyone!</p>

<p><strong>EDIT 1:</strong>
Thank you for your interest. To clear things up, by <em>parameterise</em>, I mean to make it as a argument in a method; in my example, <code>parameter</code> is of broadly defined type <code>IndexEnabledClass</code>. my question is, does something like <code>IndexEnabledClass</code> exist.</p>

<p>The answer seems to be no, but you can use <code>IEnumerable&lt;E&gt;</code></p>
