public static void RestartApp(MainWindow parentWindow, string appName) { CustomMessageWindow customMessageWindow1 = new CustomMessageWindow(); customMessageWindow1.Owner = (Window)parentWindow; CustomMessageWindow customMessageWindow2 = customMessageWindow1; string path1 = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_RESTART", ""), (object)appName); BlueStacksUIBinding.Bind(customMessageWindow2.TitleTextBlock, path1, ""); string path2 = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_SETTING_CHANGED_RESTART_APP_MESSAGE", ""), (object)appName); BlueStacksUIBinding.Bind(customMessageWindow2.BodyTextBlock, path2, ""); customMessageWindow2.AddButton(ButtonColors.Blue, "STRING_RESTART_NOW", (EventHandler)((o, e) => { if (MainWindow.SettingsWindow.ParentWindow == parentWindow) { BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)MainWindow.SettingsWindow); } Thread thread = new Thread((ThreadStart)(() => parentWindow.mTopBar.mAppTabButtons.RestartTab(parentWindow.StaticComponents.mSelectedTabButton.PackageName))); thread.IsBackground = true; Logger.Info("Restarting Game Tab."); thread.Start(); }), (string)null, false, (object)null, true); customMessageWindow2.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow2.ShowDialog(); }
private void DiskCleanupBtn_Click(object sender, RoutedEventArgs e) { this.ParentWindow.Dispatcher.Invoke((Delegate)(() => { if (ProcessUtils.IsAlreadyRunning("Global\\BlueStacks_DiskCompactor_Lockbgp")) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.ImageName = "disk_cleanup_popup_window"; customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MULTIPLE_RUN_HEADING", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MULTIPLE_RUN_MESSAGE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.ImageName = "disk_cleanup_popup_window"; customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP", ""); customMessageWindow.BodyTextBlockTitle.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MESSAGE", ""); customMessageWindow.BodyTextBlockTitle.Visibility = Visibility.Visible; customMessageWindow.BodyTextBlockTitle.FontWeight = FontWeights.Regular; customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_CONTINUE_CONFIRMATION", ""); customMessageWindow.AddButton(ButtonColors.White, "STRING_CLOSE", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CONTINUE", (EventHandler)((sender1, e1) => this.LaunchDiskCompaction(sender, (MouseButtonEventArgs)null)), (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); } })); }
public static void ShowWarningMsg( string message, string captionTitle, ProgressWindow progress, EventHandler ContinueBtnhandler) { Logger.Info("Showing Warning Message prompt"); if (!App.sOpt.s) { progress.Dispatcher.Invoke((Delegate)(() => { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString(captionTitle, ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString(message, ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CONTINUE", ContinueBtnhandler, (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", new EventHandler(DataManagerUtils.DataManagerUtils_CancelBtnHandler), (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle(new EventHandler(DataManagerUtils.DataManagerUtils_CancelBtnHandler), (object)null); customMessageWindow.Owner = (Window)progress; customMessageWindow.ShowDialog(); })); } else { ContinueBtnhandler((object)null, (EventArgs)null); } }
private void UnifyButton_Click(object sender, RoutedEventArgs e1) { if (this.mOriginalMacroRecording == null) { this.mOriginalMacroRecording = new MacroRecording(); } this.mOriginalMacroRecording.CopyFrom(this.MergedMacroRecording); CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_UNIFY_0", ""), (object)this.mOriginalMacroRecording.Name); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_UNIFIYING_LOSE_CONFIGURE", ""); bool closeWindow = false; customMessageWindow.AddButton(ButtonColors.Blue, string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_CONTINUE", ""), (object)"").Trim(), (EventHandler)((o, evt) => { ClientStats.SendMiscellaneousStatsAsync("MacroOperations", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, "merge_unify", (string)null, (string)null, (string)null, (string)null, (string)null, "Android"); this.mMacroRecorderWindow.FlattenRecording(this.mOriginalMacroRecording, false); CommonHandlers.SaveMacroJson(this.mOriginalMacroRecording, this.mOriginalMacroRecording.Name + ".json"); CommonHandlers.RefreshAllMacroRecorderWindow(); closeWindow = true; }), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)((o, evt) => ClientStats.SendMiscellaneousStatsAsync("MacroOperations", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, "merge_unify_cancel", (string)null, (string)null, (string)null, (string)null, (string)null, "Android")), (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((EventHandler)((o, e2) => ClientStats.SendMiscellaneousStatsAsync("MacroOperations", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, "merge_unify_cancel", (string)null, (string)null, (string)null, (string)null, (string)null, "Android")), (object)null); customMessageWindow.Owner = (Window)this; customMessageWindow.ShowDialog(); if (!closeWindow) { return; } this.CloseWindow(); }
private void TroubleshootIfPossible(string subCategory) { Logger.Info("In method TroubleshootIfPossible"); if (subCategory.Contains("RPCError")) { Logger.Info("RPC Error detected"); CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RPC_FORM", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_TROUBLESHOOTER", ""); customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_RESOLVE_AUTOMATIC", ""), new EventHandler(this.TroubleshootRPCConfirmationHandler), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this; customMessageWindow.ShowDialog(); } else { if (!subCategory.Contains("StuckOnLoading") && !subCategory.Contains("GreyScreen")) { return; } Logger.Info("Stuck on loading detected"); CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_STUCK_AT_INITIALIZING_FORM", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_TROUBLESHOOTER", ""); customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_RESOLVE_AUTOMATIC", ""), new EventHandler(this.TroubleshootStuckConfirmationHandler), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this; customMessageWindow.ShowDialog(); } }
protected override void Save(object param) { if (Oem.IsOEMDmm) { this.SaveDisplaySetting(); BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this); this.ParentWindow.Close(); } else { if (!this.IsDirty()) { return; } CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTART_BLUESTACKS", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTART_BLUESTACKS_MESSAGE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_RESTART_NOW", (EventHandler)((o, e) => { this.SaveDisplaySetting(); if (BlueStacksUIUtils.DictWindows.Count == 1) { App.defaultResolution = new Fraction((long)RegistryManager.Instance.Guest[Strings.CurrentDefaultVmName].GuestWidth, (long)RegistryManager.Instance.Guest[Strings.CurrentDefaultVmName].GuestHeight); PromotionManager.ReloadPromotionsAsync(); } BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this); BlueStacksUIUtils.RestartInstance(this.VmName, false); }), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_DISCARD_CHANGES", (EventHandler)((o, e) => this.DiscardCurrentChangingModel()), (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } }
protected override void Save(object param) { if (this.Status == Status.Progress) { Logger.Info("Compatibility check is running"); } else if (this.IsRestartRequired()) { if (Oem.IsOEMDmm) { this.RestartInstanceHandler(); this.ParentWindow.Close(); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.Owner = this.Owner; customMessageWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTART_BLUESTACKS", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTART_BLUESTACKS_MESSAGE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_RESTART_NOW", (EventHandler)((o, e) => { this.RestartInstanceHandler(); BlueStacksUIUtils.RestartInstance(this._VmName, false); }), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_DISCARD_CHANGES", (EventHandler)((o, e) => this.Init()), (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } } else { this.SaveEngineSettings(""); this.AddToastPopupUserControl(LocaleStrings.GetLocalizedString("STRING_CHANGES_SAVED", "")); } }
internal void DownloadAndInstallApp( string iconUrl, string appName, string apkUrl, string packageName, bool isLaunchAfterInstall, bool isDeleteApk, string timestamp = "") { if (this.ParentWindow.mWelcomeTab.mHomeAppManager.GetAppIcon(packageName) != null && !this.ParentWindow.mWelcomeTab.mHomeAppManager.GetAppIcon(packageName).IsAppSuggestionActive) { if (this.ParentWindow.mAppHandler.IsAppInstalled(packageName)) { if (!string.IsNullOrEmpty(timestamp)) { bool flag = true; DateTime dateTime1 = DateTime.Parse(timestamp, (IFormatProvider)CultureInfo.InvariantCulture); DateTime maxValue = DateTime.MaxValue; if (this.ParentWindow.mAppHandler.CdnAppdict.ContainsKey(packageName)) { DateTime dateTime2 = this.ParentWindow.mAppHandler.CdnAppdict[packageName]; if (dateTime1 <= dateTime2) { flag = false; } } if (flag) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_INSTALL_UPDATE", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_APP_UPGRADE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_UPGRADE_TEXT", (EventHandler)((sender1, e1) => this.DownloadApk(iconUrl, appName, apkUrl, packageName, isLaunchAfterInstall, isDeleteApk, timestamp)), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CONTINUE_ANYWAY", (EventHandler)((sender1, e1) => this.ParentWindow.mAppHandler.SendRunAppRequestAsync(packageName, "", false)), (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); } else { this.ParentWindow.mAppHandler.SendRunAppRequestAsync(packageName, "", false); } } else { this.ParentWindow.mAppHandler.SendRunAppRequestAsync(packageName, "", false); } } else { this.ParentWindow.mTopBar.mAppTabButtons.GoToTab("Home", true, false); } } else { this.DownloadApk(iconUrl, appName, apkUrl, packageName, isLaunchAfterInstall, isDeleteApk, timestamp); } }
private void BackupBtn_Click(object sender, RoutedEventArgs e) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.ImageName = "backup_restore_popup_window"; BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_BACKUP_WARNING", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_BLUESTACKS_BACKUP_PROMPT", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_BACKUP", (EventHandler)((sender1, e1) => this.LaunchDataManager("backup")), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); }
private void UninstallButtonClicked() { try { if (this.mAppIconModel.IsDownloading) { if (this.mDownloader == null) { return; } this.mDownloader.AbortApkDownload(this.mAppIconModel.PackageName); this.ParentWindow.mWelcomeTab.mHomeAppManager.RemoveAppIcon(this.mAppIconModel.PackageName, (AppIconModel)null); } else if (this.mAppIconModel.IsInstalling) { if (!this.mAppIconModel.IsInstallingFailed) { return; } this.ParentWindow.mWelcomeTab.mHomeAppManager.RemoveAppIcon(this.mAppIconModel.PackageName, (AppIconModel)null); } else if (this.mAppIconModel.IsAppSuggestionActive) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_REMOVE_ICON", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_ICON_REMOVE", ""); customMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_REMOVE", ""), new EventHandler(this.RemoveAppSuggestion), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_KEEP", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_UNINSTALL_0", ""), (object)this.mAppIconModel.AppName); customMessageWindow.BodyTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_UNINSTALL_0_BS", ""), (object)this.mAppIconModel.AppName); customMessageWindow.AddButton(ButtonColors.Red, "STRING_UNINSTALL", (EventHandler)((o, e) => this.AppIcon_UninstallConfirmationClicked(o, e)), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_NO", (EventHandler)null, (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); } } catch (Exception ex) { Logger.Error("Exception in UninstallButtonClicked. Err : " + ex.ToString()); } }
private void PlayScriptImg_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (!this.ParentWindow.mIsMacroPlaying) { if (MacroGraph.CheckIfDependentMacrosAreAvailable(this.mRecording)) { this.ToggleScriptPlayPauseUi(true); this.ParentWindow.mCommonHandler.PlayMacroScript(this.mRecording); ClientStats.SendMiscellaneousStatsAsync("MacroOperations", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, "macro_play", "macro_popup", this.mRecording.RecordingType.ToString(), string.IsNullOrEmpty(this.mRecording.MacroId) ? "local" : "community", (string)null, (string)null, "Android"); this.ParentWindow.mCommonHandler.HideMacroRecorderWindow(); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.Owner = (Window)this.mMacroRecorderWindow; BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_ERROR_IN_MERGE_MACRO", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)((o, evt) => {}), (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } } else { this.ParentWindow.mCommonHandler.AddToastPopup((Window)this.mMacroRecorderWindow, LocaleStrings.GetLocalizedString("STRING_STOP_THE_SCRIPT", ""), 4.0, true); } }
private void RunBinary(string fileName, string args, string text, string title) { try { Logger.Info("In method RunBinary"); string str = Path.Combine(RegistryStrings.InstallDir, fileName); using (Process process = new Process()) { process.StartInfo.FileName = str; process.StartInfo.Arguments = args; process.EnableRaisingEvents = true; process.Disposed += (EventHandler)((sender, e) => this.Dispatcher.Invoke((Delegate)(() => { this.Visibility = Visibility.Hidden; this.ShowInTaskbar = false; if (!Oem.Instance.IsHideMessageBoxIconInTaskBar) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = title; customMessageWindow.BodyTextBlock.Text = text; customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_OK", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } this.Close(); }))); process.Start(); } } catch (Exception ex) { Logger.Error("Error occured, Err: {0}", (object)ex.ToString()); } }
private void RevertBtnClick(object sender, RoutedEventArgs e) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTORE_DEFAULTS", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTORE_SHORTCUTS", ""); customMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_RESTORE_BUTTON", ""), (EventHandler)((o, evt) => { this.RestoreDefaultShortcuts(); this.mRevertBtn.IsEnabled = false; }), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)((o, evt) => {}), (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); if (!this.CheckForSupportedVersion()) { if (!App.sOpt.s) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_UNSUPPORTED_VERSION", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_VERSION_NOT_SUPPORTED", ""); customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_EXIT", ""), (EventHandler)((o, args) => App.ExitApplication(-1)), (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((EventHandler)((o, args) => App.ExitApplication(-1)), (object)null); customMessageWindow.ShowDialog(); } else { App.ExitApplication(-1); } } else { MainWindow mainWindow = new MainWindow(); if (!App.sOpt.s) { mainWindow.Show(); } else { Stats.SendMiscellaneousStatsAsync("DiskCompactionStats", "DiskCompaction Started", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, App.sOpt.vmname, App.sOpt.relaunch.ToString(), App.sOpt.s.ToString(), (string)null, "Android", 0); DiskCompactionHelper.Instance.StartCompaction(); } } }
private static void CheckIfAlreadyRunning() { if (!ProcessUtils.CheckAlreadyRunningAndTakeLock("Global\\BlueStacks_Log_Collector_Lockbgp", out App.sLogCollectorLock)) { return; } bool flag = false; Logger.Info("LogCollector already running."); if (App.sOpt.Boot || App.sOpt.Apk || (App.sOpt.D || App.sOpt.Thin) || (App.sOpt.Silent || App.sOpt.Hidden)) { flag = true; } if (!flag) { IntPtr window = InteropWindow.FindWindow((string)null, LocaleStrings.GetLocalizedString("STRING_BST_SUPPORT_UTILITY", "")); if (window != IntPtr.Zero) { InteropWindow.SetForegroundWindow(window); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_BST_SUPPORT_UTILITY", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_LOGCOLLECTOR_RUNNING", ""); customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_OK", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } } App.KillApplication(); }
private void CancelDownloadConfirmation(object sender, EventArgs e) { MainWindow mainWindow = (MainWindow)null; if (BlueStacksUIUtils.DictWindows.Count > 0) { mainWindow = BlueStacksUIUtils.DictWindows.Values.First <MainWindow>(); } CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_DOWNLOAD_IN_PROGRESS", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_BTV_DOWNLOAD_CANCEL", ""); customMessageWindow.AddButton(ButtonColors.Red, "STRING_CANCEL", new EventHandler(this.CancelBTvDownload), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CONTINUE", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)mainWindow; customMessageWindow.ShowDialog(); }
private static void Downloader_DownloadException(Exception e) { Logger.Error("Failed to download file: {0}. err: {1}", (object)BlueStacksUpdater.sBstUpdateData.DownloadUrl, (object)e.Message); BlueStacksUpdater.ParentWindow.Dispatcher.Invoke((Delegate)(() => { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_UPGRADE_FAILED", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_SOME_ERROR_OCCURED_DOWNLOAD", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_RETRY", new EventHandler(BlueStacksUpdater.RetryDownload), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", new EventHandler(BlueStacksUpdater.DownloadCancelled), (string)null, false, (object)null, true); BlueStacksUpdater.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)BlueStacksUpdater.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); BlueStacksUpdater.ParentWindow.HideDimOverlay(); BlueStacksUpdater.sUpdateDownloadProgress.Hide(); })); }
private void HandleRerollClick() { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_REROLL_0", ""), (object)this.mAppIconModel.AppName); customMessageWindow.BodyTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_START_REROLL", ""), (object)this.mAppIconModel.AppName); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_REROLL_APP_PREFIX", new EventHandler(this.StartRerollAccepted), (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); if (customMessageWindow.ClickedButton == ButtonColors.White) { return; } this.ParentWindow.HideDimOverlay(); }
private void SetDefaultGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (!File.Exists(HomeAppManager.BackgroundImagePath)) { return; } CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_LBL_RESTORE_DEFAULT", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_RESTORE_DEFAULT_WALLPAPER", ""); customMessageWindow.AddButton(ButtonColors.Red, "STRING_RESTORE_BUTTON", this.RestoreDefaultConfirmationClicked, (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); }
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(); }
private void mUpgradeToFullBlueStacks_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { string localizedString = LocaleStrings.GetLocalizedString("STRING_UPGRADE_TO_STANDARD_BST", ""); string str = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0} {1}", (object)LocaleStrings.GetLocalizedString("STRING_CONTINUING_WILL_UPGRADE_TO_STD_BST", ""), (object)LocaleStrings.GetLocalizedString("STRING_LAUNCH_BLUESTACKS_FROM_DESK_SHORTCUT", "")); string path1 = localizedString.Replace(GameConfig.Instance.AppName, "BlueStacks"); string path2 = str.Replace(GameConfig.Instance.AppName, "BlueStacks"); CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_YES", new EventHandler(this.UpgradeToFullBstHandler), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_NO", (EventHandler)null, (string)null, false, (object)null, true); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, path1, ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, path2, ""); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); ClientStats.SendMiscellaneousStatsAsync("hamburgerMenu", RegistryManager.Instance.UserGuid, "UpgradeBlueStacks", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android"); }
private void LogoutButtonGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Logger.Info("Clicked logout button"); if (!this.ParentWindow.mGuestBootCompleted) { return; } CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_LOGOUT_BLUESTACKS3", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_REMOVE_GOOGLE_ACCOUNT", ""); customMessageWindow.AddButton(ButtonColors.Red, "STRING_LOGOUT_BUTTON", this.LogoutConfirmationResetAccountAcceptedHandler, (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); ClientStats.SendMiscellaneousStatsAsync("hamburgerMenu", RegistryManager.Instance.UserGuid, "Logout", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android"); }
private void UninstallStart_Click(object sender, RoutedEventArgs e) { if (UninstallerProperties.IsRunningInSilentMode || Oem.IsOEMDmm || RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition) { this.UninstallConfirmationAcceptedHandler((object)null, (EventArgs)null); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_UNINSTALL_TITLE", "Uninstall " + Strings.ProductDisplayName); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_UNINSTALL_BLUESTACKS", "Would you like to uninstall " + Strings.ProductDisplayName + "?"); customMessageWindow.AddButton(ButtonColors.Red, "STRING_UNINSTALL", new EventHandler(this.UninstallConfirmationAcceptedHandler), (string)null, false, (object)null, true); customMessageWindow.AddButton((ButtonColors)Enum.Parse(typeof(ButtonColors), Strings.UninstallCancelBtnColor), "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true); if (Oem.Instance.IsBackupWarningVisible) { customMessageWindow.BodyWarningTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_UNINSTALL_BLUESTACKS_WARNING", "Your data will be lost. Go to Settings > Backup & restore to backup your data."); customMessageWindow.BodyWarningTextBlock.Visibility = Visibility.Visible; } customMessageWindow.Owner = (Window)this; customMessageWindow.ShowDialog(); } }
private void OpenGameGuide(object obj) { if (KMManager.sGuidanceWindow != null && KMManager.sGuidanceWindow.Visibility == Visibility.Visible) { KMManager.sGuidanceWindow.Highlight(); } else if (this.IsDirty()) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.Owner = (Window)this.mParentWindow; customMessageWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_DISCARD_CHANGES", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_SETTING_CLOSE_MESSAGE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_NO", (EventHandler)((o, e) => {}), (string)null, false, (object)null, true); customMessageWindow.AddButton(ButtonColors.White, "STRING_DISCARD_CHANGES", (EventHandler)((o, e) => this.OpenGameGuide()), (string)null, false, (object)null, true); customMessageWindow.ShowDialog(); } else { this.OpenGameGuide(); } }
internal void Init( string args, string appName, PlayStoreAction action, bool isWindowForcedTillLoaded = false) { this.Dispatcher.Invoke((Delegate)(() => { if (!this.ParentWindow.mGuestBootCompleted) { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_POST_OTS_SYNCING_BUTTON_MESSAGE", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_GUEST_NOT_BOOTED", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); } else if (action == PlayStoreAction.OpenApp && this.ParentWindow.mAppHandler.IsAppInstalled(args) && !"com.android.vending".Equals(args, StringComparison.InvariantCultureIgnoreCase)) { AppIconModel appIcon = this.ParentWindow.mWelcomeTab.mHomeAppManager.GetAppIcon(args); if (appIcon == null) { return; } if (appIcon.AppIncompatType != AppIncompatType.None && !this.ParentWindow.mTopBar.mAppTabButtons.mDictTabs.ContainsKey(appIcon.PackageName)) { GrmHandler.HandleCompatibility(appIcon.PackageName, this.ParentWindow.mVmName); } else { this.ParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, true, true, false); } } else { if (string.IsNullOrEmpty(args)) { return; } if (!this.ParentWindow.WelcomeTabParentGrid.IsVisible) { this.ParentWindow.mCommonHandler.HomeButtonHandler(false, false); } this.mBaseControl.mTitleLabel.Content = (object)appName; this.mAction = action; this.Visibility = Visibility.Visible; this.ParentWindow.ChangeOrientationFromClient(false, false); this.ProcessArgs(args, isWindowForcedTillLoaded); } })); }
private static void GrmExceptionMessageBox(MainWindow ParentWindow) { ParentWindow.Dispatcher.Invoke((Delegate)(() => { ParentWindow.mFrontendGrid.Visibility = Visibility.Visible; ParentWindow.mExitProgressGrid.Visibility = Visibility.Hidden; CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_ERROR", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_GRM_EXCEPTION_MESSAGE", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)ParentWindow; ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.ShowDialog(); ParentWindow.HideDimOverlay(); })); }
internal void ShowPromptAndHideOverlay() { if (this.Visibility != Visibility.Visible) { return; } CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_REROLL_COMPLETED", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_REROLL_COMPLETED_SUCCESS", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay; customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); this.HideOverlay(); }
private void SubmitButton_Click(object sender, RoutedEventArgs e) { try { if (!this.TestEmail(this.txtEmail.Text) || !this.TestPhone(this.txtPhone.Text)) { return; } ClientStats.SendMiscellaneousStatsAsync("OTSFeedback", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, this.txtDescIssue.Text, this.txtEmail.Text, this.txtPhone.Text, (string)null, (string)null, (string)null, "Android"); new Thread((ThreadStart)(() => { try { new Process() { StartInfo = { Arguments = "-silent", FileName = Path.Combine(RegistryStrings.InstallDir, "HD-LogCollector.exe") } }.Start(); } catch (Exception ex) { Logger.Error("Exception in starting HD-logCollector.exe: " + ex.ToString()); } })) { IsBackground = true }.Start(); BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this); CustomMessageWindow customMessageWindow = new CustomMessageWindow(); customMessageWindow.ImageName = "help"; customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_THANK_YOU", ""); customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_APPRECIATE_FEEDBACK", ""); customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_CLOSE", ""), (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null); customMessageWindow.ShowDialog(); this.ParentWindow.HideDimOverlay(); } catch (Exception ex) { Logger.Error("Exception in Submitting ots feedback " + ex.ToString()); } }
private static void CheckIfAlreadyRunning() { try { if (ProcessUtils.IsAlreadyRunning("Global\\BlueStacks_DiskCompactor_Lockbgp")) { Logger.Info("Disk compaction is running in background"); foreach (string str in GetProcessExecutionPath.GetApplicationPath(Process.GetProcessesByName("DiskCompactionTool"))) { if (str.Equals(Path.Combine(RegistryStrings.InstallDir, "DiskCompactionTool.exe"), StringComparison.InvariantCultureIgnoreCase)) { CustomMessageWindow customMessageWindow = new CustomMessageWindow() { ImageName = "ProductLogo" }; customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}", (object)LocaleStrings.GetLocalizedString("STRING_EXIT_BLUESTACKS_DUE_TO_DISK_COMPACTION_HEADING", "")); customMessageWindow.BodyTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}", (object)LocaleStrings.GetLocalizedString("STRING_EXIT_BLUESTACKS_DUE_TO_DISK_COMPACTION_MESSAGE", "")); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null); customMessageWindow.ShowDialog(); Logger.Info("Disk compaction running for this instance. Exiting this instance"); App.ExitApplication(); } } } } catch (Exception ex) { Logger.Error("Failed to check if disk compaction is running: " + ex.Message); } string runningProcName; if (ProcessUtils.IsAnyInstallerProcesRunning(out runningProcName) && !string.IsNullOrEmpty(runningProcName)) { Logger.Info(runningProcName + " process is running. Exiting BlueStacks MultiInstance Manager"); Environment.Exit(-1); } if (!ProcessUtils.CheckAlreadyRunningAndTakeLock("Global\\BlueStacks_MultiInstanceManager_Lockbgp", out App.sMultiInstanceManagerLock)) { return; } Utils.BringToFront("BlueStacks Multi-Instance Manager"); App.ExitApplication(); }
private void GridElement_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (this.ParentWindow.mIsMacroRecorderActive) { return; } string macroFileName = (string)(sender as Grid).Tag; MacroRecording record = MacroGraph.Instance.Vertices.Cast <MacroRecording>().Where <MacroRecording>((Func <MacroRecording, bool>)(macro => string.Equals(macro.Name, macroFileName, StringComparison.InvariantCultureIgnoreCase))).FirstOrDefault <MacroRecording>(); if (record == null) { this.mMainStackPanel.Children.Remove((UIElement)(sender as Grid)); } else { try { if (!this.ParentWindow.mIsMacroPlaying) { this.ParentWindow.mCommonHandler.FullMacroScriptPlayHandler(record); ClientStats.SendMiscellaneousStatsAsync("MacroOperations", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, "macro_play", "bookmark", record.RecordingType.ToString(), string.IsNullOrEmpty(record.MacroId) ? "local" : "community", (string)null, (string)null, "Android"); } else { CustomMessageWindow customMessageWindow = new CustomMessageWindow(); BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_CANNOT_RUN_MACRO", ""); BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_STOP_MACRO_SCRIPT", ""); customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true); customMessageWindow.Owner = (Window)this.ParentWindow; customMessageWindow.ShowDialog(); } if (this.ParentWindow.mSidebar == null) { return; } this.ParentWindow.mSidebar.mMacroButtonPopup.IsOpen = false; this.ParentWindow.mSidebar.ToggleSidebarVisibilityInFullscreen(false); } catch (Exception ex) { int num = (int)MessageBox.Show(ex.ToString()); } } }