Ste*_*ner 10
在你的类的构造函数中:
public MyUnsealedClass()
{
if (this.GetType() != typeof(MyUnsealedClass))
throw new Exception("Don't do that");
}
Run Code Online (Sandbox Code Playgroud)
为什么不使用sealed关键字呢?
| 归档时间: |
|
| 查看次数: |
2361 次 |
| 最近记录: |