Beispiel #1
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();
     }
 }
 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 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 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);
     }
 }