Beispiel #1
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        private void Init()
        {
            try
            {
                this.Activate();

                GetAppInfo();

                GetAdvertiseInfo();

                DownLoadManual();

                this.expiredTime.Content = "到期时间:" + GlobalInfo.ExpiredTime;
                if (File.Exists(@"rjcf.df"))
                {
                    StreamReader reader = new StreamReader("rjcf.df", Encoding.UTF8);
                    this.lblPhone.Content = reader.ReadToEnd().ToString();
                    reader.Close();
                }
                this.lblVersion.Content = string.Format(PRO_ReceiptsInvMgr.Resources.Common.ClientVersion, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
                LoadNotifyIcon();

                CheckUpdate();

                IntervalUpdateClient();

                var btnQA = (Button)windowTemplate.FindName("btnQA", this);
                btnQA.Click += new RoutedEventHandler((o, e) =>
                {
                    if (qaWindow == null)
                    {
                        qaWindow = new QA();
                        qaWindow.Show();
                        qaWindow.Closing += delegate
                        {
                            qaWindow = null;
                        };
                    }
                    else
                    {
                        qaWindow.Activate();
                        qaWindow.WindowState = WindowState.Normal;
                    }
                });
            }
            catch (Exception ex)
            {
                Logging.Log4NetHelper.Error(typeof(MainWindow), Message.ErrorMsg + ex.Message + System.Environment.NewLine + ex.StackTrace);
            }
        }