예제 #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();
     }
 }
        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();
        }
 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", ""));
     }
 }
예제 #4
0
        private void DeleteScriptImg_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MacroRecording currentRecording = MacroGraph.Instance.Vertices.Cast <MacroRecording>().Where <MacroRecording>((Func <MacroRecording, bool>)(macro => string.Equals(macro.Name, this.mRecording.Name, StringComparison.InvariantCultureIgnoreCase))).FirstOrDefault <MacroRecording>();

            if (currentRecording == null)
            {
                return;
            }
            if (currentRecording.Parents.Count > 0)
            {
                this.mDeleteScriptMessageWindow = new CustomMessageWindow();
                this.mDeleteScriptMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DELETE_DEPENDENT_MACRO", "");
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append(LocaleStrings.GetLocalizedString("STRING_MACRO_IN_USE_BY_OTHER_MACROS", ""));
                stringBuilder.Append(" ");
                stringBuilder.Append(string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_MACRO_LOSE_CONFIGURABILITY", ""), (object)this.mRecording.Name));
                this.mDeleteScriptMessageWindow.BodyTextBlock.Text = stringBuilder.ToString();
                this.mDeleteScriptMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_DELETE_ANYWAY", ""), (EventHandler)((o, evt) =>
                {
                    for (int i = currentRecording.Parents.Count - 1; i >= 0; i--)
                    {
                        MacroRecording macroRecording = MacroGraph.Instance.Vertices.Cast <MacroRecording>().Where <MacroRecording>((Func <MacroRecording, bool>)(macro => macro.Equals((object)currentRecording.Parents[i]))).FirstOrDefault <MacroRecording>();
                        this.mMacroRecorderWindow.FlattenRecording(currentRecording.Parents[i] as MacroRecording, false);
                        CommonHandlers.SaveMacroJson(currentRecording.Parents[i] as MacroRecording, (currentRecording.Parents[i] as MacroRecording).Name + ".json");
                        foreach (SingleMacroControl child in this.mMacroRecorderWindow.mScriptsStackPanel.Children)
                        {
                            if (child.mRecording.Name.ToLower(CultureInfo.InvariantCulture).Trim() == macroRecording.Name.ToLower(CultureInfo.InvariantCulture).Trim())
                            {
                                child.mScriptSettingsImg.ImageName = "macro_settings";
                            }
                        }
                        MacroGraph.Instance.DeLinkMacroChild((BiDirectionalVertex <MacroRecording>)(currentRecording.Parents[i] as MacroRecording));
                    }
                    this.DeleteMacroScript();
                    CommonHandlers.RefreshAllMacroRecorderWindow();
                }), (string)null, false, (object)null, true);
                this.mDeleteScriptMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_DONT_DELETE", ""), (EventHandler)((o, evt) => {}), (string)null, false, (object)null, true);
                this.mDeleteScriptMessageWindow.CloseButtonHandle((EventHandler)((o, evt) => {}), (object)null);
                this.mDeleteScriptMessageWindow.Owner = (Window)this.ParentWindow;
                this.mDeleteScriptMessageWindow.ShowDialog();
            }
            else if (!this.ParentWindow.EngineInstanceRegistry.ShowMacroDeletePopup)
            {
                this.DeleteMacroScript();
            }
            else
            {
                this.mDeleteScriptMessageWindow = new CustomMessageWindow();
                this.mDeleteScriptMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DELETE_MACRO", "");
                this.mDeleteScriptMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_DELETE_SCRIPT", "");
                this.mDeleteScriptMessageWindow.CheckBox.Content    = (object)LocaleStrings.GetLocalizedString("STRING_DOWNLOAD_GOOGLE_APP_POPUP_STRING_04", "");
                this.mDeleteScriptMessageWindow.CheckBox.Visibility = Visibility.Visible;
                this.mDeleteScriptMessageWindow.CheckBox.IsChecked  = new bool?(false);
                this.mDeleteScriptMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_DELETE", ""), new EventHandler(this.FlattenTargetMacrosAndDeleteSourceMacro), (string)null, false, (object)null, true);
                this.mDeleteScriptMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)((o, evt) => this.ParentWindow.EngineInstanceRegistry.ShowMacroDeletePopup = !this.mDeleteScriptMessageWindow.CheckBox.IsChecked.Value), (string)null, false, (object)null, true);
                this.mDeleteScriptMessageWindow.CloseButtonHandle((EventHandler)((o, evt) => {}), (object)null);
                this.mDeleteScriptMessageWindow.Owner = (Window)this.ParentWindow;
                this.mDeleteScriptMessageWindow.ShowDialog();
            }
        }
 private void DeleteImg_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (!this.mSchemeName.IsReadOnly)
     {
         this.HandleNameEdit(this);
     }
     if (!this.ParentWindow.EngineInstanceRegistry.ShowSchemeDeletePopup)
     {
         this.DeleteControlScheme();
         e.Handled = true;
     }
     else
     {
         this.mDeleteScriptMessageWindow = new CustomMessageWindow();
         this.mDeleteScriptMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DELETE_SCHEME", "");
         this.mDeleteScriptMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_DELETE_SCHEME_CONFIRMATION", "");
         this.mDeleteScriptMessageWindow.CheckBox.Content    = (object)LocaleStrings.GetLocalizedString("STRING_DOWNLOAD_GOOGLE_APP_POPUP_STRING_04", "");
         this.mDeleteScriptMessageWindow.CheckBox.Visibility = Visibility.Visible;
         this.mDeleteScriptMessageWindow.CheckBox.IsChecked  = new bool?(false);
         this.mDeleteScriptMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_DELETE", ""), new EventHandler(this.UpdateSettingsAndDeleteScheme), (string)null, false, (object)null, true);
         this.mDeleteScriptMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)((o, evt) =>
         {
             KeymapCanvasWindow.sIsDirty = false;
             GuidanceWindow.sIsDirty = false;
         }), (string)null, false, (object)null, true);
         this.mDeleteScriptMessageWindow.CloseButtonHandle((EventHandler)((o, evt) => {}), (object)null);
         this.mDeleteScriptMessageWindow.Owner = (Window)this.CanvasWindow;
         this.mDeleteScriptMessageWindow.ShowDialog();
         e.Handled = true;
     }
 }
