private void PriceTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (VZ_AppHelper.GetInstance().payInfo == null)
     {
         return;
     }
     updatePrice();
     VZ_AppProcessHelper.getSingleton().quitSteamVRHome();
     if ((VZ_AppHelper.GetInstance().payInfo.expire > VZ_AppHelper.GetInstance().payInfo.current_time) || VZ_AppHelper.GetInstance().systemInfo.isDebug)
     {
         Dispatcher.BeginInvoke((Action)(() =>
         {
             isEnterGame = true;
             //VZDownloadManager.getSingleton().pause();
             MainWindow win = new MainWindow();
             win.Show();
             if (helpWin != null && helpWin.IsVisible)
             {
                 helpWin.Close();
                 helpWin = null;
             }
             this.Close();
         }));
     }
 }
Exemple #2
0
 public void setGameIsPlaying(bool isPlaying)
 {
     if (VZ_AppProcessHelper.getSingleton().getCurrentGame() != gameInfo)
     {
         isGameInPlaying = false;
     }
     else
     {
         isGameInPlaying = isPlaying;
     }
     Dispatcher.BeginInvoke((Action)(() =>
     {
         if (isPlaying)
         {
             gameVideo.IsMute = true;
         }
         else
         {
             gameVideo.IsMute = false;
         }
         if (isGameInPlaying)
         {
             runBt.Content = "退出游戏";
             runBt.Background = new ImageBrush(new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Res/bt_play.png", UriKind.RelativeOrAbsolute)));
         }
     }));
 }
 private void QuitBt_Click(object sender, RoutedEventArgs e)
 {
     VZ_AppProcessHelper.getSingleton().closeAllApp();
     if (gameInfoUC != null)
     {
         gameInfoUC.updateState();
     }
 }
        void updatePrice()
        {
            counter++;
            Dispatcher.BeginInvoke((Action)(() =>
            {
                VZ_AppProcessHelper.getSingleton().runTopVideo();
                tb1.Text = VZ_AppHelper.GetInstance().payInfo.price + "元 / " + VZ_AppHelper.GetInstance().payInfo.watch_time + "分钟";
            }));

            //价格1
            if (price != VZ_AppHelper.GetInstance().payInfo.price)
            {
                string url = getQRCodeURL();
                getQRCodeImageAsync(imgCode1, url, 0);
            }
            else if (counter > maxRefresh)
            {
                string url = getQRCodeURL();
                getQRCodeImageAsync(imgCode1, url, 0);
            }
            price = VZ_AppHelper.GetInstance().payInfo.price;

            //价格2
            if (VZ_AppHelper.GetInstance().payInfo.priceArr != null && VZ_AppHelper.GetInstance().payInfo.watchtimeArr != null)
            {
                if (VZ_AppHelper.GetInstance().payInfo.priceArr.Length >= 2 && VZ_AppHelper.GetInstance().payInfo.watchtimeArr.Length >= 2)
                {
                    if (price2 != VZ_AppHelper.GetInstance().payInfo.priceArr[1])
                    {
                        string url = getQRCodeURL(1);
                        getQRCodeImageAsync(imgCode2, url, 0);
                    }
                    else if (counter > maxRefresh)
                    {
                        string url = getQRCodeURL(1);
                        getQRCodeImageAsync(imgCode2, url, 0);
                    }
                    Dispatcher.BeginInvoke((Action)(() =>
                    {
                        tb2.Text = VZ_AppHelper.GetInstance().payInfo.priceArr[1] + "元 / " + VZ_AppHelper.GetInstance().payInfo.watchtimeArr[1] + "分钟";
                    }));
                    price2 = VZ_AppHelper.GetInstance().payInfo.priceArr[1];
                }
                else
                {
                    Dispatcher.BeginInvoke((Action)(() =>
                    {
                        tb2.Text = "";
                    }));
                }
            }

            if (counter > maxRefresh)
            {
                counter = 0;
            }
        }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (priceTimer != null)
     {
         priceTimer.Stop();
         priceTimer = null;
     }
     VZ_AppProcessHelper.getSingleton().closeTopVideo();
 }
