1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
using System; class Item { internal static object Field = "Test"; } class Caller { public string this[string x] { get { return x; } } public int this[int x] { get { return x; } } public void Foo () { var v = Item.Field.ToString (); } public static void Main () { } }