Esempio n. 1
0
        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();
        }
 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", ""));
     }
 }
 private void DownloadNowButton_Click(object sender, RoutedEventArgs e)
 {
     Logger.Info("Clicked Download_Now button");
     ClientStats.SendBluestacksUpdaterUIStatsAsync(ClientStatsEvent.UpgradePopupDwnld, "");
     BlueStacksUpdater.DownloadNow(this.mBstUpdateData, false);
     BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this);
 }
 private void CloseBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     Logger.Info("Clicked UpdateNow Menu Close button");
     RegistryManager.Instance.LastUpdateSkippedVersion = this.mBstUpdateData.EngineVersion;
     ClientStats.SendBluestacksUpdaterUIStatsAsync(ClientStatsEvent.UpgradePopupCross, "");
     BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this);
 }
 private void Control_Loaded(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(this.GameFeatureId))
     {
         BlueStacks.Common.Stats.SendCommonClientStatsAsync("onboarding-tutorial", "client_impression", this.ParentWindow.mVmName, this.PackageName, "", "", "");
     }
     this.mBrowser = new BrowserControl();
     this.mBrowser.BrowserLoadCompleteEvent += new System.Action(this.BrowserLoadCompleteEvent);
     if (!string.IsNullOrEmpty(this.GameFeatureId))
     {
         this.mBrowser.InitBaseControl(BlueStacksUIUtils.GetGameFeaturePopupUrl(this.PackageName, this.GameFeatureId), 0.0f);
         this.mCloseOnboardingGrid.Visibility = Visibility.Visible;
     }
     else
     {
         this.mBrowser.InitBaseControl(BlueStacksUIUtils.GetOnboardingUrl(this.PackageName, this.InitiatedSource), 0.0f);
     }
     this.mBrowser.Visibility   = Visibility.Visible;
     this.mBrowser.ParentWindow = this.ParentWindow;
     this.mBrowserGrid.Children.Add((UIElement)this.mBrowser);
     this.controlGrid            = this.AddBrowser();
     this.controlGrid.Visibility = Visibility.Visible;
     this.mBrowserGrid.Children.Add((UIElement)this.controlGrid);
     if (!string.IsNullOrEmpty(this.GameFeatureId))
     {
         return;
     }
     this.dispatcherTimer          = new DispatcherTimer();
     this.dispatcherTimer.Tick    += new EventHandler(this.DispatcherTimer_Tick);
     this.dispatcherTimer.Interval = new TimeSpan(0, 0, PostBootCloudInfoManager.Instance.mPostBootCloudInfo.OnBoardingInfo.OnBoardingSkipTimer);
     this.dispatcherTimer.Start();
 }
 internal void RemoveControl()
 {
     if (!this.Control.ShowControlInSeparateWindow)
     {
         if (!this.mGrid.Children.Contains(this.Control as UIElement))
         {
             return;
         }
         this.mGrid.Children.Remove(this.Control as UIElement);
         this.Control.Close();
     }
     else
     {
         if (this.Control != null)
         {
             BlueStacksUIUtils.RemoveChildFromParent((UIElement)this.Control);
             this.Control.Close();
         }
         if (this.cw == null)
         {
             return;
         }
         this.cw.Close();
     }
 }
        private void QAE_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                switch (this.mCallToAction)
                {
                case QuitActionItemCTA.OpenLinkInBrowser:
                    if (!string.IsNullOrEmpty(this.mQuitActionValue))
                    {
                        BlueStacksUIUtils.OpenUrl(this.mQuitActionValue);
                    }
                    this.SendCTAStat();
                    break;

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

                case QuitActionItemCTA.OpenApplication:
                    if (!string.IsNullOrEmpty(this.mQuitActionValue))
                    {
                        Process.Start(this.mQuitActionValue);
                    }
                    this.SendCTAStat();
                    break;
                }
            }
            catch (Exception ex)
            {
                Logger.Info("Some error while CallToAction of QuitPopup. Ex: {0}", (object)ex);
            }
        }
Esempio n. 8
0
 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();
     }
 }
 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);
     }
 }
