1 using System; 2 3 interface IList 4 { Count()5 int Count (); 6 } 7 8 interface ICounter 9 { 10 int Count { set; } 11 } 12 13 interface IListCounter: IList, ICounter 14 { 15 } 16 17 interface IA 18 { Value()19 int Value (); 20 } 21 22 interface IB : IA 23 { 24 new int Value { get; } 25 } 26 27 interface IC : IB 28 { 29 new int Value { get; } 30 } 31 32 interface IBB : IList, ICounter 33 { 34 } 35 36 interface ICC : IBB 37 { 38 } 39 40 interface IM1 41 { Add(int arg)42 void Add (int arg); 43 } 44 45 interface IM2 : IM1 46 { Add(int arg, bool now)47 int Add (int arg, bool now); 48 } 49 50 class Test 51 { Main()52 public static void Main () 53 { 54 } 55 Foo(IListCounter t)56 static void Foo (IListCounter t) 57 { 58 t.Count (); 59 } 60 Foo2(IC b)61 void Foo2 (IC b) 62 { 63 int i = b.Value; 64 } 65 Foo3(ICC c)66 void Foo3 (ICC c) 67 { 68 c.Count (); 69 } 70 Foo4(IM2 im2)71 void Foo4 (IM2 im2) 72 { 73 im2.Add (2); 74 } 75 76 }