public class Foo {
private int[] a = new int[10];
private Dictionary<string, int> b;
private int[] c = new int[100];
public int this[int i] { // 1
get { return a[i]; }
set { a[i] = value; }
}
public int this[string id] { // 2
get { return b[id]; }
set { b[id] = value; }
}
public int this[int i, int j] { // 3
get { return c[i*10 + j]; }
set { c[i*10 + j] = value; }
}
}
Login in to like
Login in to comment