Example #1
0
        private void LoadPlaces(IPlace[] places)
        {
            BrowseList.Clear();

            exploreText.Text = "Collections > " + "KML Collection";
            List <object> items = new List <object>();

            foreach (IPlace place in places)
            {
                items.Add(place);
            }
            BrowseList.AddRange(items);
            this.Refresh();
        }
Example #2
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();
        }