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();
 }
Пример #2
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mUpdateDownloadProgressUserControl = (UpdateDownloadProgress)target;
                break;

            case 2:
                this.mMaskBorder = (Border)target;
                break;

            case 3:
                ((UIElement)target).MouseLeftButtonDown += new MouseButtonEventHandler(this.Grid_MouseLeftButtonDown);
                break;

            case 4:
                this.titleLabel = (TextBlock)target;
                break;

            case 5:
                this.mCloseBtn = (CustomPictureBox)target;
                this.mCloseBtn.PreviewMouseLeftButtonUp += new MouseButtonEventHandler(this.mCloseBtn_PreviewMouseLeftButtonUp);
                break;

            case 6:
                this.mDetailedChangeLogs = (Hyperlink)target;
                this.mDetailedChangeLogs.RequestNavigate += new RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);
                break;

            case 7:
                this.mUpdateDownloadProgressBar = (BlueProgressBar)target;
                break;

            case 8:
                this.mUpdateDownloadProgressPercentage = (Label)target;
                break;

            case 9:
                this.mHideBtn        = (CustomButton)target;
                this.mHideBtn.Click += new RoutedEventHandler(this.HideBtn_Click);
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }