public void Load() { MainFolder = new StorageDirectory(RemoteResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("Banners")); AdditionalFolder = new StorageDirectory(RemoteResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("Banners_2")); FavsFolder = new StorageDirectory(RemoteResourceManager.Instance.AppSharedSettingsFolder.RelativePathParts.Merge("Favorite_Banners")); Items.Clear(); SourceFolderImageGroup sourceFolderImageGroup = new RegularImageGroup(this); sourceFolderImageGroup.Name = "Gallery"; sourceFolderImageGroup.Order = -3; if (MainFolder.ExistsLocal()) sourceFolderImageGroup.LoadImages<Banner>(MainFolder.LocalPath); Items.Add(sourceFolderImageGroup); var searchResultsimageGroup = new SearchResultsImageGroup(this); searchResultsimageGroup.Name = "Search Results"; searchResultsimageGroup.Order = -2; Items.Add(searchResultsimageGroup); sourceFolderImageGroup = new FavoriteImageGroup(this); sourceFolderImageGroup.Name = "My Favorites"; sourceFolderImageGroup.Order = -1; if (FavsFolder.ExistsLocal()) sourceFolderImageGroup.LoadImages<Banner>(FavsFolder.LocalPath); Items.Add(sourceFolderImageGroup); if (AdditionalFolder.ExistsLocal()) { var contentDescriptionPath = Path.Combine(AdditionalFolder.LocalPath, "order.txt"); if (File.Exists(contentDescriptionPath)) { var groupNames = File.ReadAllLines(contentDescriptionPath); var groupIndex = 0; foreach (var groupName in groupNames) { if (String.IsNullOrEmpty(groupName)) continue; var groupFolderPath = Path.Combine(AdditionalFolder.LocalPath, groupName); if (!Directory.Exists(groupFolderPath)) continue; sourceFolderImageGroup = new RegularImageGroup(this); sourceFolderImageGroup.Name = groupName; sourceFolderImageGroup.Order = groupIndex; sourceFolderImageGroup.LoadImages<Banner>(groupFolderPath); Items.Add(sourceFolderImageGroup); groupIndex++; } } } Items.Sort((x, y) => x.Order.CompareTo(y.Order)); }
public void Load() { MainFolder = new StorageDirectory(RemoteResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("link_bundle_icons")); AdditionalFolder = new StorageDirectory(RemoteResourceManager.Instance.ArtworkFolder.RelativePathParts.Merge("link_bundle_icons_2")); FavsFolder = new StorageDirectory(RemoteResourceManager.Instance.AppAliasSettingsFolder.RelativePathParts.Merge("Favorite Link Bundle Icons")); DefaultPowerPointLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_pptx.png")); DefaultWordLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_docx.png")); DefaultExcelLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_xlsx.png")); DefaultPdfLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_pdf.png")); DefaultVideoLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_mp4.png")); DefaultImageLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_image.png")); DefaultInfoLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_info.png")); DefaultRevenueLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_revenue.png")); DefaultStrategyLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_sales_strategy.png")); DefaultUrlLogo = new StorageFile(MainFolder.RelativePathParts.Merge("default_url.png")); Items.Clear(); SourceFolderImageGroup sourceFolderImageGroup = new RegularImageGroup(this); sourceFolderImageGroup.Name = "Gallery"; sourceFolderImageGroup.Order = -2; if (MainFolder.ExistsLocal()) sourceFolderImageGroup.LoadImages<Widget>(MainFolder.LocalPath); Items.Add(sourceFolderImageGroup); sourceFolderImageGroup = new FavoriteImageGroup(this); sourceFolderImageGroup.Name = "My Favorites"; sourceFolderImageGroup.Order = -1; if (FavsFolder.ExistsLocal()) sourceFolderImageGroup.LoadImages<Widget>(FavsFolder.LocalPath); Items.Add(sourceFolderImageGroup); Items.Sort((x, y) => x.Order.CompareTo(y.Order)); }