Ejemplo n.º 1
0
 /// <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
     {
     }
 }
Ejemplo n.º 2
0
 /// <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
     {
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 信息控制
        /// </summary>
        /// <param name="args">通讯基础数据包</param>
        private static void Info_Control(C_BaseData args)
        {
            try
            {
                //操作人
                string sharer = args.ConferenceInfoFlg.ConferenceClientControlEntity.Sharer;
                switch (args.ConferenceInfoFlg.ConferenceClientControlEntity.ClientControlType)
                {
                case info_webData.ClientControlType.Close:
                    //关闭其他参会人
                    if (sharer != Constant.SelfUri)
                    {
                        Application.Current.Shutdown(0);
                    }
                    break;

                case info_webData.ClientControlType.VersionUpdate:
                    //强制其他参会人进行版本更新
                    if (sharer != Constant.SelfUri)
                    {
                        //版本检测更新
                        VersionUpdateManage.JustUpdate(Constant.ConferenceVersionUpdateExe);
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(MainPageBase), ex);
            }
            finally
            {
            }
        }
Ejemplo n.º 4
0
        /// <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
            {
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 信息同步辅助
        /// </summary>
        void ConferenceInfoSyncHelper(ConferenceWebCommon.Common.PackageBase args)
        {
            try
            {
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    try
                    {
                        switch (args.ConferenceInfoFlg.ConferenceInfoFlgType)
                        {
                        case ConferenceWebCommon.EntityHelper.ConferenceInfo.ConferenceInfoFlgType.ConferenceInfoEntity:
                            //获取信息同步映射实体数据
                            ConferenceWebCommon.EntityHelper.ConferenceInfo.ConferenceInfoEntity conferenceInfoEntity = args.ConferenceInfoFlg.ConferenceInfoEntity;

                            if (ForceToNavicateEvent != null)
                            {
                                this.ForceToNavicateEvent((ConferenceCommon.EnumHelper.ViewSelectedItemEnum)conferenceInfoEntity.ConferencePageType);
                            }
                            break;

                        case ConferenceWebCommon.EntityHelper.ConferenceInfo.ConferenceInfoFlgType.ConferenceInfoTypeChangeEntity:

                            bool isSimpleModel    = args.ConferenceInfoFlg.ConferenceInfoTypeChangeEntity.IsSimpleModel;
                            bool isEducationModel = args.ConferenceInfoFlg.ConferenceInfoTypeChangeEntity.IsEducationModel;

                            //教育模式
                            if (this.ViewModelChangedEducationEvent != null)
                            {
                                this.ViewModelChangedEducationEvent(isEducationModel);
                            }
                            //精简模式
                            if (this.ViewModelChangedSimpleEvent != null)
                            {
                                this.ViewModelChangedSimpleEvent(isSimpleModel);
                            }
                            if (TempConferenceInformationEntity != null)
                            {
                                //当前临时会议信息更改(模式相关字段)
                                TempConferenceInformationEntity.SimpleMode    = isSimpleModel;
                                TempConferenceInformationEntity.EducationMode = isEducationModel;
                            }

                            break;

                        case ConferenceWebCommon.EntityHelper.ConferenceInfo.ConferenceInfoFlgType.ConferenceClientControlEntity:
                            string sharer = args.ConferenceInfoFlg.ConferenceClientControlEntity.Sharer;
                            switch (args.ConferenceInfoFlg.ConferenceClientControlEntity.ClientControlType)
                            {
                            case ConferenceWebCommon.EntityHelper.ConferenceInfo.ClientControlType.Close:
                                if (sharer != Constant.SelfUri)
                                {
                                    Application.Current.Shutdown(0);
                                }
                                break;

                            case ConferenceWebCommon.EntityHelper.ConferenceInfo.ClientControlType.VersionUpdate:
                                if (sharer != Constant.SelfUri)
                                {
                                    VersionUpdateManage.JustUpdate(Constant.ConferenceVersionUpdateExe);
                                }
                                break;

                            default:
                                break;
                            }
                            break;

                        default:
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        LogManage.WriteLog(this.GetType(), ex);
                    }
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
        }