private void LoadTopLevel() { BrowseList.Clear(); exploreText.Text = "Collections"; topLevel = true; if (!Directory.Exists(Properties.Settings.Default.CahceDirectory + @"thumbnails\")) { Directory.CreateDirectory(Properties.Settings.Default.CahceDirectory + @"thumbnails\"); } AddCollectionFolders(); ArrayList dataSets = DataSetManager.GetDataSets(); foreach (DataSet d in dataSets) { // Todo Change this to exploere earth, moon etc. if (d.Sky == true) { if (d != null) { ArrayList placesList = d.GetPlaces(); foreach (Places places in placesList) { if (places != null && places.Browseable) { ThumbMenuNode node = new ThumbMenuNode(); node.Name = places.Name; node.Places = places; //string filename = places.ThumbnailUrl.Substring(places.ThumbnailUrl.LastIndexOf("/") + 1); //DataSetManager.DownloadFile(places.ThumbnailUrl, Properties.Settings.Default.CahceDirectory + @"thumbnails\" + filename, true); //node.ThumbNail = UiTools.LoadBitmap(Properties.Settings.Default.CahceDirectory + @"thumbnails\" + filename); node.ThumbNail = UiTools.LoadThumbnailFromWeb(places.ThumbnailUrl); BrowseList.Add(node); } } } } } Refresh(); }
private void AddCollectionFolders() { BrowseList.Add(MyCollections); }