摘要: 有时候我们需要使用单例模式的窗口,如监控窗口等。写成如下形式:if (ucsInstance == null || ucsInstance.IsDisposed) { ucsInstance = new ucTongXun(); } return ucsInstance;但是这样还没有完全搞定,因为这个窗口关闭的话,相当于isDisposed等于true,就是释放了,那么达不到实例化的目的,因此需要在释放函数中,就是在designer.cs中找到protected override void Dispose(bool disposing) { if (disposing && 阅读全文
posted @ 2013-12-04 16:37 苗苗她爹 阅读(370) 评论(0) 推荐(0) 编辑