internal void FrontendHandler_ShowLowRAMMessage() { if (!this.ParentWindow?.IsLoaded.GetValueOrDefault()) { return; } CustomMessageWindow cmw = new CustomMessageWindow(); cmw.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_PERF_WARNING", ""); cmw.AddWarning(LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TITLE", ""), "message_error"); cmw.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TEXT1", "") + Environment.NewLine + LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TEXT2", ""); cmw.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_CONTINUE_ANYWAY", ""), (EventHandler)((o, args) => cmw.Close()), (string)null, false, (object)null, true); cmw.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CLOSE_BLUESTACKS", ""), (EventHandler)((o, args) => this.ParentWindow.Close()), (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); cmw.Owner = (Window)this.ParentWindow.mDimOverlay; cmw.ShowDialog(); this.ParentWindow.HideDimOverlay(); }
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); } })); }