private void masterUpdate_NewVersionFound(string[] newfiles) { try { if (this.InvokeRequired) { this.Invoke(new UpdateMasterData.NewVersionFoundEventHandler(masterUpdate_NewVersionFound), new object[] { newfiles }); } else { _hasRemindDialog = true; UpdateMasterData masterUpdate = new UpdateMasterData(); masterUpdate.DownloadNewMasterDataFiles(newfiles); _hasRemindDialog = false; } } catch { //Program.ShowMessageBox("MainForm", ex); } }
private void CheckAndDownloadMasterData(bool IsStartUp, bool IsManually) { Thread updateThread = new Thread(new System.Threading.ThreadStart(delegate { UpdateMasterData masterUpdate = new UpdateMasterData(); masterUpdate.NewVersionFound += new UpdateMasterData.NewVersionFoundEventHandler(masterUpdate_NewVersionFound); masterUpdate.CheckVersion(IsStartUp, IsManually); })); updateThread.IsBackground = true; updateThread.Start(); }