C#中的接口的使用
定义接口
public interface IMyInterface
{int MyProperty { get; set; }void MyMethod();
}
实现类
internal class MyClass : IMyInterface
{public int MyProperty { get; set; }public void MyMethod(){Console.WriteLine("MyMethod is called");}
}
目录结构