示例#1
0
        internal void AddHomeTab()
        {
            Logger.Info("Test logs: AddHomeTab()");
            AppTabButton appTabButton = new AppTabButton();

            this.mHomeAppTabButton = appTabButton;
            this.mPanel.Children.Insert(0, (UIElement)appTabButton);
            appTabButton.Init("STRING_HOME", "Home", string.Empty, "home", this.ParentWindow.WelcomeTabParentGrid, "Home");
            BlueStacksUIBinding.Bind(appTabButton.mTabLabel, "STRING_HOME");
            appTabButton.MouseUp += new MouseButtonEventHandler(this.AppTabButton_MouseUp);
            this.mDictTabs[appTabButton.PackageName] = appTabButton;
            if (RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition)
            {
                appTabButton.Visibility = Visibility.Collapsed;
            }
            this.ResizeTabs();
            this.GoToTab("Home", false, false);
        }
示例#2
0
 internal void AddWebTab(
     string url,
     string tabName,
     string imageName,
     bool isSwitch,
     string tabKey     = "",
     bool forceRefresh = false)
 {
     if (FeatureManager.Instance.IsCustomUIForNCSoft)
     {
         return;
     }
     if (RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition)
     {
         Process.Start(url);
     }
     else
     {
         bool flag = false;
         if (!string.IsNullOrEmpty(tabKey))
         {
             flag = true;
         }
         if (this.mDictTabs.ContainsKey(flag ? tabKey : url))
         {
             if (this.mDictTabs[flag ? tabKey : url].GetBrowserControl() == null)
             {
                 this.mDictTabs[tabKey].mControlGrid = this.ParentWindow.AddBrowser(url);
                 this.mDictTabs[tabKey].Init(tabName, url, imageName, this.mDictTabs[tabKey].mControlGrid, tabKey);
             }
             if (flag && string.Compare(url, this.mDictTabs[tabKey].PackageName, StringComparison.OrdinalIgnoreCase) != 0)
             {
                 BrowserControl browserControl = this.mDictTabs[tabKey].GetBrowserControl();
                 this.mDictTabs[tabKey].Init(tabName, url, imageName, this.mDictTabs[tabKey].mControlGrid, tabKey);
                 browserControl?.UpdateUrlAndRefresh(url);
             }
             else if (forceRefresh)
             {
                 BrowserControl browserControl = this.mDictTabs[flag ? tabKey : url].GetBrowserControl();
                 browserControl.UpdateUrlAndRefresh(browserControl.mUrl);
             }
             this.GoToTab(flag ? tabKey : url, true, false);
         }
         else
         {
             AppTabButton button      = new AppTabButton();
             Grid         controlGrid = this.ParentWindow.AddBrowser(url);
             controlGrid.Visibility = Visibility.Visible;
             button.Init(tabName, url, imageName, controlGrid, flag ? tabKey : url);
             button.MouseUp += new MouseButtonEventHandler(this.AppTabButton_MouseUp);
             if (this.ParentWindow.mDiscordhandler != null)
             {
                 this.ParentWindow.mDiscordhandler.AssignTabChangeEvent(button);
             }
             this.mDictTabs.Add(flag ? tabKey : url, button);
             this.mPanel.Children.Add((UIElement)button);
             this.ResizeTabs();
             if (isSwitch)
             {
                 this.GoToTab(flag ? tabKey : url, true, false);
             }
             ClientStats.SendMiscellaneousStatsAsync("WebTabLaunched", RegistryManager.Instance.UserGuid, url, button.AppLabel, RegistryManager.Instance.Version, Oem.Instance.OEM, (string)null, (string)null, (string)null, "Android");
         }
     }
 }
示例#3
0
 internal void AddAppTab(
     string appName,
     string packageName,
     string activityName,
     string imageName,
     bool isSwitch,
     bool isLaunch,
     bool receivedFromImap = false)
 {
     this.DoExtraHandlingForApp(packageName);
     if (PostBootCloudInfoManager.Instance.mPostBootCloudInfo?.GameNotificationAppPackages?.NotificationModeAppPackages?.IsPackageAvailable(packageName).GetValueOrDefault())
     {
         this.ParentWindow.EngineInstanceRegistry.LastNotificationEnabledAppLaunched = packageName;
     }
     if (this.mDictTabs.ContainsKey(packageName))
     {
         this.GoToTab(packageName, isLaunch, receivedFromImap);
     }
     else
     {
         AppTabButton selectedTabButton = this.ParentWindow.StaticComponents.mSelectedTabButton;
         AppTabButton button            = new AppTabButton();
         button.Init(appName, packageName, activityName, imageName, this.ParentWindow.FrontendParentGrid, packageName);
         button.MouseUp += new MouseButtonEventHandler(this.AppTabButton_MouseUp);
         if (this.ParentWindow.mDiscordhandler != null)
         {
             this.ParentWindow.mDiscordhandler.AssignTabChangeEvent(button);
         }
         if (Oem.IsOEMDmm && this.ParentWindow.mDmmBottomBar != null)
         {
             button.EventOnTabChanged += new EventHandler <TabChangeEventArgs>(this.ParentWindow.mDmmBottomBar.Tab_Changed);
         }
         this.mDictTabs.Add(packageName, button);
         this.mPanel.Children.Add((UIElement)button);
         if (Oem.Instance.SendAppClickStatsFromClient)
         {
             ThreadPool.QueueUserWorkItem((WaitCallback)(obj =>
             {
                 AppInfo infoFromPackageName = new JsonParser(this.ParentWindow.mVmName).GetAppInfoFromPackageName(packageName);
                 string appVersion = string.Empty;
                 string appVersionName = string.Empty;
                 if (infoFromPackageName != null)
                 {
                     if (!string.IsNullOrEmpty(infoFromPackageName.Version))
                     {
                         appVersion = infoFromPackageName.Version;
                     }
                     if (!string.IsNullOrEmpty(infoFromPackageName.VersionName))
                     {
                         appVersionName = infoFromPackageName.VersionName;
                     }
                 }
                 BlueStacks.Common.Stats.SendAppStats(appName, packageName, appVersion, "HomeVersionNotKnown", BlueStacks.Common.Stats.AppType.app, this.ParentWindow.mVmName, appVersionName);
             }));
         }
         if (RegistryManager.Instance.InstallationType == InstallationTypes.GamingEdition)
         {
             button.Visibility = Visibility.Collapsed;
         }
         else if (selectedTabButton != null && selectedTabButton.IsPortraitModeTab && selectedTabButton.mTabType == TabType.AppTab)
         {
             button.IsPortraitModeTab = true;
         }
         this.ResizeTabs();
         GrmHandler.RefreshGrmIndicationForAllInstances(packageName);
         Publisher.PublishMessage(BrowserControlTags.currentlyRunningApps, this.ParentWindow.mVmName, new JObject((object)new JProperty("packages", (object)new JArray((object)this.mDictTabs.Values.Select <AppTabButton, string>((Func <AppTabButton, string>)(_ => _.TabKey))))));
         if (!isSwitch)
         {
             return;
         }
         this.GoToTab(packageName, isLaunch, receivedFromImap);
     }
 }