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); } } }
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 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(); }
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 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"; }
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); } }
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 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); } }
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 CreateShortcutCategory(string categoryName) { if (this.mShortcutUIElements.ContainsKey(categoryName)) { return; } string localizedString = LocaleStrings.GetLocalizedString(categoryName, ""); GroupBox groupBox1 = new GroupBox(); groupBox1.Content = (object)new StackPanel(); groupBox1.Header = (object)localizedString; groupBox1.Tag = (object)categoryName; groupBox1.Margin = new Thickness(0.0, 20.0, 0.0, 0.0); groupBox1.FontSize = 16.0; GroupBox groupBox2 = groupBox1; BlueStacksUIBinding.BindColor((DependencyObject)groupBox2, Control.ForegroundProperty, "SettingsWindowTabMenuItemLegendForeground"); groupBox2.BorderThickness = new Thickness(0.0); TextBlock textBlock = new TextBlock(); textBlock.Text = localizedString; textBlock.Tag = (object)categoryName; textBlock.FontStretch = FontStretches.ExtraExpanded; textBlock.HorizontalAlignment = HorizontalAlignment.Center; textBlock.Margin = new Thickness(0.0, 0.0, 0.0, 10.0); textBlock.TextWrapping = TextWrapping.WrapWithOverflow; BlueStacksUIBinding.BindColor((DependencyObject)textBlock, TextBlock.ForegroundProperty, "SettingsWindowTabMenuItemLegendForeground"); this.mShortcutUIElements.Add(categoryName, new BlueStacks.Common.Tuple <GroupBox, List <ShortcutKeyControlElement> >(groupBox2, new List <ShortcutKeyControlElement>())); }
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 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); }
private void ChooseNewGrid_MouseEnter(object sender, MouseEventArgs e) { if (!RegistryManager.Instance.IsPremium) { this.mWallpaperPopup.IsOpen = true; } BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor"); }
private void SetDefaultGrid_MouseEnter(object sender, MouseEventArgs e) { if (!File.Exists(HomeAppManager.BackgroundImagePath)) { return; } BlueStacksUIBinding.BindColor((DependencyObject)(sender as Grid), Panel.BackgroundProperty, "ContextMenuItemBackgroundHoverColor"); }
private void Button_MouseLeave(object sender, MouseEventArgs e) { if (this.IsSelected) { return; } BlueStacksUIBinding.BindColor((DependencyObject)this.mBottomGrid, Panel.BackgroundProperty, "HomeAppTabBackgroundColor"); BlueStacksUIBinding.BindColor((DependencyObject)this.mTabHeader, TextBlock.ForegroundProperty, "HomeAppTabForegroundColor"); }
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 Image_MouseLeave(object sender, MouseEventArgs e) { if (KMManager.sDragCanvasElement == null) { this.Cursor = Cursors.Arrow; } this.mDragImage.Visibility = Visibility.Hidden; BlueStacksUIBinding.BindColor((DependencyObject)this.mBorder, Control.BorderBrushProperty, "AdvancedSettingsItemPanelBorder"); this.mBorder.Effect = (Effect)null; }
private bool TestEmail(string text) { BlueStacksUIBinding.BindColor((DependencyObject)this.txtEmailBorder, Border.BorderBrushProperty, "SettingsWindowTabMenuItemForeground"); if (Regex.IsMatch(text, "^(?(\")(\".+?(?<!\\\\)\"@)|(([0-9a-z]((\\.(?!\\.))|[-!#\\$%&'\\*\\+/=\\?\\^`\\{\\}\\|~\\w])*)(?<=[0-9a-z])@))(?(\\[)(\\[(\\d{1,3}\\.){3}\\d{1,3}\\])|(([0-9a-z][-0-9a-z]*[0-9a-z]*\\.)+[a-z0-9][\\-a-z0-9]{0,22}[a-z0-9]))$", RegexOptions.IgnoreCase)) { return(true); } this.txtEmailBorder.BorderBrush = (Brush)Brushes.Red; return(false); }
private bool TestPhone(string text) { BlueStacksUIBinding.BindColor((DependencyObject)this.txtPhoneBorder, Border.BorderBrushProperty, "SettingsWindowTabMenuItemForeground"); if (Regex.IsMatch(text, OtsFeedbackControl.MakeCombinedPattern((IEnumerable <string>)OtsFeedbackControl.m_Phone_Patterns), RegexOptions.IgnoreCase)) { return(true); } this.txtPhoneBorder.BorderBrush = (Brush)Brushes.Red; return(false); }
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 mYesBtn_Click(object sender, RoutedEventArgs e) { BlueStacksUIBinding.BindColor((DependencyObject)this.mYesBtn, Control.BackgroundProperty, "BlueMouseDownBorderBackground"); BlueStacks.Common.Stats.SendCommonClientStatsAsync("notification_mode", "exitpopup_yes", this.ParentWindow.mVmName, "", "", "", ""); this.ParentWindow.EngineInstanceRegistry.IsMinimizeSelectedOnReceiveGameNotificationPopup = true; RegistryManager.Instance.IsNotificationModeAlwaysOn = true; NotificationManager.Instance.UpdateMuteState(MuteState.NotMuted, new JsonParser(this.ParentWindow.mVmName).GetAppNameFromPackage(this.PackageName), this.ParentWindow.mVmName); this.Close(); this.ParentWindow.MinimizeWindowHandler(); }
private void KeyPropertyNameTextBox_GotFocus(object sender, RoutedEventArgs e) { if (!string.Equals(LocaleStrings.GetLocalizedString("STRING_ENTER_GUIDANCE_TEXT", ""), this.mKeyPropertyNameTextBox.Text, StringComparison.InvariantCulture)) { return; } this.mKeyPropertyNameTextBox.Text = ""; this.mKeyPropertyNameTextBox.FontStyle = FontStyles.Normal; this.mKeyPropertyNameTextBox.FontWeight = FontWeights.Normal; BlueStacksUIBinding.BindColor((DependencyObject)this.mKeyPropertyNameTextBox, Control.ForegroundProperty, "DualTextBlockForeground"); }
private void KeyPropertyNameTextBox_LostFocus(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(this.mKeyPropertyNameTextBox.Text)) { return; } this.mKeyPropertyNameTextBox.Text = LocaleStrings.GetLocalizedString("STRING_ENTER_GUIDANCE_TEXT", ""); this.mKeyPropertyNameTextBox.FontStyle = FontStyles.Italic; this.mKeyPropertyNameTextBox.FontWeight = FontWeights.ExtraLight; BlueStacksUIBinding.BindColor((DependencyObject)this.mKeyPropertyNameTextBox, Control.ForegroundProperty, "DualTextBlockLightForegroundColor"); }
private void OpenSearchSuggestions() { try { if (this.mSearchRecommendationBorder.Visibility == Visibility.Visible || !string.IsNullOrEmpty(this.mSearchTextBox.Text) && !(this.mSearchTextBox.Text == this.defaultSearchBoxText) || (PromotionObject.Instance.SearchRecommendations.Count <= 0 || !this.mIsShowSearchRecommendations)) { return; } this.searchRecomItems.Children.Clear(); Separator separator1 = new Separator(); separator1.Margin = new Thickness(0.0); separator1.Style = this.FindResource((object)ToolBar.SeparatorStyleKey) as Style; Separator separator2 = separator1; BlueStacksUIBinding.BindColor((DependencyObject)separator2, Control.BackgroundProperty, "VerticalSeparator"); this.searchRecomItems.Children.Add((UIElement)separator2); Label label1 = new Label(); label1.Content = (object)LocaleStrings.GetLocalizedString("STRING_MOST_SEARCHED_APPS", ""); Label label2 = label1; BlueStacksUIBinding.BindColor((DependencyObject)label2, Control.ForegroundProperty, "SearchGridForegroundColor"); label2.FontSize = 14.0; label2.Padding = new Thickness(10.0, 5.0, 5.0, 5.0); this.searchRecomItems.Children.Add((UIElement)label2); foreach (KeyValuePair <string, SearchRecommendation> searchRecommendation in (Dictionary <string, SearchRecommendation>)PromotionObject.Instance.SearchRecommendations) { RecommendedAppItem recommendedAppItem = new RecommendedAppItem(); recommendedAppItem.Populate(this.ParentWindow, searchRecommendation.Value); recommendedAppItem.Padding = new Thickness(5.0, 0.0, 0.0, 0.0); this.searchRecomItems.Children.Add((UIElement)recommendedAppItem); } Border recommendationBorder = this.mSearchRecommendationBorder; CornerRadius cornerRadius1 = this.searchTextBoxBorder.CornerRadius; double bottomRight = cornerRadius1.BottomRight; cornerRadius1 = this.searchTextBoxBorder.CornerRadius; double bottomLeft = cornerRadius1.BottomLeft; CornerRadius cornerRadius2 = new CornerRadius(0.0, 0.0, bottomRight, bottomLeft); recommendationBorder.CornerRadius = cornerRadius2; Border mask = this.Mask; cornerRadius1 = this.searchTextBoxBorder.CornerRadius; CornerRadius cornerRadius3 = new CornerRadius(0.0, cornerRadius1.TopRight, 0.0, 0.0); mask.CornerRadius = cornerRadius3; Border searchTextBoxBorder = this.searchTextBoxBorder; cornerRadius1 = this.searchTextBoxBorder.CornerRadius; double topLeft = cornerRadius1.TopLeft; cornerRadius1 = this.searchTextBoxBorder.CornerRadius; double topRight = cornerRadius1.TopRight; CornerRadius cornerRadius4 = new CornerRadius(topLeft, topRight, 0.0, 0.0); searchTextBoxBorder.CornerRadius = cornerRadius4; this.mSearchRecommendationBorder.Visibility = Visibility.Visible; } catch (Exception ex) { Logger.Error("Exception when trying to open search recommendations. " + ex.ToString()); } }
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 ComboBoxItem_MouseLeave(object sender, MouseEventArgs e) { if (this.mSchemeName.Text != this.CanvasWindow.SidebarWindow.mSchemeComboBox.SelectedItem) { BlueStacksUIBinding.BindColor((DependencyObject)this, Control.BackgroundProperty, "ComboBoxBackgroundColor"); } else { BlueStacksUIBinding.BindColor((DependencyObject)this, Control.BackgroundProperty, "ContextMenuItemBackgroundSelectedColor"); } }
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(); }