Esempio n. 10
0
 private void OpenGameGuide()
 {
     BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)MainWindow.SettingsWindow);
     if (!this.mParentWindow.mCommonHandler.ToggleGamepadAndKeyboardGuidance("gamepad", false))
     {
         KMManager.HandleInputMapperWindow(this.mParentWindow, "gamepad");
     }
     ClientStats.SendMiscellaneousStatsAsync("game_setting", RegistryManager.Instance.UserGuid, "gameGuide", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, this.PackageName, (string)null, "Android");
 }
        private void RestartInstanceHandler()
        {
            string abiResult = "";

            if (this.EngineData.ABISetting != this.ABISetting)
            {
                abiResult = VmCmdHandler.RunCommand(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0} {1}", (object)"switchAbi", (object)this.ABISetting.GetDescription()), this._VmName, "bgp");
            }
            this.SaveEngineSettings(abiResult);
            BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this.ParentView);
        }
 private void OpenAppCenter()
 {
     try
     {
         this.ParentWindow?.Utils.HandleApplicationBrowserClick(BlueStacksUIUtils.GetAppCenterUrl((string)null), LocaleStrings.GetLocalizedString("STRING_APP_CENTER", ""), "appcenter", false, "");
     }
     catch (Exception ex)
     {
         Logger.Error("Couldn't open app center. Ex: {0}", (object)ex);
     }
 }
 private void SigninLaterBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClientStats.SendMiscellaneousStatsAsync("GoogleSigninLater", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, (string)null, (string)null, RegistryManager.Instance.InstallID, (string)null, (string)null, (string)null, "Android");
         BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this);
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in SigninLaterBtn_Click. Exception: " + ex?.ToString());
     }
 }
