private void QAE_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                switch (this.mCallToAction)
                {
                case QuitActionItemCTA.OpenLinkInBrowser:
                    if (!string.IsNullOrEmpty(this.mQuitActionValue))
                    {
                        BlueStacksUIUtils.OpenUrl(this.mQuitActionValue);
                    }
                    this.SendCTAStat();
                    break;

                case QuitActionItemCTA.OpenAppCenter:
                    this.OpenAppCenter();
                    this.ParentQuitPopup.Close();
                    this.SendCTAStat();
                    break;

                case QuitActionItemCTA.OpenApplication:
                    if (!string.IsNullOrEmpty(this.mQuitActionValue))
                    {
                        Process.Start(this.mQuitActionValue);
                    }
                    this.SendCTAStat();
                    break;
                }
            }
            catch (Exception ex)
            {
                Logger.Info("Some error while CallToAction of QuitPopup. Ex: {0}", (object)ex);
            }
        }
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try
     {
         Logger.Info("Opening url: " + e.Uri.AbsoluteUri);
         BlueStacksUIUtils.OpenUrl(e.Uri.AbsoluteUri);
         e.Handled = true;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in opening url" + ex.ToString());
     }
 }
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try
     {
         Logger.Info("Opening url: " + e.Uri.AbsoluteUri);
         this.mCanvasElement.SendMOBAStats("read_more_clicked", "");
         BlueStacksUIUtils.OpenUrl(e.Uri.AbsoluteUri);
         e.Handled = true;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in opening url" + ex.ToString());
     }
 }
