private void ApplyProfile(TSProfile profile)
 {
     Latitude             = profile.LatitudeDeg;
     vProfileView.Caption = profile.ToString();
     vProfileView.SetProfile(profile.Profile);
     verticalPropagationPlot.ClearDistance();
 }
        private void loadProfileBtn_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog oDialog = new OpenFileDialog())
            {
                oDialog.Title  = "Select a CSV-file containing TS-profile...";
                oDialog.Filter = "CSV (*.csv)|*.csv";

                if (oDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        var tsProfile = TSProfile.LoadFromFile(oDialog.FileName);
                        ApplyProfile(tsProfile);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }