private void btnLast_Click(object sender, EventArgs e) { FormSession session = new FormSession(Settings.GetSetting("LAST_SAVE")); session.FormClosed += (x, y) => { Close(); }; //Quickcast to close main Form after user closes the session Hide(); session.ShowDialog(); }
private void btnCreate_Click(object sender, EventArgs e) { FormSession session = new FormSession(string.Empty); session.FormClosed += (x, y) => { Close(); }; //Quickcast to close main Form after user closes the session Hide(); session.ShowDialog(); }
private void btnOpen_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = "Session ChartData|*session", DefaultExt = "session", Title = "Open Session" }; if (openFileDialog.ShowDialog() == DialogResult.OK) { FormSession session = new FormSession(openFileDialog.FileName); session.FormClosed += (x, y) => { Close(); }; //Quickcast to close main Form after user closes the session Hide(); session.ShowDialog(); } else { MessageBox.Show("You haven't chosen valid file!"); //Maybe return new invocation of this method? } }