public static void AddCatalogs(bool sky)
        {
            Dictionary <string, DataSet> dataSets = DataSetManager.GetDataSets();

            foreach (DataSet d in dataSets.Values)
            {
                if (d.Sky == sky)
                {
                    if (d != null)
                    {
                        Dictionary <string, Places> placesList = d.GetPlaces();
                        foreach (Places places in placesList.Values)
                        {
                            if (places != null)
                            {
                                ArrayList placeList = places.GetPlaceList();
                                foreach (IPlace place in placeList)
                                {
                                    if (place.StudyImageset != null && (place.StudyImageset.Projection == ProjectionType.Toast || place.StudyImageset.Projection == ProjectionType.Equirectangular))
                                    {
                                        continue;
                                    }
                                    AddPlaceToContextSearch(place);
                                }
                            }
                        }
                    }
                }
            }
        }
        public static IThumbnail GetDataSetsAsFolder()
        {
            ThumbMenuNode parent = new ThumbMenuNode();

            parent.Name = Language.GetLocalizedText(646, "Collections");

            Dictionary <string, DataSet> dataSets = DataSetManager.GetDataSets();

            foreach (DataSet d in dataSets.Values)
            {
                // Todo Change this to exploere earth, moon etc.
                if (d.Sky == true)
                {
                    if (d != null)
                    {
                        Dictionary <string, Places> placesList = d.GetPlaces();
                        foreach (Places places in placesList.Values)
                        {
                            if (places != null && places.Browseable)
                            {
                                parent.AddChild(places);
                            }
                        }
                    }
                }
            }
            return(parent);
        }
        private void GoToLatLong_Load(object sender, System.EventArgs e)
        {
            Dictionary <string, DataSet> datasets = DataSetManager.GetDataSets();

            foreach (DataSet d in datasets.Values)
            {
                if (d.Sky == sky)
                {
                    this.DataSetList.Items.Add(d);
                }
            }
            this.DataSetList.SelectedIndex = lastSelectedDatasetIndex;

            this.Categorys.SelectedIndex = lastSelectedIndexCatagorys;
            this.txtLat.Text             = Latitude.ToString();
            this.txtLong.Text            = Longitude.ToString();
            this.txtName.Text            = LocationName;
            this.txtAltitude.Text        = Altitude.ToString();
            if (sky)
            {
                this.lblLatitude.Text  = Language.GetLocalizedText(262, "Declination");
                this.lblLongitude.Text = Language.GetLocalizedText(263, "Right Ascension");
            }

            this.txtLat.Text  = Coordinates.FormatDMS(Latitude);
            this.txtLong.Text = Coordinates.FormatDMS(Longitude);
            if (Earth3d.MainWindow.CurrentImageSet.DataSetType == ImageSetType.Earth)
            {
                FromEarthView.Visible = true;
            }
        }
Example #4
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();
        }