110,533
社区成员
发帖
与我相关
我的任务
分享
protected IList List {
get { return (IList)this; }
}
public interface Interface1
{
void Test1();
void Test2();
}
public class Class2 : Interface1
{
private Interface1 t2
{
get { return (Interface1)this; }
}
public void Test1()
{
}
void Interface1.Test2()
{
}
public void My()
{
this.t2.Test2(); //调用Test2方式1
((Interface1)this).Test2(); //调用Test2方式2
}
}
Class2 c2 = new Class2();
c2.Test1();
Interface1 c3 = new Class2();
c3.Test2();