Esempio n. 14
0
        public void DownloadApk(
            string apkUrl,
            string packageName,
            bool isLaunchAfterInstall,
            bool isDeleteApk,
            string timestamp = "")
        {
            string str = Path.Combine(RegistryStrings.DataDir, "DownloadedApk");

            if (!Directory.Exists(str))
            {
                Directory.CreateDirectory(str);
            }
            string path2       = Regex.Replace(packageName + ".apk", "[\\x22\\\\\\/:*?|<>]", " ");
            string apkFilePath = Path.Combine(str, path2);

            Logger.Info("Downloading Apk file to: " + apkFilePath);
            this.ParentWindow.mWelcomeTab.mHomeAppManager.DownloadStarted(packageName);
            ClientStats.SendClientStatsAsync("download", "unknown", "app_install", packageName, "", "");
            this.mDownloadThread = new Thread((ThreadStart)(() =>
            {
                string apkUrl1 = apkUrl;
                if (DownloadInstallApk.IsContainsGoogleAdId(apkUrl1))
                {
                    apkUrl = this.AddGoogleAdidWithApk(apkUrl1);
                }
                apkUrl = BlueStacksUIUtils.GetFinalRedirectedUrl(apkUrl);
                if (string.IsNullOrEmpty(apkUrl))
                {
                    return;
                }
                this.mIsDownloading = true;
                this.mDownloader = new LegacyDownloader(3, apkUrl, apkFilePath);
                this.mDownloader.Download((LegacyDownloader.UpdateProgressCallback)(percent => this.ParentWindow.mWelcomeTab.mHomeAppManager.UpdateAppDownloadProgress(packageName, percent)), (LegacyDownloader.DownloadCompletedCallback)(filePath =>
                {
                    ClientStats.SendClientStatsAsync("download", "success", "app_install", packageName, "", "");
                    this.mIsDownloading = false;
                    this.ParentWindow.mWelcomeTab.mHomeAppManager.DownloadCompleted(packageName, filePath);
                    this.InstallApk(packageName, filePath, isLaunchAfterInstall, isDeleteApk, timestamp);
                    DownloadInstallApk.sDownloadedApkList.Add(packageName);
                }), (LegacyDownloader.ExceptionCallback)(ex =>
                {
                    ClientStats.SendClientStatsAsync("download", "fail", "app_install", packageName, "", "");
                    this.ParentWindow.mWelcomeTab.mHomeAppManager.DownloadFailed(packageName);
                    Logger.Error("Failed to download file: {0}. err: {1}", (object)apkFilePath, (object)ex.Message);
                }), (LegacyDownloader.ContentTypeCallback)null, (LegacyDownloader.SizeDownloadedCallback)null, (LegacyDownloader.PayloadInfoCallback)null);
            }))
            {
                IsBackground = true
            };
            this.mDownloadThread.Start();
        }
 internal void LoadBrowser()
 {
     this.mBrowser = new BrowserControl();
     this.mBrowser.BrowserLoadCompleteEvent += new System.Action(this.BrowserLoadCompleteEvent);
     this.mBrowser.InitBaseControl(BlueStacksUIUtils.GetUtcConverterUrl(this.PackageName), 0.0f);
     this.mBrowser.ParentWindow = this.ParentWindow;
     this.mBrowserGrid.Children.Add((UIElement)this.mBrowser);
     this.mBrowser.CreateNewBrowser();
     this.dispatcherTimer          = new DispatcherTimer();
     this.dispatcherTimer.Tick    += new EventHandler(this.DispatcherTimer_Tick);
     this.dispatcherTimer.Interval = new TimeSpan(0, 0, 20);
     this.dispatcherTimer.Start();
 }
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try
     {
         Logger.Info("Opening url: " + e.Uri.AbsoluteUri);
         BlueStacksUIUtils.OpenUrl(e.Uri.AbsoluteUri);
         e.Handled = true;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in opening url" + ex.ToString());
     }
 }
 private void Close(UserControl control)
 {
     try
     {
         BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)control);
         this.ParentWindow.HideDimOverlay();
         control.Visibility = Visibility.Hidden;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception while trying to close CloseBluestacksControl from dimoverlay " + ex.ToString());
     }
 }
 private void mGetButton_Click(object sender, RoutedEventArgs e)
 {
     Logger.Info("Clicked Restart to opengl button");
     if (RegistryManager.Instance.GLES3 && this.mParentWindow.EngineInstanceRegistry.GlRenderMode != 1)
     {
         this.mParentWindow.EngineInstanceRegistry.GlRenderMode = 1;
         BlueStacksUIUtils.RestartInstance(this.mParentWindow.mVmName, false);
     }
     else
     {
         this.Close();
     }
 }
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
 {
     try
     {
         Logger.Info("Opening url: " + e.Uri.AbsoluteUri);
         this.mCanvasElement.SendMOBAStats("read_more_clicked", "");
         BlueStacksUIUtils.OpenUrl(e.Uri.AbsoluteUri);
         e.Handled = true;
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in opening url" + ex.ToString());
     }
 }
 private void SendRetryBluestacksLoginRequest(string vmName)
 {
     try
     {
         Logger.Info("Sending retry call for token to android, since token is not received successfully");
         this.mSuccess = new bool?();
         this.StartingTimer();
         BlueStacksUIUtils.SendBluestacksLoginRequest(vmName);
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in SendRetryBluestacksLoginRequest: " + ex.ToString());
     }
 }
 internal bool Close()
 {
     try
     {
         BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this);
         this.ParentWindow.HideDimOverlay();
         this.Visibility = Visibility.Hidden;
         return(true);
     }
     catch (Exception ex)
     {
         Logger.Error("Exception while trying to close the advanced exit from dimoverlay " + ex.ToString());
     }
     return(false);
 }
Esempio n. 22
0
        private void mHelpCenterGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            string helpCenterUrl = BlueStacksUIUtils.GetHelpCenterUrl();

            this.ParentWindow.mTopBar.mSettingsMenuPopup.IsOpen = false;
            ClientStats.SendMiscellaneousStatsAsync("hamburgerMenu", RegistryManager.Instance.UserGuid, "HelpCentre", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android");
            if (RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition)
            {
                BlueStacksUIUtils.OpenUrl(helpCenterUrl);
            }
            else
            {
                this.ParentWindow.mTopBar.mAppTabButtons.AddWebTab(helpCenterUrl, "STRING_FEEDBACK", "help_center", true, "FEEDBACK_TEXT", false);
            }
        }
 private void SigninBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         AppIconModel appIcon = this.ParentWindow.mWelcomeTab.mHomeAppManager.GetAppIcon("com.android.vending");
         if (appIcon != null)
         {
             this.ParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, true, true, false);
         }
         ClientStats.SendMiscellaneousStatsAsync("GoogleSigninClick", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, (string)null, (string)null, RegistryManager.Instance.InstallID, (string)null, (string)null, (string)null, "Android");
         BlueStacksUIUtils.CloseContainerWindow((FrameworkElement)this);
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in SigninBtn_Click. Exception: " + ex?.ToString());
     }
 }
