博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年1月14日

摘要: 当我们在wm项目中需要经常显示一个窗体(比如是地图显示的窗体),而且这个窗体中显示的东西又比较多时,我们可以考虑在该窗体中定位一个单例模式的静态对象:代码如下: #region private static readonly MapForm _instance = new MapForm(); #endregion #region Properties public static MapForm Instance { get { return _instance; } }   #endregion  接下去当我们在别的窗体中调用并显示MapForm时,如下代码:  MapForm.Insta 阅读全文

posted @ 2011-01-14 13:28 amey 阅读(457) 评论(0) 推荐(0)