/// <summary> /// 检测版本 /// </summary> public void CheckVersion() { try { //版本更新 ModelManage.ConferenceVersion.NeedVersionUpdate(SpaceCodeEnterEntity.CurrentVersion, new Action <bool, Exception>((needUpdate, error) => { //调用版本更新服务无异常 if (error == null) { //跨线程(异步委托) this.Dispatcher.BeginInvoke(new Action(() => { //是否需要更新(由服务端去判断) if (needUpdate) { if (LoginWindow != null) { //通过这种方式一样可以关闭程序 LoginWindow.Visibility = Visibility.Collapsed; } VersionUpdateManage.VersionUpdate(SpaceCodeEnterEntity.ConferenceVersionUpdateExe); } })); } })); } catch (Exception ex) { LogManage.WriteLog(typeof(App), ex); } finally { } }
/// <summary> /// 版本更新 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnVersionUpdate_Click(object sender, RoutedEventArgs e) { try { //版本检测更新 VersionUpdateManage.VersionUpdate(Constant.ConferenceVersionUpdateExe); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 获取信息成功 /// </summary> private void GetClientAppConfigSuccessedDealWidth() { try { this.Dispatcher.BeginInvoke(new Action(() => { if (this.loginWindow != null) { //版本更新 ModelManage.ConferenceVersion.NeedVersionUpdate(Constant.CurrentVersion, new Action <bool, Exception>((needUpdate, error) => { //调用版本更新服务无异常 if (error == null) { //是否需要更新(由服务端去判断) if (needUpdate) { //通过这种方式一样可以关闭程序 this.loginWindow.Visibility = System.Windows.Visibility.Hidden; VersionUpdateManage.VersionUpdate(Constant.ConferenceVersionUpdateExe); } } })); this.loginWindow.InitializtionVisibility = Visibility.Collapsed; this.loginWindow.CanThrow = true; } })); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }