/// <summary> /// 初始PLM公共数据 /// </summary> /// <param name="user">登陆用户</param> /// <returns></returns> private static bool Init() { try { //this.curUser = user; PSInit.InitPS(ClientData.LogonUser, false); BPMEventInit.InitBPMEvent(); Thyt.TiPLM.UIL.TiMessage.UIMessage.Instance.InitilizeMessage(null); //Thyt.TiPLM.UIL.Addin.AddinDeployment.Instance.SyncAddinsWithServer(); return(true); } catch (Exception ex) { //System.Diagnostics.EventLog.WriteEntry("PLM集成控件",ex.ToString(),System.Diagnostics.EventLogEntryType.Error); PrintException.Print(ex); return(false); } }
private static void Main(string[] args) { ConstEnvironment.CallInModel = true; Application.ThreadException += new ThreadExceptionEventHandler(ClientData.Application_ThreadException); if (!ClientData.OpenExistApp()) { Application.EnableVisualStyles(); if (args.Length > 0) { string param = args[0]; ClientData.UseStartParameter(param); } RemoteProxy.SetCallExcuteName(); FrmVerify.GetFingerCltDefalut = (GetFingerCltDefalutEventHandler)Delegate.Combine(FrmVerify.GetFingerCltDefalut, new GetFingerCltDefalutEventHandler(UIFinger.GetFingerCltDefalut)); PLPassWordChecker.ResetPassWord = (ResetPassWord)Delegate.Combine(PLPassWordChecker.ResetPassWord, new ResetPassWord(FrmSetPsnPwd.ResetUserPassWord)); ClientData.AutoCopyLiveUpdateFiles(); if (FrmLogon.Logon(PLMProductName.TiModeler.ToString())) { try { SplashHelper.Instance.ShowSplashForm(ConstCommon.FUNCTION_EDMS ? "TiModeler.edm" : "TiModeler.plm"); PSInit.InitPS(ClientData.LogonUser, true); Thyt.TiPLM.CLT.TiModeler.FrmMain frmMain = new Thyt.TiPLM.CLT.TiModeler.FrmMain(); ClientData.mainForm = frmMain; BPMEventInit.InitBPMEvent(); UIMessage.Instance.InitilizeMessage(frmMain); MenuBuilder.Instance.Init(); PLProject.Instance.ProjDelegateInstance = (ProjDelegate)Delegate.Combine(PLProject.Instance.ProjDelegateInstance, new ProjDelegate(UIProject.ProjDelegateEvent)); SplashHelper.Instance.CloseSplashForm(); Application.Run(frmMain); frmMain.Dispose(); } catch (Exception exception) { MessageBox.Show(exception.Message, "TiModeler", MessageBoxButtons.OK, MessageBoxIcon.Hand); } finally { LogOff(); } } } }