Esempio n. 1
0
        /// 检查版本是否旧的,是否继续
        /// <summary>
        /// 检查版本是否旧的,是否继续
        /// </summary>
        /// <returns></returns>
        public static bool IsOldVersionContinue()
        {
            bool iscontinue = true;
            //不可用(3种状态 true false null 只有ture不更新)
            string OldVersionEnable = BitAuto.Utils.Config.ConfigurationUtil.GetAppSettingValue("OldVersionEnable", false);

            //不可用
            if (OldVersionEnable != "true")
            {
                if (UpdateTip.HasShow)
                {
                    if (UpdateTip.Instance != null)
                    {
                        //关闭上一个提示窗口
                        UpdateTip.Instance.Close();
                    }
                    //显示提示窗口
                    UpdateTip form = new UpdateTip();
                    form.StartPosition = FormStartPosition.CenterParent;
                    form.ShowDialog();
                    iscontinue = false;
                }
            }
            return(iscontinue);
        }
Esempio n. 2
0
        /// 检查版本
        /// <summary>
        /// 检查版本
        /// </summary>
        private void CheckVersion()
        {
            //旧版本是否可用
            string OldVersionEnable = BitAuto.Utils.Config.ConfigurationUtil.GetAppSettingValue("OldVersionEnable", false);

            //不可用(3种状态 true false null 只有ture不更新)
            if (OldVersionEnable != "true")
            {
                //签入之后 校验版本新旧
                if (LoginUser.isLoggedIn && UpdateTip.HasShow == false)
                {
                    //服务器版本
                    string serverVersion = Common.GetSeverVersion();
                    if (serverVersion != null)
                    {
                        //本地客户端版本
                        string myVersion = Common.GetValByKey("Versions_Local", "HTTP").Trim();
                        if (myVersion != serverVersion)
                        {
                            UpdateTip form = new UpdateTip();
                            if (this.InvokeRequired)
                            {
                                this.Invoke(new System.Action(() => { form.Show(); }));
                            }
                            else
                            {
                                form.Show();
                            }
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        //System.Threading.Timer timer = null;

        public UpdateTip()
        {
            Instance = this;
            HasShow  = true;
            InitializeComponent();
            this.Load        += new EventHandler(UpdateTip_Load);
            this.FormClosing += new FormClosingEventHandler(UpdateTip_FormClosing);

            //自动关闭机制
            //timer = new System.Threading.Timer((t) => { DefineClose(); }, null, 1000 * 10, 1000 * 12);
        }
Esempio n. 4
0
 private void UpdateTip_FormClosing(object sender, FormClosingEventArgs e)
 {
     //AnimateWindow(this.Handle, 1000, AW_BLEND | AW_HIDE);
     UpdateTip.Instance = null;
 }