} // Puts the passed data into statics for this class, then calls other initialisation functions (PopulateDataGridView and InitialiseComponents, in this case.) private void buttonBack_Click(object sender, EventArgs e) { var formLocationDisplay = new FormLocationDisplay(locations); formLocationDisplay.Location = this.Location; formLocationDisplay.StartPosition = FormStartPosition.Manual; this.Hide(); formLocationDisplay.Show(); } // Creates a copy of the previous form (location display) and sets it to the same location as this form, with the same information as this form has.
} // Brings up a file selection dialogue, then copies the selected file into the relevant box on the form. private void buttonLaunch_Click(object sender, EventArgs e) { Location[] data = Filehandler.ReadFile(fileOpenBox.Text); if (data.Length != 0) { var formLocationDisplay = new FormLocationDisplay(data); formLocationDisplay.Location = this.Location; formLocationDisplay.StartPosition = FormStartPosition.Manual; this.Hide(); formLocationDisplay.Show(); } else { Console.WriteLine("Invalid file selection"); fileOpenBox.Text = "Invalid file was selected."; } } // Reads the selected file from the text box and atempts to ReadFile using the file handler. If the filehandler errors (indicated by an array length 0) outputs an error.