Esempio n. 24
0
 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());
     }
 }
        internal static void SendStatsSync(
            string op,
            string status,
            string uri,
            string package,
            string errorCode = "",
            string vmname    = "")
        {
            Dictionary <string, string> data = ClientStats.GetCommonData;

            data.Add(nameof(op), op);
            data.Add(nameof(status), status);
            string str = !(uri != "engine_activity") ? RegistryManager.Instance.Version : "4.250.0.1070";

            data.Add("version", str);
            if (uri == "emulator_activity")
            {
                Dictionary <string, string> resolutionData = BlueStacksUIUtils.GetResolutionData();
                try
                {
                    resolutionData.ToList <KeyValuePair <string, string> >().ForEach((System.Action <KeyValuePair <string, string> >)(kvp => data[kvp.Key] = kvp.Value));
                }
                catch (Exception ex)
                {
                    Logger.Error("Merge dictionary failed. Ex : " + ex.ToString());
                }
                try
                {
                    BlueStacksUIUtils.GetEngineSettingsData(vmname).ToList <KeyValuePair <string, string> >().ForEach((System.Action <KeyValuePair <string, string> >)(kvp => data[kvp.Key] = kvp.Value));
                }
                catch (Exception ex)
                {
                    Logger.Error("Merge dictionary failed. Ex : " + ex.ToString());
                }
            }
            if (!string.IsNullOrEmpty(errorCode))
            {
                data.Add("error_code", errorCode);
            }
            if (!string.IsNullOrEmpty(package))
            {
                data.Add("app_pkg", package);
            }
            ClientStats.SendStats(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}/bs3/stats/{1}", string.IsNullOrEmpty(ClientStats.sDevUrl) ? (object)RegistryManager.Instance.Host : (object)ClientStats.sDevUrl, (object)uri), data, (Dictionary <string, string>)null, vmname);
        }
Esempio n. 26
0
 private void LaunchDiskCompaction(object sender, MouseButtonEventArgs e)
 {
     try
     {
         this.ParentWindow.mFrontendHandler.IsRestartFrontendWhenClosed = false;
         BlueStacksUIUtils.HideUnhideBlueStacks(true);
         using (Process process = new Process())
         {
             process.StartInfo.FileName  = System.IO.Path.Combine(RegistryStrings.InstallDir, "DiskCompactionTool.exe");
             process.StartInfo.Arguments = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "-vmname:{0} -relaunch", (object)this.ParentWindow.mVmName);
             process.Start();
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in starting disk compaction" + ex.ToString());
     }
 }
Esempio n. 27
0
 internal SingleMacroControl(
     MainWindow parentWindow,
     MacroRecording record,
     MacroRecorderWindow recorderWindow)
 {
     this.InitializeComponent();
     this.mRecording           = record;
     this.ParentWindow         = parentWindow;
     this.mMacroRecorderWindow = recorderWindow;
     InputMethod.SetIsInputMethodEnabled((DependencyObject)this.mMacroShortcutTextBox, false);
     this.mTimestamp.Text            = DateTime.ParseExact(this.mRecording.TimeCreated, "yyyyMMddTHHmmss", (IFormatProvider)CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal).ToString("yyyy.MM.dd HH.mm.ss", (IFormatProvider)CultureInfo.InvariantCulture);
     this.mScriptName.Text           = this.mRecording.Name;
     this.mMacroShortcutTextBox.Text = IMAPKeys.GetStringForUI(this.mRecording.Shortcut);
     this.mScriptName.ToolTip        = (object)this.mScriptName.Text;
     if (record.RecordingType == RecordingTypes.MultiRecording)
     {
         this.mScriptSettingsImg.Visibility      = Visibility.Collapsed;
         this.mMergeScriptSettingsImg.Visibility = Visibility.Visible;
     }
     if (!string.IsNullOrEmpty(this.mRecording.Shortcut))
     {
         this.mMacroShortcutTextBox.Tag = (object)IMAPKeys.GetStringForFile(IMAPKeys.mDictKeys.FirstOrDefault <KeyValuePair <Key, string> >((Func <KeyValuePair <Key, string>, bool>)(x => x.Value == this.mRecording.Shortcut)).Key);
         MainWindow.sMacroMapping[this.mMacroShortcutTextBox.Tag.ToString()] = this.mScriptName.Text;
     }
     else
     {
         this.mMacroShortcutTextBox.Tag = (object)"";
     }
     this.IsBookmarked = BlueStacksUIUtils.CheckIfMacroScriptBookmarked(this.mRecording.Name);
     if (record.PlayOnStart)
     {
         this.mAutorunImage.Visibility = Visibility.Visible;
     }
     if (this.ParentWindow.mIsMacroPlaying && string.Equals(this.mRecording.Name, this.ParentWindow.mMacroPlaying, StringComparison.InvariantCulture))
     {
         this.ToggleScriptPlayPauseUi(true);
     }
     else
     {
         this.ToggleScriptPlayPauseUi(false);
     }
 }
 private static void PerformGrmActionsWorker_RunWorkerCompleted(
     RunWorkerCompletedEventArgs e,
     MainWindow ParentWindow)
 {
     if (e.Result == null)
     {
         return;
     }
     if (!(bool)e.Result)
     {
         ParentWindow.Dispatcher.Invoke((Delegate)(() =>
         {
             ParentWindow.mFrontendGrid.Visibility = Visibility.Visible;
             ParentWindow.mExitProgressGrid.Visibility = Visibility.Hidden;
         }));
         GrmHandler.RequirementConfigUpdated(ParentWindow.mVmName);
     }
     else
     {
         BlueStacksUIUtils.RestartInstance(ParentWindow.mVmName, false);
     }
 }