Exemple #6
0
 protected override void OnClosing(CancelEventArgs e)
 {
     if (priceTimer != null)
     {
         priceTimer.Stop();
         priceTimer = null;
     }
     VZ_AppProcessHelper.getSingleton().hideTopVideo();
 }
 public void onClose(VZ_GameInfoUC view)
 {
     if (mainGrid.Children.Contains(view))
     {
         mainGrid.Children.Remove(view);
         gameInfoUC = null;
     }
     grid3.Visibility = Visibility.Visible;
     vpp.Visibility   = Visibility.Visible;
     VZ_AppProcessHelper.getSingleton().muteTopVideo(false);
 }
        public void onPlay(VZ_GameInfoUC view, VZ_AppInfo info)
        {
            showGameOpeningWin();
            VZ_AppProcessHelper.getSingleton().runApp(info);

            if (info.type.Equals("game") && !info.appExeName.Equals("DrumGame.exe"))
            {
                this.Activate();
            }
            view.setGameIsPlaying(true);
        }
Exemple #9
0
 public void updateState()
 {
     if (VZ_AppProcessHelper.getSingleton().getCurrentGame() != null)
     {
         setGameIsPlaying(true);
     }
     else
     {
         setGameIsPlaying(false);
     }
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     //VZDownloadManager.getSingleton().setListener(null);
     //VZDownloadManager.getSingleton().pause();
     if (priceTimer != null)
     {
         priceTimer.Stop();
         priceTimer = null;
     }
     if (!isEnterGame)
     {
         VZ_AppProcessHelper.getSingleton().closeTopVideo();
     }
 }
        void makePosition()
        {
            Screen s = VZ_AppProcessHelper.getSingleton().getMainScreen();

            System.Drawing.Rectangle r = s.WorkingArea;
            this.Top    = r.Top;
            this.Left   = r.Left;
            this.Width  = r.Width;
            this.Height = r.Height;

            this.WindowStartupLocation = WindowStartupLocation.Manual;
            //this.Top = 0;
            //this.Left = System.Windows.SystemParameters.MaximizedPrimaryScreenWidth;
            this.WindowState = System.Windows.WindowState.Normal;
            this.WindowStyle = System.Windows.WindowStyle.None;
            this.WindowState = System.Windows.WindowState.Maximized;
        }
Exemple #12
0
 void updatePrice()
 {
     counter++;
     Dispatcher.BeginInvoke((Action)(() =>
     {
         VZ_AppProcessHelper.getSingleton().runTopVideo();
         tb.Text = VZ_AppHelper.GetInstance().payInfo.price + "元 / " + VZ_AppHelper.GetInstance().payInfo.watch_time + "分钟";
     }));
     if (price != VZ_AppHelper.GetInstance().payInfo.price)
     {
         getQRCodeImageAsync();
     }
     else if (counter > maxRefresh)
     {
         counter = 0;
         getQRCodeImageAsync();
     }
     price = VZ_AppHelper.GetInstance().payInfo.price;
 }
 void updatePrice()
 {
     Dispatcher.BeginInvoke((Action)(() =>
     {
         VZ_AppProcessHelper.getSingleton().runTopVideo();
         this.Activate();
     }));
     counter--;
     if (counter <= 0)
     {
         ImageSource source = VZ_AppHelper.getQRCode();
         if (source != null)
         {
             Dispatcher.BeginInvoke((Action)(() =>
             {
                 imgCode.Source = source;
                 imgCode.Stretch = Stretch.UniformToFill;
                 source = null;
             }));
         }
         counter = 1200;
     }
 }
        private void Bt_Click(object sender, RoutedEventArgs e)
        {
            int        tag  = (int)((Button)(sender)).Tag;
            VZ_AppInfo info = VZ_AppHelper.GetInstance().appList[tag];

            if (info.appId.Equals("1"))
            {
                showMovieOpeningWin();
                VZ_AppProcessHelper.getSingleton().runApp(info);
                //VZ_AppHelper.getSingleton().sendAppLog(info);
                return;
            }
            //VZ_AppProcessHelper.getSingleton().runApp(info);

            //VZ_AppHelper.getSingleton().sendAppLog(info);
            //if(info.type.Equals("game"))
            //{
            //    this.Activate();
            //}
            //showNoticeAync();

            if (gameInfoUC != null)
            {
                gameInfoUC = null;
            }
            Dispatcher.BeginInvoke((Action)(() =>
            {
                gameInfoUC = new VZ_GameInfoUC(info, this);
                Grid.SetRowSpan(gameInfoUC, 2);
                Grid.SetRow(gameInfoUC, 2);
                mainGrid.Children.Add(gameInfoUC);
                grid3.Visibility = Visibility.Hidden;
                vpp.Visibility = Visibility.Hidden;
                VZ_AppProcessHelper.getSingleton().muteTopVideo(true);
            }));
        }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     VZ_AppProcessHelper.getSingleton().closeTopVideo();
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     VZ_AppProcessHelper.getSingleton().runTopVideo();
 }
