private void CreateAllButtons(string mstartUpTab) { foreach (string settingsControlName in this.SettingsControlNameList) { CustomSettingsButton customSettingsButton1 = new CustomSettingsButton(); customSettingsButton1.Name = settingsControlName; customSettingsButton1.Group = "Settings"; CustomSettingsButton customSettingsButton2 = customSettingsButton1; TextBlock tb = new TextBlock() { FontSize = 16.0, TextWrapping = TextWrapping.Wrap }; BlueStacksUIBinding.Bind(tb, settingsControlName, ""); customSettingsButton2.Content = (object)tb; customSettingsButton2.MinHeight = 40.0; customSettingsButton2.FontWeight = FontWeights.SemiBold; customSettingsButton2.IsTabStop = false; customSettingsButton2.FocusVisualStyle = (Style)null; customSettingsButton2.IsEnabled = false; customSettingsButton2.PreviewMouseDown += new MouseButtonEventHandler(this.ValidateAndSwitchTab); this.SettingsWindowStackPanel.Children.Add((UIElement)customSettingsButton2); if (mstartUpTab == settingsControlName) { customSettingsButton2.IsEnabled = true; customSettingsButton2.IsSelected = true; } } }
internal static void DownloadNow(BlueStacksUpdateData bstUpdateData, bool hiddenMode) { new Thread((ThreadStart)(() => { BlueStacksUpdater.IsDownloadingInHiddenMode = hiddenMode; BlueStacksUpdater.SUpdateState = BlueStacksUpdater.UpdateState.DOWNLOADING; if (System.IO.File.Exists(bstUpdateData.UpdateDownloadLocation)) { BlueStacksUpdater.DownloadComplete(); } else { BlueStacksUpdater.ParentWindow.Dispatcher.Invoke((Delegate)(() => { BlueStacksUIBinding.Bind(BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpgradeBluestacksStatusTextBlock, "STRING_DOWNLOADING_UPDATE", ""); BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpdateDownloadProgressPercentage.Visibility = Visibility.Visible; BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpdateDownloadProgressPercentage.Content = (object)"0%"; BlueStacksUpdater.sUpdateDownloadProgress = new UpdateDownloadProgress(); BlueStacksUpdater.sUpdateDownloadProgress.mUpdateDownloadProgressPercentage.Content = (object)"0%"; BlueStacksUpdater.sUpdateDownloadProgress.Owner = (Window)BlueStacksUpdater.ParentWindow; if (hiddenMode) { return; } BlueStacksUpdater.sUpdateDownloadProgress.Show(); })); BlueStacksUpdater.DownloadUpdate(bstUpdateData); } })) { IsBackground = true }.Start(); }
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 SetContent() { BlueStacksUIBinding.Bind(this.mEnableVt.mTitleText, "STRING_ENABLE_VIRT", ""); BlueStacksUIBinding.Bind(this.mEnableVt.mBodyText, "STRING_ENABLE_VIRT_BODY", ""); this.mEnableVt.mHyperLink.Inlines.Clear(); this.mEnableVt.mHyperLink.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_ENABLE_VIRT_HYPERLINK", "")); this.mEnableVt.mImage.ImageName = "virtualization"; BlueStacksUIBinding.Bind(this.mDiasbleHyperV.mTitleText, "STRING_DISABLE_HYPERV", ""); BlueStacksUIBinding.Bind(this.mDiasbleHyperV.mBodyText, "STRING_DISABLE_HYPERV_BODY", ""); this.mDiasbleHyperV.mHyperLink.Inlines.Clear(); this.mDiasbleHyperV.mHyperLink.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_DISABLE_HYPERV_HYPERLINK", "")); this.mDiasbleHyperV.mImage.ImageName = "hypervisor"; BlueStacksUIBinding.Bind(this.mConfigureAntivirus.mTitleText, "STRING_CONFIGURE_ANTIVIRUS", ""); BlueStacksUIBinding.Bind(this.mConfigureAntivirus.mBodyText, "STRING_CONFIGURE_ANTIVIRUS_BODY", ""); this.mConfigureAntivirus.mHyperLink.Inlines.Clear(); this.mConfigureAntivirus.mHyperLink.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_CONFIGURE_ANTIVIRUS_HYPERLINK", "")); this.mConfigureAntivirus.mImage.ImageName = "antivirus"; BlueStacksUIBinding.Bind(this.mPowerPlan.mTitleText, "STRING_POWER_PLAN", ""); BlueStacksUIBinding.Bind(this.mPowerPlan.mBodyText, "STRING_POWER_PLAN_BODY", ""); this.mPowerPlan.mHyperLink.Inlines.Clear(); this.mPowerPlan.mHyperLink.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_POWER_PLAN_HYPERLINK", "")); this.mPowerPlan.mImage.ImageName = "powerplan"; BlueStacksUIBinding.Bind(this.mUpgradeComputer.mTitleText, "STRING_UPGRADE_SYSTEM", ""); BlueStacksUIBinding.Bind(this.mUpgradeComputer.mBodyText, "STRING_UPGRADE_SYSTEM_BODY", ""); this.mUpgradeComputer.mHyperLink.Inlines.Clear(); this.mUpgradeComputer.mHyperLink.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_UPGRADE_SYSTEM_HYPERLINK", "")); this.mUpgradeComputer.mImage.ImageName = "upgrade"; }
public PromotionControl() { this.InitializeComponent(); this.PromoControl = this; if (DesignerProperties.GetIsInDesignMode((DependencyObject)this.PromoControl)) { return; } if (!string.IsNullOrEmpty(RegistryManager.Instance.PromotionId) || FeatureManager.Instance.IsPromotionFixed) { this.mPromotionImage.ImageName = Path.Combine(RegistryManager.Instance.ClientInstallDir, "Promotions/promotion.jpg"); this.mPromotionImageGrid.Background = (Brush) new SolidColorBrush(Color.FromArgb(byte.MaxValue, (byte)0, (byte)0, (byte)0)); } this.mBootStringIndex = new Random().Next(this.mBootStrings.Count); this.mBootStringTimer.Tick += new EventHandler(this.BootStringTimer_Tick); this.mBootStringTimer.Interval = 3000; BlueStacksUIBinding.Bind(this.BootText, this.mBootStrings[this.mBootStringIndex], ""); int num = RegistryManager.Instance.AvgBootTime / 500; if (num <= 0) { RegistryManager.Instance.AvgBootTime = 20000; RegistryManager.Instance.NoOfBootCompleted = 0; num = 40; } this.progressTimer.Tick += new EventHandler(this.ProgressTimer_Tick); this.progressTimer.Interval = num; this.progressTimer.Start(); if (PromotionObject.Instance == null) { PromotionObject.LoadDataFromFile(); } PromotionObject.BootPromotionHandler += new EventHandler(this.PromotionControl_BootPromotionHandler); }
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 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 mPostOtsButton_Click(object sender, RoutedEventArgs e) { Logger.Info("mPostOtsButton clicked"); if (!this.mSuccess.HasValue) { return; } if (this.mSuccess.Value) { this.loginSyncTimer.Dispose(); BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this); } else { this.Dispatcher.Invoke((Delegate)(() => { this.mPostOtsImage.ImageName = "syncing_ots_icon"; this.mLoadingImage.Visibility = Visibility.Visible; this.mPostOtsWarning.Visibility = Visibility.Collapsed; this.mCloseButton.Visibility = Visibility.Collapsed; BlueStacksUIBinding.Bind(this.mPostOtsLabel, "STRING_POST_OTS_SYNCING_MESSAGE"); BlueStacksUIBinding.Bind((Button)this.mPostOtsButton, "STRING_POST_OTS_SYNCING_BUTTON_MESSAGE"); this.mPostOtsButton.IsEnabled = false; })); this.SendRetryBluestacksLoginRequest(this.ParentWindow.mVmName); } }
private void AddElement(ShortcutKeys ele) { ShortcutKeyControlElement keyControlElement = new ShortcutKeyControlElement(this.ParentWindow, this.ParentSettingsWindow); BlueStacksUIBinding.Bind(keyControlElement.mShortcutNameTextBlock, ele.ShortcutName, ""); string[] strArray = ele.ShortcutKey.Split(new char[2] { '+', ' ' }, StringSplitOptions.RemoveEmptyEntries); string str = string.Empty; foreach (string key in strArray) { str = str + LocaleStrings.GetLocalizedString(Constants.ImapLocaleStringsConstant + IMAPKeys.GetStringForUI(key), "") + " + "; } this.mShortcutUIElements[ele.ShortcutCategory].Item2.Add(keyControlElement); if (!string.IsNullOrEmpty(str)) { keyControlElement.mShortcutKeyTextBox.Text = str.Substring(0, str.Length - 3); } keyControlElement.mUserDefinedConfigList = new List <ShortcutKeys>() { ele }; if (!ele.ReadOnlyTextbox) { return; } keyControlElement.mShortcutKeyTextBox.IsEnabled = false; }
private bool CheckIfEditedMacroNameIsAllowed(string text, ImportMacroScriptsControl item) { if (string.IsNullOrEmpty(text.Trim())) { BlueStacksUIBinding.Bind(item.mWarningMsg, LocaleStrings.GetLocalizedString("STRING_MACRO_NAME_NULL_MESSAGE", ""), ""); return(false); } foreach (MacroRecording vertex in (Collection <BiDirectionalVertex <MacroRecording> >)MacroGraph.Instance.Vertices) { if (vertex.Name.ToLower(CultureInfo.InvariantCulture).Trim() == text.ToLower(CultureInfo.InvariantCulture).Trim()) { return(false); } } foreach (ImportMacroScriptsControl child in this.mScriptsStackPanel.Children) { if (item != child) { bool?isChecked = child.mContent.IsChecked; bool flag = true; if (isChecked.GetValueOrDefault() == flag & isChecked.HasValue && child.IsScriptInRenameMode() && child.mImportName.Text.ToLower(CultureInfo.InvariantCulture).Trim() == text.ToLower(CultureInfo.InvariantCulture).Trim()) { return(false); } } } return(true); }
public NoInternetControl(BrowserControl browserControl) { this.InitializeComponent(); this.AssociatedControl = browserControl; BlueStacksUIBinding.Bind(this.mFailureTextBox, "STRING_NAVIGATE_FAILED", ""); BlueStacksUIBinding.Bind((Button)this.mBlueButton, "STRING_RETRY_CONNECTION_ISSUE_TEXT1"); }
private void IMapTextBox_PreviewMouseWheel(object sender, MouseWheelEventArgs args) { if (args != null && args.Delta != 0 && (this.IMActionItems != null && this.IMActionItems.Any <IMActionItem>())) { foreach (IMActionItem imActionItem in (Collection <IMActionItem>) this.IMActionItems) { if (imActionItem.ActionItem.StartsWith("Key", StringComparison.InvariantCulture)) { this.Tag = args.Delta < 0 ? (object)"MouseWheelDown" : (object)"MouseWheelUp"; this.SetValueHandling(imActionItem); BlueStacksUIBinding.Bind((TextBox)this, Constants.ImapLocaleStringsConstant + IMAPKeys.GetStringForUI(this.Tag.ToString())); } if (this.PropertyType.Equals(typeof(bool))) { bool flag = !Convert.ToBoolean(imActionItem.IMAction[imActionItem.ActionItem], (IFormatProvider)CultureInfo.InvariantCulture); this.Tag = (object)flag; IMapTextBox.Setvalue(imActionItem, flag.ToString((IFormatProvider)CultureInfo.InvariantCulture)); BlueStacksUIBinding.Bind((TextBox)this, Constants.ImapLocaleStringsConstant + this.Tag?.ToString()); args.Handled = true; } } args.Handled = true; } this.SetCaretIndex(); }
private void GenerateOptions(string title, string[] childrenKeys) { TextBlock tb1 = new TextBlock(); BlueStacksUIBinding.Bind(tb1, title, ""); tb1.Padding = new Thickness(0.0); tb1.FontSize = 16.0; tb1.Margin = new Thickness(0.0, 10.0, 0.0, 0.0); BlueStacksUIBinding.BindColor((DependencyObject)tb1, Control.ForegroundProperty, "SettingsWindowTabMenuItemSelectedForeground"); tb1.FontWeight = FontWeights.Normal; tb1.HorizontalAlignment = HorizontalAlignment.Left; tb1.VerticalAlignment = VerticalAlignment.Center; this.mOptionsStackPanel.Children.Add((UIElement)tb1); foreach (string childrenKey in childrenKeys) { CustomRadioButton tb2 = new CustomRadioButton(); tb2.Checked += new RoutedEventHandler(this.Btn_Checked); tb2.HorizontalAlignment = HorizontalAlignment.Left; BlueStacksUIBinding.Bind(tb2, childrenKey); tb2.Tag = (object)childrenKey; tb2.Margin = new Thickness(0.0, 10.0, 0.0, 5.0); this.mOptionsStackPanel.Children.Add((UIElement)tb2); if (childrenKey == this.mCurrentGlobalDefault) { tb2.IsChecked = new bool?(true); } } }
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 PerformSaveMacroNameOperations() { this.mScriptName.IsEnabled = false; this.mScriptName.Focusable = false; this.mScriptName.IsReadOnly = true; this.mScriptName.BorderThickness = new Thickness(0.0); this.mEditNameImg.ImageName = "edit_icon"; BlueStacksUIBinding.Bind((Image)this.mEditNameImg, "STRING_RENAME"); this.SaveMacroName(); }
private void ShowLatestVersionGrid() { this.Dispatcher.Invoke((Delegate)(() => { this.mUpdateInfoGrid.Visibility = Visibility.Collapsed; this.mCheckUpdateBtn.Visibility = Visibility.Collapsed; this.mStatusLabel.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(this.mStatusLabel, "STRING_LATEST_VERSION", ""); this.mCheckingGrid.Visibility = Visibility.Collapsed; })); }
private void UserControl_IsVisibleChanged(object _1, DependencyPropertyChangedEventArgs _2) { if (this.Visibility != Visibility.Visible) { return; } BlueStacksUIBinding.Bind(this.mBaseControl.mTitleLabel, "STRING_GOOGLE_LOGIN_MESSAGE"); this.mBaseControl.Init((Control)this, (Panel)this.ParentWindow.mFrontendGrid, true, true); this.mBaseControl.ShowContent(); this.ParentWindow.mAppHandler.EventOnOneTimeSetupCompleted = this.OneTimeSetupCompletedEventHandle; }
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 ShowInternetConnectionErrorGrid() { this.Dispatcher.Invoke((Delegate)(() => { this.mUpdateInfoGrid.Visibility = Visibility.Collapsed; this.mCheckUpdateBtn.HorizontalAlignment = HorizontalAlignment.Right; this.mCheckUpdateBtn.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind((Button)this.mCheckUpdateBtn, "STRING_RETRY_CONNECTION_ISSUE_TEXT1"); this.mStatusLabel.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(this.mStatusLabel, "STRING_POST_OTS_FAILED_WARNING_MESSAGE", ""); this.mCheckingGrid.Visibility = Visibility.Collapsed; })); }
private void HandleUpdateStateGridVisibility(BlueStacksUpdater.UpdateState state) { this.Dispatcher.Invoke((Delegate)(() => { switch (state) { case BlueStacksUpdater.UpdateState.NO_UPDATE: this.mUpdateInfoGrid.Visibility = Visibility.Collapsed; this.mCheckUpdateBtn.HorizontalAlignment = HorizontalAlignment.Left; this.mCheckUpdateBtn.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind((Button)this.mCheckUpdateBtn, "STRING_CHECK_UPDATES"); this.mStatusLabel.Visibility = Visibility.Collapsed; this.mCheckingGrid.Visibility = Visibility.Collapsed; break; case BlueStacksUpdater.UpdateState.UPDATE_AVAILABLE: this.mUpdateInfoGrid.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(this.bodyLabel, "STRING_UPDATE_AVAILABLE"); this.mDetailedChangeLogs.NavigateUri = new Uri(BlueStacksUpdater.sBstUpdateData.DetailedChangeLogsUrl); this.mLabelVersion.Content = (object)("v" + BlueStacksUpdater.sBstUpdateData.EngineVersion); this.mCheckUpdateBtn.HorizontalAlignment = HorizontalAlignment.Right; this.mCheckUpdateBtn.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind((Button)this.mCheckUpdateBtn, "STRING_DOWNLOAD_UPDATE"); this.mStatusLabel.Visibility = Visibility.Collapsed; this.mCheckingGrid.Visibility = Visibility.Collapsed; break; case BlueStacksUpdater.UpdateState.DOWNLOADING: this.mUpdateInfoGrid.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(this.bodyLabel, "STRING_DOWNLOADING_UPDATE"); this.mDetailedChangeLogs.NavigateUri = new Uri(BlueStacksUpdater.sBstUpdateData.DetailedChangeLogsUrl); this.mLabelVersion.Content = (object)("v" + BlueStacksUpdater.sBstUpdateData.EngineVersion); this.mCheckUpdateBtn.Visibility = Visibility.Collapsed; this.mStatusLabel.Visibility = Visibility.Collapsed; this.mCheckingGrid.Visibility = Visibility.Collapsed; break; case BlueStacksUpdater.UpdateState.DOWNLOADED: this.mUpdateInfoGrid.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(this.bodyLabel, "STRING_UPDATES_READY_TO_INSTALL"); this.mDetailedChangeLogs.NavigateUri = new Uri(BlueStacksUpdater.sBstUpdateData.DetailedChangeLogsUrl); this.mLabelVersion.Content = (object)("v" + BlueStacksUpdater.sBstUpdateData.EngineVersion); this.mCheckUpdateBtn.HorizontalAlignment = HorizontalAlignment.Right; this.mCheckUpdateBtn.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind((Button)this.mCheckUpdateBtn, "STRING_INSTALL_UPDATE"); this.mStatusLabel.Visibility = Visibility.Collapsed; this.mCheckingGrid.Visibility = Visibility.Collapsed; break; } })); }
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 CheckUpdateBackgroundWorker_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e) { BlueStacks.Common.Tuple <BlueStacksUpdateData, bool> result = (BlueStacks.Common.Tuple <BlueStacksUpdateData, bool>)e.Result; BlueStacksUpdateData bstUpdateData = result.Item1; bool flag = result.Item2; if (bstUpdateData.IsUpdateAvailble) { BlueStacksUpdater.ParentWindow.mTopBar.mConfigButton.ImageName = "cfgmenu_update"; BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpgradeBluestacksStatus.Visibility = Visibility.Visible; BlueStacksUIBinding.Bind(BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpgradeBluestacksStatusTextBlock, "STRING_DOWNLOAD_UPDATE", ""); BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpdateDownloadProgressPercentage.Visibility = Visibility.Collapsed; if (bstUpdateData.IsFullInstaller) { if (!flag) { return; } if (bstUpdateData.UpdateType.Equals("hard", StringComparison.InvariantCultureIgnoreCase)) { Logger.Info("Forced full installer update, starting download."); BlueStacksUpdater.DownloadNow(bstUpdateData, true); } else { if (!bstUpdateData.UpdateType.Equals("soft", StringComparison.InvariantCultureIgnoreCase) || string.Compare(bstUpdateData.EngineVersion.Trim(), RegistryManager.Instance.LastUpdateSkippedVersion.Trim(), StringComparison.OrdinalIgnoreCase) == 0) { return; } ClientStats.SendBluestacksUpdaterUIStatsAsync(ClientStatsEvent.UpgradePopup, ""); UpdatePrompt updatePrompt1 = new UpdatePrompt(bstUpdateData); updatePrompt1.Height = 215.0; updatePrompt1.Width = 400.0; UpdatePrompt updatePrompt2 = updatePrompt1; ContainerWindow containerWindow = new ContainerWindow(BlueStacksUpdater.ParentWindow, (UserControl)updatePrompt2, (double)(int)updatePrompt2.Width, (double)(int)updatePrompt2.Height, false, true, false, -1.0, (Brush)null); } } else { Logger.Info("Only client installer update, starting download."); BlueStacksUpdater.DownloadNow(bstUpdateData, true); } } else { BlueStacksUpdater.SUpdateState = BlueStacksUpdater.UpdateState.NO_UPDATE; } }
public DMMProgressControl() { this.InitializeComponent(); if (DesignerProperties.GetIsInDesignMode((DependencyObject)this)) { return; } BlueStacksUIBinding.Bind(this.BootText, "STRING_BOOT_TIME", ""); if (RegistryManager.Instance.LastBootTime / 400 > 0) { return; } RegistryManager.Instance.LastBootTime = 120000; RegistryManager.Instance.NoOfBootCompleted = 0; }
internal void Init(MainWindow window) { this.ParentWindow = window; this.mTimer = new DispatcherTimer(new TimeSpan(0, 0, 0, 0, 50), DispatcherPriority.Render, new EventHandler(this.T_Tick), Dispatcher.CurrentDispatcher); this.mPlayMacroImg.Visibility = Visibility.Collapsed; this.mPauseMacroImg.Visibility = Visibility.Visible; this.mBlinkRecordingIconTimer = new DispatcherTimer(new TimeSpan(0, 0, 0, 0, 500), DispatcherPriority.Render, new EventHandler(this.BlinkRecordingIcon_Tick), Dispatcher.CurrentDispatcher); if (FeatureManager.Instance.IsCustomUIForNCSoft) { BlueStacksUIBinding.Bind(this.ParentWindow.mNCTopBar.mMacroRecordingTooltip, "STRING_PAUSE_RECORDING_TOOLTIP", ""); } else { BlueStacksUIBinding.Bind(this.ParentWindow.mTopBar.mMacroRecordingTooltip, "STRING_PAUSE_RECORDING_TOOLTIP", ""); } }
private static void DownloadComplete() { Logger.Info("Installer download completed"); BlueStacksUpdater.SUpdateState = BlueStacksUpdater.UpdateState.DOWNLOADED; BlueStacksUpdater.ParentWindow.Dispatcher.Invoke((Delegate)(() => { BlueStacksUIBinding.Bind(BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpgradeBluestacksStatusTextBlock, "STRING_INSTALL_UPDATE", ""); BlueStacksUpdater.ParentWindow.mTopBar.mPreferenceDropDownControl.mUpdateDownloadProgressPercentage.Visibility = Visibility.Collapsed; if (BlueStacksUpdater.sUpdateDownloadProgress == null) { return; } BlueStacksUpdater.sUpdateDownloadProgress.Close(); })); BlueStacksUpdater.DownloadCompleted(new BlueStacks.Common.Tuple <BlueStacksUpdateData, bool>(BlueStacksUpdater.sBstUpdateData, BlueStacksUpdater.IsDownloadingInHiddenMode)); }
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(); }
private void GenerateCheckBox() { CustomCheckbox customCheckbox = new CustomCheckbox(); BlueStacksUIBinding.Bind((ToggleButton)customCheckbox, "STRING_DOWNLOAD_GOOGLE_APP_POPUP_STRING_04"); if (customCheckbox.Image != null) { customCheckbox.Image.Height = 14.0; customCheckbox.Image.Width = 14.0; } customCheckbox.Height = 20.0; customCheckbox.Margin = new Thickness(0.0, 10.0, 0.0, 0.0); customCheckbox.IsChecked = new bool?(false); customCheckbox.Checked += new RoutedEventHandler(this.DontShowAgainCB_Checked); customCheckbox.Unchecked += new RoutedEventHandler(this.DontShowAgainCB_Unchecked); this.mOptionsStackPanel.Children.Add((UIElement)customCheckbox); }
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(); })); }
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 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(); }