Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 3
0
        private void loadFitsHeader(FitsFile file)
        {
            // enable save buttons
            saveToolStripMenuItem.Enabled   = true;
            saveAsToolStripMenuItem.Enabled = true;

            current_file = file ?? throw new Exception("No file currently loaded.").Log(); // set file global variable to the loaded file

            changeWindowTitle(file.Name);                                                  // change window title

            var header = FitsUtil.ReadFitsHeader(current_file.FilePath);

            HeaderRead(this, header);
            FitsLoaded(this, file);
        }