private void MoreAppsIcon_Click(object sender, RoutedEventArgs e) { AppIconUI appIconUi = sender as AppIconUI; this.mDockAppIconToolTipPopup.IsOpen = false; this.mMoreAppsDockPopup.PlacementTarget = (UIElement)appIconUi.mAppImage; this.mMoreAppsDockPopup.IsOpen = true; }
internal void InitMoreAppsIcon() { AppIconModel model = new AppIconModel(); model.AppName = LocaleStrings.GetLocalizedString("STRING_MORE_APPS", ""); model.ImageName = "moreapps"; model.AddToDock(50.0, 50.0); this.moreAppsIcon = new AppIconUI(this.ParentWindow, model); this.moreAppsIcon.Click += new RoutedEventHandler(this.MoreAppsIcon_Click); this.mDockPanel.Children.Add((UIElement)this.moreAppsIcon); }
private AppIconUI GetNewAppIconUI( AppIconModel iconModel, DownloadInstallApk downloadInstallApk = null) { AppIconUI appIconUi = new AppIconUI(this.ParentWindow, iconModel); if (downloadInstallApk != null) { appIconUi.InitAppDownloader(downloadInstallApk); } return(appIconUi); }
internal void ShowDockIconTooltip(AppIconUI icon, bool isOpen) { if (this.mHomeApp == null) { return; } if (isOpen) { this.mHomeApp.mDockIconText.Text = icon.mAppIconModel.AppName; this.mHomeApp.mDockAppIconToolTipPopup.PlacementTarget = (UIElement)icon.mAppImage; this.mHomeApp.mDockAppIconToolTipPopup.IsOpen = true; this.mHomeApp.mDockAppIconToolTipPopup.StaysOpen = true; } else { this.mHomeApp.mDockAppIconToolTipPopup.IsOpen = false; } }
internal void AddInstallDrawerIcon(AppIconModel icon, DownloadInstallApk downloadInstallApk = null) { int index = 0; foreach (AppIconUI appIconUi in this.InstalledAppsDrawer.Children.OfType <AppIconUI>()) { if (appIconUi.mAppIconModel.MyAppPriority <= icon.MyAppPriority) { ++index; } else { break; } } AppIconUI newAppIconUi = this.GetNewAppIconUI(icon, downloadInstallApk); this.InstalledAppsDrawer.Children.Insert(index, (UIElement)newAppIconUi); }
private void RemoveAppSuggestion(object sender, EventArgs e) { this.ParentWindow.mWelcomeTab.mHomeAppManager.RemoveAppIcon(this.mAppIconModel.PackageName, (AppIconModel)null); ClientStats.SendMiscellaneousStatsAsync("cross_promotion_icon_removed", RegistryManager.Instance.UserGuid, RegistryManager.Instance.ClientVersion, RegistryManager.Instance.Version, this.mAppIconModel.PackageName, "bgp", (string)null, (string)null, (string)null, "Android"); try { XmlWriterSettings settings = new XmlWriterSettings() { OmitXmlDeclaration = true, Indent = true }; XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(new XmlQualifiedName[1] { new XmlQualifiedName("", "") }); string str = System.IO.Path.Combine(RegistryStrings.PromotionDirectory, "app_suggestion_removed"); string data = ""; if (File.Exists(str)) { data = File.ReadAllText(str); } List <string> stringList = new List <string>(); if (!string.IsNullOrEmpty(data)) { stringList = AppIconUI.DoDeserialize <List <string> >(data); } if (!stringList.Contains(this.mAppIconModel.PackageName)) { if (stringList.Count >= 20) { stringList.RemoveAt(0); } stringList.Add(this.mAppIconModel.PackageName); } using (XmlWriter xmlWriter = XmlWriter.Create(str, settings)) new XmlSerializer(typeof(List <string>)).Serialize(xmlWriter, (object)stringList, namespaces); } catch (Exception ex) { Logger.Error("Error in writing removed suggested app icon package name in file " + ex.ToString()); } }
internal void AddDockPanelIcon(AppIconModel icon, DownloadInstallApk downloadInstallApk = null) { int index = 0; foreach (AppIconUI appIconUi in this.mDockPanel.Children.OfType <AppIconUI>()) { if (appIconUi.mAppIconModel.MyAppPriority <= icon.MyAppPriority) { ++index; } else { break; } } AppIconUI newAppIconUi = this.GetNewAppIconUI(icon, downloadInstallApk); this.mDockPanel.Children.Insert(index, (UIElement)newAppIconUi); this.mDockPanel.Children.Remove((UIElement)this.moreAppsIcon); this.mDockPanel.Children.Add((UIElement)this.moreAppsIcon); }