예제 #6
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     if (!this.CheckForSupportedVersion())
     {
         if (!App.sOpt.s)
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_UNSUPPORTED_VERSION", "");
             customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_VERSION_NOT_SUPPORTED", "");
             customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_EXIT", ""), (EventHandler)((o, args) => App.ExitApplication(-1)), (string)null, false, (object)null, true);
             customMessageWindow.CloseButtonHandle((EventHandler)((o, args) => App.ExitApplication(-1)), (object)null);
             customMessageWindow.ShowDialog();
         }
         else
         {
             App.ExitApplication(-1);
         }
     }
     else
     {
         MainWindow mainWindow = new MainWindow();
         if (!App.sOpt.s)
         {
             mainWindow.Show();
         }
         else
         {
             Stats.SendMiscellaneousStatsAsync("DiskCompactionStats", "DiskCompaction Started", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, App.sOpt.vmname, App.sOpt.relaunch.ToString(), App.sOpt.s.ToString(), (string)null, "Android", 0);
             DiskCompactionHelper.Instance.StartCompaction();
         }
     }
 }
예제 #7
0
        private static void CheckIfAlreadyRunning()
        {
            if (!ProcessUtils.CheckAlreadyRunningAndTakeLock("Global\\BlueStacks_Log_Collector_Lockbgp", out App.sLogCollectorLock))
            {
                return;
            }
            bool flag = false;

            Logger.Info("LogCollector already running.");
            if (App.sOpt.Boot || App.sOpt.Apk || (App.sOpt.D || App.sOpt.Thin) || (App.sOpt.Silent || App.sOpt.Hidden))
            {
                flag = true;
            }
            if (!flag)
            {
                IntPtr window = InteropWindow.FindWindow((string)null, LocaleStrings.GetLocalizedString("STRING_BST_SUPPORT_UTILITY", ""));
                if (window != IntPtr.Zero)
                {
                    InteropWindow.SetForegroundWindow(window);
                }
                else
                {
                    CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                    customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_BST_SUPPORT_UTILITY", "");
                    customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_LOGCOLLECTOR_RUNNING", "");
                    customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_OK", ""), (EventHandler)null, (string)null, false, (object)null, true);
                    customMessageWindow.ShowDialog();
                }
            }
            App.KillApplication();
        }
예제 #8
0
 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 static void ShowWarningMsg(
     string message,
     string captionTitle,
     ProgressWindow progress,
     EventHandler ContinueBtnhandler)
 {
     Logger.Info("Showing Warning Message prompt");
     if (!App.sOpt.s)
     {
         progress.Dispatcher.Invoke((Delegate)(() =>
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString(captionTitle, "");
             customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString(message, "");
             customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CONTINUE", ContinueBtnhandler, (string)null, false, (object)null, true);
             customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", new EventHandler(DataManagerUtils.DataManagerUtils_CancelBtnHandler), (string)null, false, (object)null, true);
             customMessageWindow.CloseButtonHandle(new EventHandler(DataManagerUtils.DataManagerUtils_CancelBtnHandler), (object)null);
             customMessageWindow.Owner = (Window)progress;
             customMessageWindow.ShowDialog();
         }));
     }
     else
     {
         ContinueBtnhandler((object)null, (EventArgs)null);
     }
 }
예제 #10
0
 private void RunBinary(string fileName, string args, string text, string title)
 {
     try
     {
         Logger.Info("In method RunBinary");
         string str = Path.Combine(RegistryStrings.InstallDir, fileName);
         using (Process process = new Process())
         {
             process.StartInfo.FileName  = str;
             process.StartInfo.Arguments = args;
             process.EnableRaisingEvents = true;
             process.Disposed           += (EventHandler)((sender, e) => this.Dispatcher.Invoke((Delegate)(() =>
             {
                 this.Visibility = Visibility.Hidden;
                 this.ShowInTaskbar = false;
                 if (!Oem.Instance.IsHideMessageBoxIconInTaskBar)
                 {
                     CustomMessageWindow customMessageWindow = new CustomMessageWindow();
                     customMessageWindow.TitleTextBlock.Text = title;
                     customMessageWindow.BodyTextBlock.Text = text;
                     customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_OK", ""), (EventHandler)null, (string)null, false, (object)null, true);
                     customMessageWindow.ShowDialog();
                 }
                 this.Close();
             })));
             process.Start();
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Error occured, Err: {0}", (object)ex.ToString());
     }
 }
예제 #11
0
 private void TroubleshootIfPossible(string subCategory)
 {
     Logger.Info("In method TroubleshootIfPossible");
     if (subCategory.Contains("RPCError"))
     {
         Logger.Info("RPC Error detected");
         CustomMessageWindow customMessageWindow = new CustomMessageWindow();
         customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RPC_FORM", "");
         customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_TROUBLESHOOTER", "");
         customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_RESOLVE_AUTOMATIC", ""), new EventHandler(this.TroubleshootRPCConfirmationHandler), (string)null, false, (object)null, true);
         customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)null, (string)null, false, (object)null, true);
         customMessageWindow.Owner = (Window)this;
         customMessageWindow.ShowDialog();
     }
     else
     {
         if (!subCategory.Contains("StuckOnLoading") && !subCategory.Contains("GreyScreen"))
         {
             return;
         }
         Logger.Info("Stuck on loading detected");
         CustomMessageWindow customMessageWindow = new CustomMessageWindow();
         customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_STUCK_AT_INITIALIZING_FORM", "");
         customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_TROUBLESHOOTER", "");
         customMessageWindow.AddButton(ButtonColors.Blue, LocaleStrings.GetLocalizedString("STRING_RESOLVE_AUTOMATIC", ""), new EventHandler(this.TroubleshootStuckConfirmationHandler), (string)null, false, (object)null, true);
         customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)null, (string)null, false, (object)null, true);
         customMessageWindow.Owner = (Window)this;
         customMessageWindow.ShowDialog();
     }
 }
