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); } })); }
internal void OpenFrontendAppTabControl(string packageName, PlayStoreAction action) { this.Dispatcher.Invoke((Delegate)(() => { if (action == PlayStoreAction.OpenApp && this.ParentWindow.mAppHandler.IsAppInstalled(packageName) && !"com.android.vending".Equals(packageName, StringComparison.InvariantCultureIgnoreCase)) { AppIconModel appIcon = this.mHomeAppManager.GetAppIcon(packageName); if (appIcon == null) { return; } if (appIcon.AppIncompatType != AppIncompatType.None && !this.ParentWindow.mTopBar.mAppTabButtons.mDictTabs.ContainsKey(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(packageName)) { return; } AppIconModel appIcon = this.mHomeAppManager.GetAppIcon("com.android.vending"); if (appIcon == null) { return; } if (action == PlayStoreAction.OpenApp) { this.ParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, false, true, false); this.ParentWindow.mAppHandler.SwitchWhenPackageNameRecieved = "com.android.vending"; this.ParentWindow.mAppHandler.LaunchPlayRequestAsync(packageName); } else { if (action != PlayStoreAction.SearchApp) { return; } this.ParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, false, true, false); this.ParentWindow.mAppHandler.SwitchWhenPackageNameRecieved = "com.android.vending"; this.ParentWindow.mAppHandler.SendSearchPlayRequestAsync(packageName); } } })); }