Exemple #1
0
        private static void DownloadMGDB(object o, EventArgs e)
        {
            if (Directory.Exists(MGDatabasePath))
            {
                var result = WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "MGDB already exists!", "Update MGDB?");
                if (result != DialogResult.Yes)
                {
                    return;
                }
                DeleteDirectory(MGDatabasePath); // Adding events will be handled by the next conditional
            }
            if (Directory.Exists(MGDatabasePath))
            {
                return;
            }

            var prompt = WinFormsUtil.Prompt(MessageBoxButtons.YesNo,
                                             "Download entire database?",
                                             "Download the entire database, which includes past generation events?",
                                             "Selecting No will download only the public release of the database.");

            var entire = prompt == DialogResult.Yes;

            EventsGallery.DownloadMGDBFromGitHub(MGDatabasePath, entire);
            WinFormsUtil.Alert("Download Finished");
            Legal.RefreshMGDB(MGDatabasePath);
        }
        public static void EventsGalleryExists()
        {
            var url = EventsGallery.GetMGDBDownloadURL();

            string.IsNullOrWhiteSpace(url).Should().BeFalse("Download URL should exist");

            var isUri = Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute);

            isUri.Should().BeTrue("Download URL should be valid");
        }