static void Main() { //Just to make sure they're not empty Ratingprofiles = new SortableBindingList <Ratingprofile>(); Routingprofiles = new SortableBindingList <Routingprofile>(); Geocaches = new SortableBindingList <Geocache>(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainWindow = new Form1(); //select the Overview Tab MainWindow.LeftTabs.SelectedIndex = 1; MainWindow.UpdateStatus("Started reading databases"); if (File.Exists(Database_Filepath)) //Thus it is not the first start of the program { Fileoperations.ReadMainDatabase(); Startup.ReadRemainingDatabases(); } else { Startup.First(); } MainWindow.UpdateSettingsTextBoxes(); Startup.CheckSettings(); Startup.BindLists(); Application.Run(MainWindow); }
/// <summary> /// Calls the sbroutines for reading each database and sets the list event handlers /// </summary> public static void ReadRemainingDatabases() { Fileoperations.ReadRouterDB(); //Same thread, so it is ready when the program starts //Load Ratingprofiles from the File specified in the Database Fileoperations.ReadRatingprofiles(); //Geocaches Fileoperations.ReadGeocaches(); //Routingprofile Fileoperations.ReadRoutingprofiles(); Fileoperations.Backup(null); //so settings get saved in the DB. Nothing else, as it just came from the file }
private void New_ImportButton_Click(object sender, EventArgs e) { switch (ThisDB) { case Databases.Geocaches: Fileoperations.ImportGeocaches(); break; case Databases.Ratingprofiles: Fileoperations.NewRatingprofileDatabase(); break; case Databases.Routingprofiles: Fileoperations.NewRoutingprofileDatabase(); break; case Databases.RouterDB: Fileoperations.ImportOSMData(); break; } DialogResult = DialogResult.Retry; }