protected virtual void Dispose(bool disposing) { if (disposing) { try { if (FrmWebcam != null) { FrmWebcam.Invoke((MethodInvoker) delegate { FrmWebcam.Close(); }); } if (FrmTm != null) { FrmTm.Invoke((MethodInvoker) delegate { FrmTm.Close(); }); } if (FrmRe != null) { FrmRe.Invoke((MethodInvoker) delegate { FrmRe.Close(); }); } if (FrmSi != null) { FrmSi.Invoke((MethodInvoker) delegate { FrmSi.Close(); }); } if (FrmRs != null) { FrmRs.Invoke((MethodInvoker) delegate { FrmRs.Close(); }); } if (FrmStm != null) { FrmStm.Invoke((MethodInvoker) delegate { FrmStm.Close(); }); } if (FrmKl != null) { FrmKl.Invoke((MethodInvoker) delegate { FrmKl.Close(); }); } if (FrmProxy != null) { FrmProxy.Invoke((MethodInvoker) delegate { FrmProxy.Close(); }); } if (FrmPass != null) { FrmPass.Invoke((MethodInvoker) delegate { FrmPass.Close(); }); } if (FrmCon != null) { FrmCon.Invoke((MethodInvoker) delegate { FrmCon.Close(); }); } } catch (InvalidOperationException) { } } }
/// <summary> /// 返回一个FORM对象 /// </summary> /// <returns></returns> public object GetObject() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } FrmCon frmCon = null; FrmHzddy hzddy = null; switch (_functionName) { case "Fun_Ts_zyys_hzgl": if (_communicateValue != null) { frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName, _communicateValue); } else { frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName); } if (_mdiParent != null) { // frmCon.MdiParent = _mdiParent; frmCon.Show(); } break; case "Fun_Ts_zyys_hzddy": hzddy = new FrmHzddy(); hzddy.MdiParent = _mdiParent; hzddy.Show(); break; default: throw new Exception("引出函数名称错误!"); } return(frmCon); }
/// <summary> /// 根据函数名称实例化窗体 /// </summary> public void InstanceWorkForm() { if (_functionName == "") { throw new Exception("引出函数名不能为空!"); } FrmCon frmCon = null; FrmHzddy hzddy = null; switch (_functionName) { case "Fun_Ts_zyys_hzgl": frmCon = new FrmCon(_currentUser.UserID, _currentDept.DeptId, _chineseName); if (_mdiParent != null) { frmCon.MdiParent = _mdiParent; } frmCon.BringToFront(); frmCon.ShowDialog(); break; case "Fun_Ts_zyys_hzddy": hzddy = new FrmHzddy(); if (_mdiParent != null) { hzddy.MdiParent = _mdiParent; } hzddy.WindowState = FormWindowState.Maximized; hzddy.BringToFront(); hzddy.Show(); break; default: throw new Exception("引出函数名错误!"); } }