private void ShowFrmMemberAddOrModify(HandleStatus status, MemberInfo member) { this.Hide(); FrmMemberAddOrModify fmam = FrmMemberAddOrModify.Single(status, member); fmam.FormClosed += fmam_FormClosed; fmam.Show(); }
public static FrmMemberAddOrModify Single(HandleStatus status, MemberInfo member) { if (instance == null || instance.IsDisposed) { instance = new FrmMemberAddOrModify(status, member); } return(instance); }
private void ShowFrmMemberAddOrModify(int temp, MemberInfo memberinfo) { this.Hide(); FrmMemberAddOrModify frmAddorModify = FrmMemberAddOrModify.Single(temp, memberinfo); frmAddorModify.FormClosed += frmAddorModify_FormClosed; frmAddorModify.Show(); }
//单例模式代码 public static FrmMemberAddOrModify Single(int temp, MemberInfo member) { if (instance == null || instance.IsDisposed) { instance = new FrmMemberAddOrModify(member); Temp = temp;//标识存起来 } return(instance); }
//单例模式代码 public static FrmMemberAddOrModify Single(int temp, MemberInfo member) { if (instance == null || instance.IsDisposed) { instance = new FrmMemberAddOrModify(member); Temp = temp;//标识存起来 } return instance; }
public static FrmMemberAddOrModify Single(int temp, MemberInfo memberinfo) { if (_instance == null || _instance.IsDisposed) { _instance = new FrmMemberAddOrModify(memberinfo); Temp = temp; } return(_instance); }
private void ShowFrmMemberOrModify(int temp, MemberInfo member) { this.Hide(); //当前窗体隐藏 //显示新增或修改窗体 FrmMemberAddOrModify fmam = FrmMemberAddOrModify.Single(temp, member); //单例模式下的new新窗体并且传递了数据,新增就没有对象传过去,修改就有 fmam.FormClosed += new FormClosedEventHandler(fmam_FormClosed); //事件 fmam.Show(); }