예제 #12
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();
        }
예제 #13
0
 private void DiskCleanupBtn_Click(object sender, RoutedEventArgs e)
 {
     this.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
     {
         if (ProcessUtils.IsAlreadyRunning("Global\\BlueStacks_DiskCompactor_Lockbgp"))
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.ImageName = "disk_cleanup_popup_window";
             customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MULTIPLE_RUN_HEADING", "");
             customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MULTIPLE_RUN_MESSAGE", "");
             customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true);
             customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null);
             customMessageWindow.Owner = (Window)this.ParentWindow;
             customMessageWindow.ShowDialog();
         }
         else
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.ImageName = "disk_cleanup_popup_window";
             customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP", "");
             customMessageWindow.BodyTextBlockTitle.Text = LocaleStrings.GetLocalizedString("STRING_DISK_CLEANUP_MESSAGE", "");
             customMessageWindow.BodyTextBlockTitle.Visibility = Visibility.Visible;
             customMessageWindow.BodyTextBlockTitle.FontWeight = FontWeights.Regular;
             customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_CONTINUE_CONFIRMATION", "");
             customMessageWindow.AddButton(ButtonColors.White, "STRING_CLOSE", (EventHandler)null, (string)null, false, (object)null, true);
             customMessageWindow.AddButton(ButtonColors.Blue, "STRING_CONTINUE", (EventHandler)((sender1, e1) => this.LaunchDiskCompaction(sender, (MouseButtonEventArgs)null)), (string)null, false, (object)null, true);
             customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null);
             customMessageWindow.Owner = (Window)this.ParentWindow;
             customMessageWindow.ShowDialog();
         }
     }));
 }
        private void CustomMessage_Click(object sender, RoutedEventArgs e)
        {
            CustomMessageWindow customMessage = new CustomMessageWindow();

            customMessage.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            customMessage.Owner = this;
            customMessage.Show();
        }
예제 #15
0
        static void Main(string[] args)
        {
            if (Settings.Default.FirstRun)
            {
                if (!Utils.CheckRegistration())
                {
                    using (Register reg = new Register())
                    {
                        if (DialogResult.OK == reg.ShowDialog())
                        {
                            // all good here
                        }
                    }
                }
                Settings.Default.FirstRun = false;
            }
            _callerQ = new Sideline();

            IntPtr hwnd = Win32.FindWindow(null, "sidelineMsg");

            Win32.SetSystemPowerState(null, Win32.POWER_STATE_ON, Win32.POWER_FORCE);
            using (CustomMessageWindow window = new CustomMessageWindow())
            {
                window.Text    = "sidelineMsg";
                _callerQ.Load += new EventHandler(_callerQ_Load_Notify);

                for (int i = 0; i < args.Length; i += 2)
                {
                    string arg = args[i].ToLower();

                    if (args.Length > i + 1 && arg.Length > 1 && (arg[0] == '-' || arg[0] == '/'))
                    {
                        string command = arg.Substring(1);
                        string value   = args[i + 1];

                        switch (command)
                        {
                        case "oid":
                        {
                            _oid           = Convert.ToInt32(value);
                            _callerQ.Load += new EventHandler(_callerQ_Load_Oid);
                        }
                        break;
                            //case "notify":
                            //    {
                            //        _callerQ.Load += new EventHandler(_callerQ_Load_Notify);
                            //    }
                            //    break;
                        }
                    }
                }

                Application.Run(_callerQ);
                SetNotification();
            }
        }
예제 #16
0
 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);
     }
 }
예제 #17
0
        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();
        }
