Beispiel #1
0
 private void mUpgradeBluestacksStatus_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (this.mUpgradeBluestacksStatusTextBlock.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture).Equals(LocaleStrings.GetLocalizedString("STRING_DOWNLOAD_UPDATE", ""), StringComparison.OrdinalIgnoreCase))
     {
         ClientStats.SendBluestacksUpdaterUIStatsAsync(ClientStatsEvent.SettingsGearDwnld, "");
         UpdatePrompt updatePrompt1 = new UpdatePrompt(BlueStacksUpdater.sBstUpdateData);
         updatePrompt1.Height = 215.0;
         updatePrompt1.Width  = 400.0;
         UpdatePrompt    updatePrompt2   = updatePrompt1;
         ContainerWindow containerWindow = new ContainerWindow(this.ParentWindow, (UserControl)updatePrompt2, (double)(int)updatePrompt2.Width, (double)(int)updatePrompt2.Height, false, true, false, -1.0, (Brush)null);
     }
     else if (this.mUpgradeBluestacksStatusTextBlock.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture).Equals(LocaleStrings.GetLocalizedString("STRING_DOWNLOADING_UPDATE", ""), StringComparison.OrdinalIgnoreCase))
     {
         this.ParentWindow.mTopBar.mSettingsMenuPopup.IsOpen = false;
         BlueStacksUpdater.ShowDownloadProgress();
     }
     else
     {
         if (!this.mUpgradeBluestacksStatusTextBlock.Text.ToString((IFormatProvider)CultureInfo.InvariantCulture).Equals(LocaleStrings.GetLocalizedString("STRING_INSTALL_UPDATE", ""), StringComparison.OrdinalIgnoreCase))
         {
             return;
         }
         this.ParentWindow.ShowInstallPopup();
     }
 }
        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;
            }
        }