Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 private void AddCollectionFolders()
 {
     BrowseList.Add(MyCollections);
 }