Esempio n. 1
0
        void popup_LaunchTour(object sender, EventArgs e)
        {
            ITourResult result = popup.TourResult;

            popup.Close();
            popup.Dispose();
            popup = null;
            LaunchTour(result);
        }
Esempio n. 2
0
        private void resultsList_ItemDoubleClicked(object sender, Object e)
        {
            ITourResult result = (ITourResult)e;

            if (e == null)
            {
                return;
            }
            LaunchTour(result);
        }
Esempio n. 3
0
        private static void LaunchTour(ITourResult result)
        {
            string url = String.Format("http://www.worldwidetelescope.org/wwtweb/GetTour.aspx?GUID={0}", result.Id);

            if (!Directory.Exists(Properties.Settings.Default.CahceDirectory + "tourcache\\"))
            {
                Directory.CreateDirectory(Properties.Settings.Default.CahceDirectory + "tourcache\\");
            }

            string tempFile = Properties.Settings.Default.CahceDirectory + "tourcache\\" + result.Id.ToString() + ".wtt";

            if (FileDownload.DownloadFile(url, tempFile, false))
            {
                FileInfo fi = new FileInfo(tempFile);
                if (fi.Length == 0)
                {
                    File.Delete(tempFile);
                    MessageBox.Show("The tour file could not be downloaded and is not in cache.Check you network connection.", "WorldWide Telescope Tours");
                    return;
                }
                Earth3d.MainWindow.LoadTourFromFile(tempFile, false, result.Id);
            }
        }
        public static TourPopup ShowEndTourPopup(TourDocument tour)
        {
            CloseTourPopups();
            if (endTour != null)
            {
                endTour.Close();
                endTour = null;
            }

            endTour = new TourPopup();
            endTour.PopupType = TourPopup.PopupTypes.TourOver;
            Tour tourResult = FolderBrowser.GetRelatedTour(tour.Id);
            if (tourResult == null)
            {
                tourResult = FolderBrowser.GetRelatedTour(tour.TagId);
            }

            if (tourResult == null)
            {
                tourResult = new Tour();
                tourResult.Author = tour.Author;
                tourResult.Id = tour.Id;
                tourResult.AuthorUrl = tour.AuthorUrl;
                tourResult.Description = tour.Description;
                tourResult.AuthorImage = tour.AuthorImage;
                tourResult.OrgName = tour.OrgName;
                tourResult.OrganizationUrl = tour.OrgUrl;
                tourResult.Title = tour.Title;
                tourResult.AverageUserRating = 3;
            }
            endTour.TourResult = tourResult;
            endTour.Show();
            return endTour;
        }
        public static void LaunchTour(ITourResult result)
        {
            var url = result.TourUrl;

            if (!Directory.Exists(Properties.Settings.Default.CahceDirectory + "tourcache\\"))
            {
                Directory.CreateDirectory(Properties.Settings.Default.CahceDirectory + "tourcache\\");
            }

            var tempFile = Properties.Settings.Default.CahceDirectory + "tourcache\\" + result.Id + ".wtt";

            if (FileDownload.DownloadFile(url, tempFile, false))
            {
                var fi = new FileInfo(tempFile);
                if (fi.Length == 0)
                {
                    File.Delete(tempFile);
                    MessageBox.Show(Language.GetLocalizedText(221, "The tour file could not be downloaded and is not in cache. Check you network connection."), "WorldWide Telescope Tours");
                    return;
                }
                Earth3d.MainWindow.LoadTourFromFile(tempFile, false, result.Id);
            }
            lastTourLaunched = result;
        }