Example #4
0
        private void mHelpCenterGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            string helpCenterUrl = BlueStacksUIUtils.GetHelpCenterUrl();

            this.ParentWindow.mTopBar.mSettingsMenuPopup.IsOpen = false;
            ClientStats.SendMiscellaneousStatsAsync("hamburgerMenu", RegistryManager.Instance.UserGuid, "HelpCentre", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android");
            if (RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition)
            {
                BlueStacksUIUtils.OpenUrl(helpCenterUrl);
            }
            else
            {
                this.ParentWindow.mTopBar.mAppTabButtons.AddWebTab(helpCenterUrl, "STRING_FEEDBACK", "help_center", true, "FEEDBACK_TEXT", false);
            }
        }
 public void ShowWebPageInBrowser(string url)
 {
     Logger.Info("Showing " + url + " in default browser");
     BlueStacksUIUtils.OpenUrl(url);
 }
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     BlueStacksUIUtils.OpenUrl(e.Uri.OriginalString);
     e.Handled = true;
 }
        internal void StartFrontend()
        {
            ThreadPool.QueueUserWorkItem((WaitCallback)(obj =>
            {
                Logger.Info("BOOT_STAGE: Starting player");
                if (ProcessUtils.IsLockInUse(Strings.GetPlayerLockName(this.mVmName, "bgp")))
                {
                    this.KillFrontend(true);
                }
                this.mEventOnFrontendClosed = (EventHandler)null;
                this.mIsSufficientRAMAvailable = true;
                this.IsRestartFrontendWhenClosed = true;
                this.mFrontendStartTime = DateTime.Now;
                int num = BluestacksProcessHelper.StartFrontend(this.mVmName);
                if (this.ParentWindow == null)
                {
                    this.WaitForParentWindowInit();
                }
                if (this.ParentWindow != null)
                {
                    switch (num)
                    {
                    case -10:
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            string url = (string)null;
                            url = WebHelper.GetUrlWithParams(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}/{1}", (object)WebHelper.GetServerHost(), (object)"help_articles"), (string)null, (string)null, (string)null);
                            url = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}&article={1}", (object)url, (object)"enable_virtualization");
                            string path = "STRING_VTX_DISABLED_ENABLEIT_BODY";
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_RESTART_UTILITY_CANNOT_START", "");
                            customMessageWindow.AddAboveBodyWarning(LocaleStrings.GetLocalizedString("STRING_VTX_DISABLED_WARNING", ""));
                            customMessageWindow.AboveBodyWarningTextBlock.Visibility = Visibility.Visible;
                            customMessageWindow.MessageIcon.VerticalAlignment = VerticalAlignment.Center;
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, path, "");
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CHECK_FAQ", (EventHandler)((sender1, e1) => BlueStacksUIUtils.OpenUrl(url)), (string)null, false, (object)null, true);
                            customMessageWindow.AddButton(ButtonColors.White, "STRING_EXIT", (EventHandler)null, (string)null, false, (object)null, true);
                            customMessageWindow.ShowDialog();
                            App.ExitApplication();
                        }));
                        break;

                    case -7:
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            Logger.Error("VBox couldn't detect driver");
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_ENGINE_FAIL_HEADER", "");
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_COULDNT_BOOT_TRY_RESTART", "");
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_RESTART_PC", new EventHandler(this.RestartPCEvent), (string)null, false, (object)null, true);
                            customMessageWindow.AddButton(ButtonColors.White, "STRING_EXIT", (EventHandler)null, (string)null, false, (object)null, true);
                            customMessageWindow.ShowDialog();
                            App.ExitApplication();
                        }));
                        break;

                    case -6:
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            Logger.Error("Unable to initialise audio on this machine");
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                            customMessageWindow.ImageName = "sound_error";
                            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_AUDIO_SERVICE_FAILURE", "");
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlockTitle, "STRING_AUDIO_SERVICE_FAILUE_FIX", "");
                            customMessageWindow.BodyTextBlockTitle.Visibility = Visibility.Visible;
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_AUDIO_SERVICE_FAILURE_ALTERNATE_FIX", "");
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_READ_MORE", (EventHandler)((sender1, e1) => BlueStacksUIUtils.OpenUrl(WebHelper.GetUrlWithParams(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}/{1}", (object)WebHelper.GetServerHost(), (object)"help_articles"), (string)null, (string)null, (string)null) + "&article=audio_service_issue")), "external_link", true, (object)null, true);
                            customMessageWindow.ShowDialog();
                            App.ExitApplication();
                        }));
                        break;

                    case -5:
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            Logger.Error("Hyper v enabled on this machine");
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_RESTART_UTILITY_CANNOT_START", "");
                            customMessageWindow.AddWarning(LocaleStrings.GetLocalizedString("STRING_HYPERV_ENABLED_WARNING", ""), "message_error");
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_HYPERV_ENABLED_MESSAGE", "");
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CHECK_FAQ", (EventHandler)((sender1, e1) => BlueStacksUIUtils.OpenUrl(WebHelper.GetUrlWithParams(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}/{1}", (object)WebHelper.GetServerHost(), (object)"help_articles"), (string)null, (string)null, (string)null) + "&article=disable_hypervisor")), (string)null, false, (object)null, true);
                            customMessageWindow.ShowDialog();
                            App.ExitApplication();
                        }));
                        break;

                    case -2:
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            Logger.Error("Android File Integrity check failed");
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_CORRUPT_INSTALLATION", "");
                            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_CORRUPT_INSTALLATION_MESSAGE", "");
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_EXIT", (EventHandler)null, (string)null, false, (object)null, true);
                            customMessageWindow.ShowDialog();
                            App.ExitApplication();
                        }));
                        break;

                    default:
                        if (!this.IsRestartFrontendWhenClosed)
                        {
                            break;
                        }
                        this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
                        {
                            if (this.frontendRestartAttempts >= 2)
                            {
                                return;
                            }
                            ++this.frontendRestartAttempts;
                            this.ParentWindow.RestartFrontend();
                        }));
                        break;
                    }
                }
                else
                {
                    Logger.Error("parent window is null for vmName: {0} and frontend Exit code: {1}", (object)this.mVmName, (object)num);
                }
            }));
        }