Exemple #17
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     VZ_AppProcessHelper.getSingleton().closeAllApp();
     VZ_AppProcessHelper.getSingleton().closeTopVideo();
 }
 public void onQuit(VZ_GameInfoUC view, VZ_AppInfo info)
 {
     VZ_AppProcessHelper.getSingleton().closeAllApp();
     view.setGameIsPlaying(false);
 }
        private void SecondTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            Dispatcher.BeginInvoke((Action)(() =>
            {
                tbTime.Text = string.Format("{0:t}", DateTime.Now);
                tbGameTime.Text = getRemainTime();
            }));

            if ((VZ_AppHelper.GetInstance().payInfo.expire < VZ_AppHelper.GetInstance().payInfo.current_time) && !(VZ_AppHelper.GetInstance().systemInfo.isDebug))
            {
                Dispatcher.BeginInvoke((Action)(() =>
                {
                    secondTimer.Stop();
                    secondTimer = null;
                    VZ_AppProcessHelper.getSingleton().closeAllApp();
                    EnterV3Window win = new EnterV3Window();
                    win.Show();
                    VZ_FinishV2Window win2 = new VZ_FinishV2Window();
                    win2.Show();
                    //EnterV2Window win = new EnterV2Window();
                    //win.Show();
                    //VZ_FinishWindow win2 = new VZ_FinishWindow();
                    //win2.Show();
                    this.Close();
                }));
            }

            VZ_AppProcessHelper.getSingleton().checkRunStateApp();

            VZ_AppInfo gameInfo = VZ_AppProcessHelper.getSingleton().getCurrentGame();

            Dispatcher.BeginInvoke((Action)(() =>
            {
                if (gameInfoUC != null)
                {
                    VZ_AppProcessHelper.getSingleton().muteTopVideo(true);
                }

                if (gameInfo == null)
                {
                    playGameImg.Source = null;
                    tbState.Text = "准备就绪";
                    quitBt.Visibility = Visibility.Hidden;
                    gameTopImg.Source = null;
                    tbGame.Text = "";

                    foreach (Grid grid in gameGrid)
                    {
                        Image img = grid.FindChild <Image>("img_cover");
                        if (img != null)
                        {
                            img.Visibility = Visibility.Hidden;
                        }
                    }
                    VZ_AppProcessHelper.getSingleton().runTopVideo();
                }
                else
                {
                    BitmapSource bmp = getGameImg(gameInfo.appImgPath);
                    playGameImg.Source = bmp;
                    tbState.Text = "游戏中";
                    gameTopImg.Source = getGameCropImg(gameInfo.appImgPath);
                    quitBt.Visibility = Visibility.Visible;
                    tbGame.Text = gameInfo.appName;

                    foreach (Grid grid in gameGrid)
                    {
                        Image img = grid.FindChild <Image>("img_cover");
                        if (grid.Tag == gameInfo)
                        {
                            if (img != null)
                            {
                                img.Visibility = Visibility.Visible;
                            }
                        }
                        else
                        {
                            if (img != null)
                            {
                                img.Visibility = Visibility.Hidden;
                            }
                        }
                    }
                    VZ_AppProcessHelper.getSingleton().hideTopVideo();
                }
            }));
        }