private void OnExitClick(object sender, System.EventArgs e) { try { INViewModel inViewModel = new INViewModel(); inViewModel.InitService(); inViewModel.LogOff(); INWindow inWindow = this.dataService.INWindow as INWindow; if (inWindow != null) { inWindow.IsTaskClose = false; } System.Windows.Application.Current.Shutdown(1004); } catch (System.Exception ex) { this.logger.Error(ex.ToString()); } }
private void Update() { this.lblMsg.Text = "正在检查是否有更新..."; try { INViewModel inViewModel = new INViewModel(); inViewModel.InitService(); inViewModel.GetAppUpdate(this.sessionService.Jid, AppUtil.Instance.AppUpdateVerson()); } catch (System.InvalidOperationException) { this.lblMsg.Text = "更新发生错误,请重试!"; this.btnCheckUpdate.Content = "重新检查"; this.btnCheckUpdate.IsEnabled = true; } }