Esempio n. 29
0
 private void GuidanceVideoWindow_IsVisibleChanged(
     object _1,
     DependencyPropertyChangedEventArgs eventArgs)
 {
     if (this.IsVisible)
     {
         ClientStats.SendKeyMappingUIStatsAsync("video_clicked", KMManager.sPackageName, KMManager.sVideoMode.ToString());
         this.mBrowser = new BrowserControl();
         this.mBrowser.InitBaseControl(BlueStacksUIUtils.GetVideoTutorialUrl(KMManager.sPackageName, KMManager.sVideoMode.ToString().ToLower(CultureInfo.InvariantCulture), this.ParentWindow?.SelectedConfig?.SelectedControlScheme?.Name), 0.0f);
         this.mBrowser.ParentWindow = this.ParentWindow;
         this.mBrowser.Visibility   = Visibility.Visible;
         this.mBrowserGrid.Children.Add((UIElement)this.mBrowser);
     }
     try
     {
         if ((bool)eventArgs.NewValue)
         {
             HTTPUtils.SendRequestToEngineAsync("mute", new Dictionary <string, string>()
             {
                 ["explicit"] = "False"
             }, this.ParentWindow.mVmName, 0, (Dictionary <string, string>)null, false, 1, 0, "bgp");
             this.ParentWindow.mCommonHandler.OnVolumeMuted(true);
         }
         else
         {
             if (this.ParentWindow.IsMuted)
             {
                 return;
             }
             HTTPUtils.SendRequestToEngineAsync("unmute", (Dictionary <string, string>)null, this.ParentWindow.mVmName, 0, (Dictionary <string, string>)null, false, 1, 0, "bgp");
             this.ParentWindow.mCommonHandler.OnVolumeMuted(false);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Failed to send mute to frontend. Ex: " + ex.Message);
     }
 }
Esempio n. 30
0
 private void CreateSideHtmlBrowserControl()
 {
     this.SideHtmlBrowserInited = true;
     this.Dispatcher.Invoke((Delegate)(() =>
     {
         BrowserControl browserControl = new BrowserControl(BlueStacksUIUtils.GetHtmlSidePanelUrl())
         {
             Visibility = Visibility.Visible
         };
         CustomPictureBox customPictureBox = new CustomPictureBox()
         {
             HorizontalAlignment = HorizontalAlignment.Center,
             VerticalAlignment = VerticalAlignment.Center,
             Height = 30.0,
             Width = 30.0,
             ImageName = "loader",
             IsImageToBeRotated = true
         };
         this.mAppRecommendationsGrid.Children.Add((UIElement)browserControl);
         this.mAppRecommendationsGrid.Children.Add((UIElement)customPictureBox);
         browserControl.CreateNewBrowser();
         this.SideHtmlBrowser = browserControl;
     }));
 }