public static void Main()
        {
            AppLoadingWindow loadWindow = new AppLoadingWindow();

            loadWindow.ShowDialog();
            if (loadWindow.viewModel.InitializeState == SeatManage.EnumType.HandleResult.Failed)
            {
                return;
            }
            App app = new App();

            app.InitializeComponent();
            app.Run();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 连接丢失
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void clientObject_UpdateConfigError(object sender, EventArgs e)
 {
     this.Dispatcher.Invoke(new Action(() =>
     {
         SystemObject obj = OperateResult.SystemObject.GetInstance();
         obj.StopUpdateConfig();
         viewModel.timeDateTimeSync.TimeStop();
         viewModel.MyLastSeatSumTime.TimeStop();
         if (obj.ObjCardReader != null)
         {
             obj.ObjCardReader.Stop();
         }
         if (this.WindowState == System.Windows.WindowState.Maximized)
         {
             AppLoadingWindow AppLoading = new AppLoadingWindow();
             AppLoading.ShowDialog();
             this.Hide();
             if (AppLoading.viewModel.InitializeState == SeatManage.EnumType.HandleResult.Successed)
             {
                 if (obj.ObjCardReader != null)
                 {
                     obj.ObjCardReader.Start();
                 }
                 viewModel.timeDateTimeSync.TimeStrat();
                 viewModel.MyLastSeatSumTime.TimeStrat();
                 obj.StartAutoUpdateConfig();
                 this.Show();
             }
             else
             {
                 Application.Current.Shutdown();
             }
         }
         else
         {
             notifyIcon.ShowBalloonTip(5000, "离开终端", "连接丢失,正常重新连接...", System.Windows.Forms.ToolTipIcon.Error);
             appint = new ViewModel.AppLoadingWindow_ViewModel();
             appint.InitializeEnd += new EventHandler(appint_InitializeEnd);
             appint.Run();
         }
     }));
 }