예제 #18
0
 private void UninstallButtonClicked()
 {
     try
     {
         if (this.mAppIconModel.IsDownloading)
         {
             if (this.mDownloader == null)
             {
                 return;
             }
             this.mDownloader.AbortApkDownload(this.mAppIconModel.PackageName);
             this.ParentWindow.mWelcomeTab.mHomeAppManager.RemoveAppIcon(this.mAppIconModel.PackageName, (AppIconModel)null);
         }
         else if (this.mAppIconModel.IsInstalling)
         {
             if (!this.mAppIconModel.IsInstallingFailed)
             {
                 return;
             }
             this.ParentWindow.mWelcomeTab.mHomeAppManager.RemoveAppIcon(this.mAppIconModel.PackageName, (AppIconModel)null);
         }
         else if (this.mAppIconModel.IsAppSuggestionActive)
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_REMOVE_ICON", "");
             customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_ICON_REMOVE", "");
             customMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_REMOVE", ""), new EventHandler(this.RemoveAppSuggestion), (string)null, false, (object)null, true);
             customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_KEEP", ""), (EventHandler)null, (string)null, false, (object)null, true);
             customMessageWindow.Owner = (Window)this.ParentWindow;
             this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
             customMessageWindow.ShowDialog();
             this.ParentWindow.HideDimOverlay();
         }
         else
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_UNINSTALL_0", ""), (object)this.mAppIconModel.AppName);
             customMessageWindow.BodyTextBlock.Text  = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_UNINSTALL_0_BS", ""), (object)this.mAppIconModel.AppName);
             customMessageWindow.AddButton(ButtonColors.Red, "STRING_UNINSTALL", (EventHandler)((o, e) => this.AppIcon_UninstallConfirmationClicked(o, e)), (string)null, false, (object)null, true);
             customMessageWindow.AddButton(ButtonColors.White, "STRING_NO", (EventHandler)null, (string)null, false, (object)null, true);
             this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
             customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay;
             customMessageWindow.ShowDialog();
             this.ParentWindow.HideDimOverlay();
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Exception in UninstallButtonClicked. Err : " + ex.ToString());
     }
 }
예제 #19
0
 internal void Init(
     string args,
     string appName,
     PlayStoreAction action,
     bool isWindowForcedTillLoaded = false)
 {
     this.Dispatcher.Invoke((Delegate)(() =>
     {
         if (!this.ParentWindow.mGuestBootCompleted)
         {
             CustomMessageWindow customMessageWindow = new CustomMessageWindow();
             BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_POST_OTS_SYNCING_BUTTON_MESSAGE", "");
             BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_GUEST_NOT_BOOTED", "");
             customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true);
             customMessageWindow.Owner = (Window)this.ParentWindow;
             customMessageWindow.ShowDialog();
         }
         else if (action == PlayStoreAction.OpenApp && this.ParentWindow.mAppHandler.IsAppInstalled(args) && !"com.android.vending".Equals(args, StringComparison.InvariantCultureIgnoreCase))
         {
             AppIconModel appIcon = this.ParentWindow.mWelcomeTab.mHomeAppManager.GetAppIcon(args);
             if (appIcon == null)
             {
                 return;
             }
             if (appIcon.AppIncompatType != AppIncompatType.None && !this.ParentWindow.mTopBar.mAppTabButtons.mDictTabs.ContainsKey(appIcon.PackageName))
             {
                 GrmHandler.HandleCompatibility(appIcon.PackageName, this.ParentWindow.mVmName);
             }
             else
             {
                 this.ParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, true, true, false);
             }
         }
         else
         {
             if (string.IsNullOrEmpty(args))
             {
                 return;
             }
             if (!this.ParentWindow.WelcomeTabParentGrid.IsVisible)
             {
                 this.ParentWindow.mCommonHandler.HomeButtonHandler(false, false);
             }
             this.mBaseControl.mTitleLabel.Content = (object)appName;
             this.mAction = action;
             this.Visibility = Visibility.Visible;
             this.ParentWindow.ChangeOrientationFromClient(false, false);
             this.ProcessArgs(args, isWindowForcedTillLoaded);
         }
     }));
 }
