public static void Main (string[] args) {
		var t1 = new CustomType1();
		var t2 = new CustomType2();
		
		Console.WriteLine("{0} {1}", t1.Interface1Method(1), ((IInterface1)t1).Interface1Method(2));
		Console.WriteLine("{0} {1} {2}", t2.Interface1Method(1), ((CustomType1)t2).Interface1Method(2), ((IInterface1)t2).Interface1Method(3));;
	}
示例#2
0
    public static void Main(string[] args)
    {
        var t1 = new CustomType1();
        var t2 = new CustomType2();

        Console.WriteLine("{0} {1}", t1.Interface1Method(1), ((IInterface1)t1).Interface1Method(2));
        Console.WriteLine("{0} {1} {2}", t2.Interface1Method(1), ((CustomType1)t2).Interface1Method(2), ((IInterface1)t2).Interface1Method(3));;
    }