/// <summary> /// 打开多例模式下的对象 /// </summary> /// <param name="isShowTop">是否显示为顶层窗体</param> /// <returns></returns> public Control initPrototypeExample(bool isShowTop) { RedrawStatusBar conThis = this; conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TOOL_START) + DateTime.Now.Ticks.ToString();; if (isShowTop) { conThis.BringToFront(); } // 加入到多例工厂 ControlCacheFactory.addPrototypeCache(DefaultNameEnum.TOOL_START, conThis); return(conThis); }
/// <summary> /// 打开单例模式下的对象 /// </summary> /// <param name="isShowTop">是否显示为顶层窗体</param> /// <returns></returns> public Control initSingleExample(bool isShowTop) { RedrawStatusBar conThis = null; Control con = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TOOL_START); if (con == null || !(con is RedrawStatusBar)) { conThis = this; conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TOOL_START); ControlCacheFactory.addSingletonCache(conThis); } else { conThis = (RedrawStatusBar)con; } if (isShowTop) { conThis.BringToFront(); } return(conThis); }