예제 #20
0
        private void RevertBtnClick(object sender, RoutedEventArgs e)
        {
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_RESTORE_DEFAULTS", "");
            customMessageWindow.BodyTextBlock.Text  = LocaleStrings.GetLocalizedString("STRING_RESTORE_SHORTCUTS", "");
            customMessageWindow.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_RESTORE_BUTTON", ""), (EventHandler)((o, evt) =>
            {
                this.RestoreDefaultShortcuts();
                this.mRevertBtn.IsEnabled = false;
            }), (string)null, false, (object)null, true);
            customMessageWindow.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CANCEL", ""), (EventHandler)((o, evt) => {}), (string)null, false, (object)null, true);
            customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null);
            customMessageWindow.Owner = (Window)this.ParentWindow;
            customMessageWindow.ShowDialog();
        }
예제 #21
0
 private static void GrmExceptionMessageBox(MainWindow ParentWindow)
 {
     ParentWindow.Dispatcher.Invoke((Delegate)(() =>
     {
         ParentWindow.mFrontendGrid.Visibility = Visibility.Visible;
         ParentWindow.mExitProgressGrid.Visibility = Visibility.Hidden;
         CustomMessageWindow customMessageWindow = new CustomMessageWindow();
         customMessageWindow.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_ERROR", "");
         customMessageWindow.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_GRM_EXCEPTION_MESSAGE", "");
         customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true);
         customMessageWindow.Owner = (Window)ParentWindow;
         ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
         customMessageWindow.ShowDialog();
         ParentWindow.HideDimOverlay();
     }));
 }
예제 #22
0
        private void SetDefaultGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (!File.Exists(HomeAppManager.BackgroundImagePath))
            {
                return;
            }
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_LBL_RESTORE_DEFAULT", "");
            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_RESTORE_DEFAULT_WALLPAPER", "");
            customMessageWindow.AddButton(ButtonColors.Red, "STRING_RESTORE_BUTTON", this.RestoreDefaultConfirmationClicked, (string)null, false, (object)null, true);
            customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true);
            this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
            customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay;
            customMessageWindow.ShowDialog();
            this.ParentWindow.HideDimOverlay();
        }
예제 #23
0
        private void HandleRerollClick()
        {
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_REROLL_0", ""), (object)this.mAppIconModel.AppName);
            customMessageWindow.BodyTextBlock.Text  = string.Format((IFormatProvider)CultureInfo.InvariantCulture, LocaleStrings.GetLocalizedString("STRING_START_REROLL", ""), (object)this.mAppIconModel.AppName);
            customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", (EventHandler)null, (string)null, false, (object)null, true);
            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_REROLL_APP_PREFIX", new EventHandler(this.StartRerollAccepted), (string)null, false, (object)null, true);
            this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
            customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay;
            customMessageWindow.ShowDialog();
            if (customMessageWindow.ClickedButton == ButtonColors.White)
            {
                return;
            }
            this.ParentWindow.HideDimOverlay();
        }
예제 #24
0
        private void CancelDownloadConfirmation(object sender, EventArgs e)
        {
            MainWindow mainWindow = (MainWindow)null;

            if (BlueStacksUIUtils.DictWindows.Count > 0)
            {
                mainWindow = BlueStacksUIUtils.DictWindows.Values.First <MainWindow>();
            }
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_DOWNLOAD_IN_PROGRESS", "");
            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_BTV_DOWNLOAD_CANCEL", "");
            customMessageWindow.AddButton(ButtonColors.Red, "STRING_CANCEL", new EventHandler(this.CancelBTvDownload), (string)null, false, (object)null, true);
            customMessageWindow.AddButton(ButtonColors.White, "STRING_CONTINUE", (EventHandler)null, (string)null, false, (object)null, true);
            customMessageWindow.Owner = (Window)mainWindow;
            customMessageWindow.ShowDialog();
        }
