1
Vote

Multidimensional indexers

description

Does Jint multidimensional indexers from CLR object?

static void Main()
    {
        JintEngine je = new JintEngine();
        je.Run(@"
var test = new JintTest.Test();
test[2,3];
");
    }
}

public class Test
{        
    public int this[int i, int j]
    {
        get
        {
            return i + j;
        }
    }
}
This code does not cause an error. It just does not work.

comments

cin wrote Jun 10, 2012 at 10:42 AM

Yes, you can do this through getter and setter methods of the indexer, by default C# generated indexers are named 'Item', and has get_Item/set_Item accessors