예제 #1
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                // set the filename to save to the current file
                current_file = current_file ?? throw new Exception("No file currently loaded.").Log();

                saveFileDialog1.FileName = current_file.Name;

                // commit all editing stuff
                dataGridView1.EndEdit();
                dataGridView1.CurrentCell = null;

                DialogResult result  = saveFileDialog1.ShowDialog();
                string       newfile = saveFileDialog1.FileName;

                if (result == DialogResult.OK && current_file != null)
                {
                    FitsUtil.WriteFitsHeader(headerBS.List, current_file.FilePath, newfile);
                }
            }
            catch (Exception ex)
            {
                ex.Log().Display();
            }
        }
예제 #2
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                current_file = current_file ?? throw new Exception("No file currently loaded.").Log();
                dataGridView1.EndEdit();
                dataGridView1.CurrentCell = null;

                FitsUtil.WriteFitsHeader(headerBS.List, current_file.FilePath);
            }
            catch (Exception ex)
            {
                ex.Log().Display();
            }
        }