예제 #25
0
        internal void ShowPromptAndHideOverlay()
        {
            if (this.Visibility != Visibility.Visible)
            {
                return;
            }
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_REROLL_COMPLETED", "");
            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_REROLL_COMPLETED_SUCCESS", "");
            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true);
            this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
            customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay;
            customMessageWindow.ShowDialog();
            this.ParentWindow.HideDimOverlay();
            this.HideOverlay();
        }
 private static void Downloader_DownloadException(Exception e)
 {
     Logger.Error("Failed to download file: {0}. err: {1}", (object)BlueStacksUpdater.sBstUpdateData.DownloadUrl, (object)e.Message);
     BlueStacksUpdater.ParentWindow.Dispatcher.Invoke((Delegate)(() =>
     {
         CustomMessageWindow customMessageWindow = new CustomMessageWindow();
         BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, "STRING_UPGRADE_FAILED", "");
         BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, "STRING_SOME_ERROR_OCCURED_DOWNLOAD", "");
         customMessageWindow.AddButton(ButtonColors.Blue, "STRING_RETRY", new EventHandler(BlueStacksUpdater.RetryDownload), (string)null, false, (object)null, true);
         customMessageWindow.AddButton(ButtonColors.White, "STRING_CANCEL", new EventHandler(BlueStacksUpdater.DownloadCancelled), (string)null, false, (object)null, true);
         BlueStacksUpdater.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
         customMessageWindow.Owner = (Window)BlueStacksUpdater.ParentWindow.mDimOverlay;
         customMessageWindow.ShowDialog();
         BlueStacksUpdater.ParentWindow.HideDimOverlay();
         BlueStacksUpdater.sUpdateDownloadProgress.Hide();
     }));
 }
예제 #27
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());
     }
 }
예제 #28
0
        private void mUpgradeToFullBlueStacks_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            string localizedString = LocaleStrings.GetLocalizedString("STRING_UPGRADE_TO_STANDARD_BST", "");
            string str             = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0} {1}", (object)LocaleStrings.GetLocalizedString("STRING_CONTINUING_WILL_UPGRADE_TO_STD_BST", ""), (object)LocaleStrings.GetLocalizedString("STRING_LAUNCH_BLUESTACKS_FROM_DESK_SHORTCUT", ""));
            string path1           = localizedString.Replace(GameConfig.Instance.AppName, "BlueStacks");
            string path2           = str.Replace(GameConfig.Instance.AppName, "BlueStacks");
            CustomMessageWindow customMessageWindow = new CustomMessageWindow();

            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_YES", new EventHandler(this.UpgradeToFullBstHandler), (string)null, false, (object)null, true);
            customMessageWindow.AddButton(ButtonColors.White, "STRING_NO", (EventHandler)null, (string)null, false, (object)null, true);
            BlueStacksUIBinding.Bind(customMessageWindow.TitleTextBlock, path1, "");
            BlueStacksUIBinding.Bind(customMessageWindow.BodyTextBlock, path2, "");
            this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
            customMessageWindow.Owner = (Window)this.ParentWindow.mDimOverlay;
            customMessageWindow.ShowDialog();
            this.ParentWindow.HideDimOverlay();
            ClientStats.SendMiscellaneousStatsAsync("hamburgerMenu", RegistryManager.Instance.UserGuid, "UpgradeBlueStacks", "MouseClick", RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, RegistryManager.Instance.Oem, (string)null, (string)null, "Android");
        }
        internal void FrontendHandler_ShowLowRAMMessage()
        {
            if (!this.ParentWindow?.IsLoaded.GetValueOrDefault())
            {
                return;
            }
            CustomMessageWindow cmw = new CustomMessageWindow();

            cmw.TitleTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_PERF_WARNING", "");
            cmw.AddWarning(LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TITLE", ""), "message_error");
            cmw.BodyTextBlock.Text = LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TEXT1", "") + Environment.NewLine + LocaleStrings.GetLocalizedString("STRING_LOW_AVAILABLE_RAM_TEXT2", "");
            cmw.AddButton(ButtonColors.Red, LocaleStrings.GetLocalizedString("STRING_CONTINUE_ANYWAY", ""), (EventHandler)((o, args) => cmw.Close()), (string)null, false, (object)null, true);
            cmw.AddButton(ButtonColors.White, LocaleStrings.GetLocalizedString("STRING_CLOSE_BLUESTACKS", ""), (EventHandler)((o, args) => this.ParentWindow.Close()), (string)null, false, (object)null, true);
            this.ParentWindow.ShowDimOverlay((IDimOverlayControl)null);
            cmw.Owner = (Window)this.ParentWindow.mDimOverlay;
            cmw.ShowDialog();
            this.ParentWindow.HideDimOverlay();
        }
예제 #30
0
        private static void CheckIfAlreadyRunning()
        {
            try
            {
                if (ProcessUtils.IsAlreadyRunning("Global\\BlueStacks_DiskCompactor_Lockbgp"))
                {
                    Logger.Info("Disk compaction is running in background");
                    foreach (string str in GetProcessExecutionPath.GetApplicationPath(Process.GetProcessesByName("DiskCompactionTool")))
                    {
                        if (str.Equals(Path.Combine(RegistryStrings.InstallDir, "DiskCompactionTool.exe"), StringComparison.InvariantCultureIgnoreCase))
                        {
                            CustomMessageWindow customMessageWindow = new CustomMessageWindow()
                            {
                                ImageName = "ProductLogo"
                            };
                            customMessageWindow.TitleTextBlock.Text = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}", (object)LocaleStrings.GetLocalizedString("STRING_EXIT_BLUESTACKS_DUE_TO_DISK_COMPACTION_HEADING", ""));
                            customMessageWindow.BodyTextBlock.Text  = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}", (object)LocaleStrings.GetLocalizedString("STRING_EXIT_BLUESTACKS_DUE_TO_DISK_COMPACTION_MESSAGE", ""));
                            customMessageWindow.AddButton(ButtonColors.Blue, "STRING_OK", (EventHandler)null, (string)null, false, (object)null, true);
                            customMessageWindow.CloseButtonHandle((Predicate <object>)null, (object)null);
                            customMessageWindow.ShowDialog();
                            Logger.Info("Disk compaction running for this instance. Exiting this instance");
                            App.ExitApplication();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Failed to check if disk compaction is running: " + ex.Message);
            }
            string runningProcName;

            if (ProcessUtils.IsAnyInstallerProcesRunning(out runningProcName) && !string.IsNullOrEmpty(runningProcName))
            {
                Logger.Info(runningProcName + " process is running. Exiting BlueStacks MultiInstance Manager");
                Environment.Exit(-1);
            }
            if (!ProcessUtils.CheckAlreadyRunningAndTakeLock("Global\\BlueStacks_MultiInstanceManager_Lockbgp", out App.sMultiInstanceManagerLock))
            {
                return;
            }
            Utils.BringToFront("BlueStacks Multi-Instance Manager");
            App.ExitApplication();
        }
예제 #31
0
파일: Program.cs 프로젝트: nbclark/sideline
        static void Main(string[] args)
        {
            if (Settings.Default.FirstRun)
            {
                if (!Utils.CheckRegistration())
                {
                    using (Register reg = new Register())
                    {
                        if (DialogResult.OK == reg.ShowDialog())
                        {
                            // all good here
                        }
                    }
                }
                Settings.Default.FirstRun = false;
            }
            _callerQ = new Sideline();

            IntPtr hwnd = Win32.FindWindow(null, "sidelineMsg");
            Win32.SetSystemPowerState(null, Win32.POWER_STATE_ON, Win32.POWER_FORCE);
            using (CustomMessageWindow window = new CustomMessageWindow())
            {
                window.Text = "sidelineMsg";
                _callerQ.Load += new EventHandler(_callerQ_Load_Notify);

                for (int i = 0; i < args.Length; i+=2)
                {
                    string arg = args[i].ToLower();

                    if (args.Length > i+1 && arg.Length > 1 && (arg[0] == '-' || arg[0] == '/'))
                    {
                        string command = arg.Substring(1);
                        string value = args[i + 1];

                        switch (command)
                        {
                            case "oid":
                                {
                                    _oid = Convert.ToInt32(value);
                                    _callerQ.Load += new EventHandler(_callerQ_Load_Oid);
                                }
                                break;
                            //case "notify":
                            //    {
                            //        _callerQ.Load += new EventHandler(_callerQ_Load_Notify);
                            //    }
                            //    break;
                        }
                    }
                }

                Application.Run(_callerQ);
                SetNotification();
            }
        }